Class ExerciseAdapter
An exercise value as a product: stepped at the exercise value's times, it pays the exercise value at its first exercise time and is done there.
[WorkingType]
public sealed class ExerciseAdapter : MultiProductMultiStep
- Inheritance
-
ExerciseAdapter
- Inherited Members
Remarks
A working type: it steps its own clone of the exercise value. A call-specified product's rebate in QuantLib's callable cases.
Constructors
ExerciseAdapter(MarketModelExerciseValue, int)
Initializes a new instance of the ExerciseAdapter class.
public ExerciseAdapter(MarketModelExerciseValue exercise, int numberOfProducts = 1)
Parameters
exerciseMarketModelExerciseValueThe exercise value, cloned.
numberOfProductsintThe number of products, the first paid.
Exceptions
- ArgumentException
The exercise value's rate times are fewer than two.
Properties
Evolution
Gets the exercise value's evolution.
public override EvolutionDescription Evolution { get; }
Property Value
ExerciseValue
Gets the exercise value the adapter steps: its own clone, which reading doesn't change.
public MarketModelExerciseValue ExerciseValue { get; }
Property Value
MaxNumberOfCashFlowsPerProductPerStep
Gets 1.
public override int MaxNumberOfCashFlowsPerProductPerStep { get; }
Property Value
NumberOfProducts
Gets the number of products.
public override int NumberOfProducts { get; }
Property Value
Methods
Clone()
A deep copy of the product, its state included.
public override MarketModelMultiProduct Clone()
Returns
- MarketModelMultiProduct
A new product.
NextTimeStep(CurveState, Span<int>, MarketModelMultiProductCashFlow[][])
Moves the product a step: writes each product's number of cash flows at this step and the cash flows.
public override bool NextTimeStep(CurveState currentState, Span<int> numberCashFlowsThisStep, MarketModelMultiProductCashFlow[][] cashFlowsGenerated)
Parameters
currentStateCurveStateThe state of the curve at the step's end.
numberCashFlowsThisStepSpan<int>Each product's number of cash flows, written; one entry a product.
cashFlowsGeneratedMarketModelMultiProductCashFlow[][]Each product's cash flows, written from the first; NumberOfProducts rows of at least MaxNumberOfCashFlowsPerProductPerStep.
Returns
- bool
Whether the path is finished for the product.
PossibleCashFlowTimes()
The exercise value's cash-flow times.
public override ImmutableArray<double> PossibleCashFlowTimes()
Returns
- ImmutableArray<double>
The times.
Reset()
Puts the product at the start of a path.
public override void Reset()