当前位置: 首页>>代码示例>>C++>>正文


C++ CurveState::coterminalSwapRate方法代码示例

本文整理汇总了C++中CurveState::coterminalSwapRate方法的典型用法代码示例。如果您正苦于以下问题:C++ CurveState::coterminalSwapRate方法的具体用法?C++ CurveState::coterminalSwapRate怎么用?C++ CurveState::coterminalSwapRate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CurveState的用法示例。


在下文中一共展示了CurveState::coterminalSwapRate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: nextStep

    void BermudanSwaptionExerciseValue::nextStep(const CurveState& state) {
        const Payoff& p = (*payoffs_[currentIndex_]);
        Real value = state.coterminalSwapAnnuity(currentIndex_, currentIndex_) *
            p(state.coterminalSwapRate(currentIndex_));

     //   value /= state.discountRatios()[currentIndex_];
        value =  std::max(value, 0.0);
        cf_.timeIndex = currentIndex_;
        cf_.amount = value;
        ++currentIndex_;
    }
开发者ID:SePTimO7,项目名称:QuantLib,代码行数:11,代码来源:bermudanswaptionexercisevalue.cpp

示例2: values

    void SwapBasisSystem::values(const CurveState& currentState,
                                 std::vector<Real>& results) const {
        Size rateIndex = rateIndex_[currentIndex_-1];

        results.reserve(3);
        results.resize(2);
        results[0] = 1.0;
        results[1] = currentState.forwardRate(rateIndex);
        if (rateIndex < rateTimes_.size()-2)
            results.push_back(currentState.coterminalSwapRate(rateIndex+1));
    }
开发者ID:21hub,项目名称:QuantLib,代码行数:11,代码来源:swapbasissystem.cpp

示例3: nextTimeStep

    bool MultiStepCoterminalSwaptions::nextTimeStep(
            const CurveState& currentState,
            std::vector<Size>& numberCashFlowsThisStep,
            std::vector<std::vector<MarketModelMultiProduct::CashFlow> >&
                                                               genCashFlows)
    {
        genCashFlows[currentIndex_][0].timeIndex = currentIndex_;

        Rate swapRate = currentState.coterminalSwapRate(currentIndex_);
        Real annuity = currentState.coterminalSwapAnnuity(currentIndex_, currentIndex_);
        genCashFlows[currentIndex_][0].amount =
            (*payoffs_[currentIndex_])(swapRate) * annuity;
        std::fill(numberCashFlowsThisStep.begin(),
                  numberCashFlowsThisStep.end(),0);
        numberCashFlowsThisStep[currentIndex_] = 1;
        ++currentIndex_;
        return (currentIndex_ == lastIndex_);
    }
开发者ID:grantathon,项目名称:nquantlib64,代码行数:18,代码来源:multistepcoterminalswaptions.cpp

示例4: values

 void TriggeredSwapExercise::values(const CurveState& state,
                                    std::vector<Real>& results) const {
     Size swapIndex = rateIndex_[currentStep_-1];
     results.resize(1);
     results[0] = state.coterminalSwapRate(swapIndex);
 }
开发者ID:androidYibo,项目名称:documents,代码行数:6,代码来源:triggeredswapexercise.cpp


注:本文中的CurveState::coterminalSwapRate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。