Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
NumericLgmSwaptionEngine Class Reference

#include <qle/pricingengines/numericlgmmultilegoptionengine.hpp>

+ Inheritance diagram for NumericLgmSwaptionEngine:
+ Collaboration diagram for NumericLgmSwaptionEngine:

Public Member Functions

 NumericLgmSwaptionEngine (const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > &model, const Real sy, const Size ny, const Real sx, const Size nx, const Handle< YieldTermStructure > &discountCurve=Handle< YieldTermStructure >(), const Size americanExerciseTimeStepsPerYear=24)
 
 NumericLgmSwaptionEngine (const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > &model, const Real maxTime=50.0, const QuantLib::FdmSchemeDesc scheme=QuantLib::FdmSchemeDesc::Douglas(), const Size stateGridPoints=64, const Size timeStepsPerYear=24, const Real mesherEpsilon=1E-4, const Handle< YieldTermStructure > &discountCurve=Handle< YieldTermStructure >(), const Size americanExerciseTimeStepsPerYear=24)
 
void calculate () const override
 
- Public Member Functions inherited from NumericLgmMultiLegOptionEngineBase
 NumericLgmMultiLegOptionEngineBase (const QuantLib::ext::shared_ptr< LgmBackwardSolver > &solver, const Handle< YieldTermStructure > &discountCurve=Handle< YieldTermStructure >(), const Size americanExerciseTimeStepsPerYear=24)
 

Additional Inherited Members

- Static Public Member Functions inherited from NumericLgmMultiLegOptionEngineBase
static bool instrumentIsHandled (const MultiLegOption &m, std::vector< std::string > &messages)
 
- Protected Member Functions inherited from NumericLgmMultiLegOptionEngineBase
CashflowInfo buildCashflowInfo (const Size i, const Size j) const
 
void calculate () const
 
- Static Protected Member Functions inherited from NumericLgmMultiLegOptionEngineBase
static bool instrumentIsHandled (const std::vector< Leg > &legs, const std::vector< bool > &payer, const std::vector< Currency > &currency, const QuantLib::ext::shared_ptr< Exercise > &exercise, const Settlement::Type &settlementType, const Settlement::Method &settlementMethod, std::vector< std::string > &messages)
 
- Protected Attributes inherited from NumericLgmMultiLegOptionEngineBase
QuantLib::ext::shared_ptr< LgmBackwardSolversolver_
 
Handle< YieldTermStructure > discountCurve_
 
Size americanExerciseTimeStepsPerYear_
 
std::vector< Leg > legs_
 
std::vector< boolpayer_
 
std::vector< Currency > currency_
 
QuantLib::ext::shared_ptr< Exercise > exercise_
 
Settlement::Type settlementType_
 
Settlement::Method settlementMethod_
 
Real npv_
 
Real underlyingNpv_
 
std::map< std::string, boost::any > additionalResults_
 

Detailed Description

Definition at line 105 of file numericlgmmultilegoptionengine.hpp.

Constructor & Destructor Documentation

◆ NumericLgmSwaptionEngine() [1/2]

NumericLgmSwaptionEngine ( const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > &  model,
const Real  sy,
const Size  ny,
const Real  sx,
const Size  nx,
const Handle< YieldTermStructure > &  discountCurve = Handle<YieldTermStructure>(),
const Size  americanExerciseTimeStepsPerYear = 24 
)

Definition at line 563 of file numericlgmmultilegoptionengine.cpp.

567 : NumericLgmMultiLegOptionEngineBase(QuantLib::ext::make_shared<LgmConvolutionSolver2>(model, sy, ny, sx, nx),
568 discountCurve, americanExerciseTimeStepsPerYear) {
569 registerWith(solver_->model());
570 registerWith(discountCurve_);
571}
QuantLib::ext::shared_ptr< LgmBackwardSolver > solver_
NumericLgmMultiLegOptionEngineBase(const QuantLib::ext::shared_ptr< LgmBackwardSolver > &solver, const Handle< YieldTermStructure > &discountCurve=Handle< YieldTermStructure >(), const Size americanExerciseTimeStepsPerYear=24)

◆ NumericLgmSwaptionEngine() [2/2]

NumericLgmSwaptionEngine ( const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > &  model,
const Real  maxTime = 50.0,
const QuantLib::FdmSchemeDesc  scheme = QuantLib::FdmSchemeDesc::Douglas(),
const Size  stateGridPoints = 64,
const Size  timeStepsPerYear = 24,
const Real  mesherEpsilon = 1E-4,
const Handle< YieldTermStructure > &  discountCurve = Handle<YieldTermStructure>(),
const Size  americanExerciseTimeStepsPerYear = 24 
)

Definition at line 573 of file numericlgmmultilegoptionengine.cpp.

580 QuantLib::ext::make_shared<LgmFdSolver>(model, maxTime, scheme, stateGridPoints, timeStepsPerYear, mesherEpsilon),
581 discountCurve, americanExerciseTimeStepsPerYear) {
582 registerWith(solver_->model());
583 registerWith(discountCurve_);
584}

Member Function Documentation

◆ calculate()

void calculate ( ) const
override

Definition at line 586 of file numericlgmmultilegoptionengine.cpp.

586 {
587 legs_ = arguments_.legs;
588 payer_.resize(arguments_.payer.size());
589 for (Size i = 0; i < arguments_.payer.size(); ++i) {
590 payer_[i] = QuantLib::close_enough(arguments_.payer[i], -1.0);
591 }
592 currency_ = std::vector<Currency>(legs_.size(), arguments_.swap->iborIndex()->currency());
593 exercise_ = arguments_.exercise;
594 settlementType_ = arguments_.settlementType;
595 settlementMethod_ = arguments_.settlementMethod;
596
598
599 results_.value = npv_;
600 results_.additionalResults = additionalResults_;
601 results_.additionalResults["underlyingNpv"] = underlyingNpv_;
602} // NumericLgmSwaptionEngine::calculate
const Instrument::results * results_
Definition: cdsoption.cpp:81
Swap::arguments * arguments_
+ Here is the call graph for this function: