Class MultiStepCoterminalSwaps
The coterminal payer swaps, one product a rate: swap i, from rate i to the last, pays at each of its rates' resets the fixed coupon −K τᶠⁱˣ and the floating coupon f τᶠˡᵒᵃᵗ, at the period's payment time.
[WorkingType]
public sealed class MultiStepCoterminalSwaps : MultiProductMultiStep
- Inheritance
-
MultiStepCoterminalSwaps
- Inherited Members
Remarks
A working type. Fewer accruals or payment times than rates are refused, where QuantLib reads past them.
Constructors
MultiStepCoterminalSwaps(ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<double>, double)
Initializes a new instance of the MultiStepCoterminalSwaps class.
public MultiStepCoterminalSwaps(ReadOnlySpan<double> rateTimes, ReadOnlySpan<double> fixedAccruals, ReadOnlySpan<double> floatingAccruals, ReadOnlySpan<double> paymentTimes, double fixedRate)
Parameters
rateTimesReadOnlySpan<double>The rate times, at least two.
fixedAccrualsReadOnlySpan<double>The fixed leg's accruals, one a rate at least.
floatingAccrualsReadOnlySpan<double>The floating leg's accruals, one a rate at least.
paymentTimesReadOnlySpan<double>The payment times, increasing, one a rate at least.
fixedRatedoubleThe fixed rate.
Exceptions
- ArgumentException
The times aren't increasing, or the inputs are shorter than the rates.
Properties
MaxNumberOfCashFlowsPerProductPerStep
Gets 2: the fixed and the floating coupon.
public override int MaxNumberOfCashFlowsPerProductPerStep { get; }
Property Value
NumberOfProducts
Gets the number of rates: a swap from each.
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 times the product can pay at, which its cash flows' time indices index.
public override ImmutableArray<double> PossibleCashFlowTimes()
Returns
- ImmutableArray<double>
The times.
Reset()
Puts the product at the start of a path.
public override void Reset()