Class SwapBasisSystem
The basis functions 1, the next forward rate and the coterminal swap rate after it, at each exercise; at an exercise on the last rate, 1 and the forward rate.
[WorkingType]
public sealed class SwapBasisSystem : MarketModelBasisSystem
- Inheritance
-
SwapBasisSystem
- Inherited Members
Remarks
A working type.
Each exercise's number of functions follows its own rate (a documented divergence): QuantLib adjusts only the last
exercise's count (swapbasissystem.cpp:46), so an earlier exercise on the last rate reports 3 functions where
Values(CurveState, Span<double>) gives 2 (Divergences/BasisSystemFunctionCountTests.cs).
Constructors
SwapBasisSystem(ReadOnlySpan<double>, ReadOnlySpan<double>)
Initializes a new instance of the SwapBasisSystem class.
public SwapBasisSystem(ReadOnlySpan<double> rateTimes, ReadOnlySpan<double> exerciseTimes)
Parameters
rateTimesReadOnlySpan<double>The rate times.
exerciseTimesReadOnlySpan<double>The exercise times, the basis system's evolution.
Exceptions
- ArgumentException
The times don't make an evolution.
Properties
Evolution
Gets the evolution: its rate times and the times it is stepped at, its exercise times included.
public override EvolutionDescription Evolution { get; }
Property Value
NumberOfExercises
Gets the number of exercises.
public override int NumberOfExercises { get; }
Property Value
Methods
Clone()
A deep copy of the basis system, its state included.
public override MarketModelBasisSystem Clone()
Returns
- MarketModelBasisSystem
The copy.
IsExerciseTime()
Every evolution time is an exercise time.
public override ImmutableArray<bool> IsExerciseTime()
Returns
- ImmutableArray<bool>
One flag an exercise, every one set.
NextStep(CurveState)
Moves to the next evolution time, in the given state.
public override void NextStep(CurveState currentState)
Parameters
currentStateCurveStateThe state.
NumberOfFunctions()
The number of basis functions at each exercise: 3, or 2 at an exercise on the last rate.
public override ImmutableArray<int> NumberOfFunctions()
Returns
- ImmutableArray<int>
One count an exercise.
Reset()
Puts the provider at the start of a path.
public override void Reset()
Values(CurveState, Span<double>)
Writes the current exercise's data in the given state.
public override void Values(CurveState currentState, Span<double> results)
Parameters
currentStateCurveStateThe state.
resultsSpan<double>The data written, the current exercise's count of them.