Class FdmExtendedOrnsteinUhlenbeckOp
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
The finite-difference operator of an ExtendedOrnsteinUhlenbeckProcess in one direction of a mesher: its drift at the step's mid-time, its diffusion, and the discount at the forward rate over the step.
[Experimental("NQL0001")]
public sealed class FdmExtendedOrnsteinUhlenbeckOp : FdmLinearOpComposite
- Inheritance
-
FdmExtendedOrnsteinUhlenbeckOp
- Inherited Members
Remarks
A finite-difference operator is a solver's working state: SetTime(double, double) sets the step's map in place, as QuantLib's does. QuantLib's boundary conditions, which it holds and never reads, are held likewise.
Constructors
FdmExtendedOrnsteinUhlenbeckOp(FdmMesher, ExtendedOrnsteinUhlenbeckProcess, YieldTermStructure, ImmutableArray<BoundaryCondition<FdmLinearOp>>, int)
Initializes a new instance of the FdmExtendedOrnsteinUhlenbeckOp class.
public FdmExtendedOrnsteinUhlenbeckOp(FdmMesher mesher, ExtendedOrnsteinUhlenbeckProcess process, YieldTermStructure rTS, ImmutableArray<BoundaryCondition<FdmLinearOp>> bcSet, int direction = 0)
Parameters
mesherFdmMesherThe mesher.
processExtendedOrnsteinUhlenbeckProcessThe process.
rTSYieldTermStructureThe discount curve.
bcSetImmutableArray<BoundaryCondition<FdmLinearOp>>The boundary conditions, held as QuantLib holds them.
directionintThe process's direction on the mesher.
Exceptions
- ArgumentNullException
An argument is null.
Properties
BcSet
Gets the boundary conditions, which QuantLib holds and never reads.
public ImmutableArray<BoundaryCondition<FdmLinearOp>> BcSet { get; }
Property Value
Size
Gets the number of directions.
public override int Size { get; }
Property Value
Methods
Apply(ReadOnlySpan<double>, Span<double>)
Applies the operator to r, writing the result into the caller's span.
public override void Apply(ReadOnlySpan<double> r, Span<double> result)
Parameters
rReadOnlySpan<double>The values, one per point.
resultSpan<double>The result, of
r's length; it mustn't overlapr.
ApplyDirection(int, ReadOnlySpan<double>, Span<double>)
Applies the operator's part in one direction, writing the result into the caller's span.
public override void ApplyDirection(int direction, ReadOnlySpan<double> r, Span<double> result)
Parameters
directionintThe direction.
rReadOnlySpan<double>The values, one per point.
resultSpan<double>The result, of
r's length.
ApplyMixed(ReadOnlySpan<double>, Span<double>)
Applies the operator's mixed part, writing the result into the caller's span.
public override void ApplyMixed(ReadOnlySpan<double> r, Span<double> result)
Parameters
rReadOnlySpan<double>The values, one per point.
resultSpan<double>The result, of
r's length.
Preconditioner(ReadOnlySpan<double>, double, Span<double>)
Applies the preconditioner of (1 + s·A), writing the result into the caller's
span.
public override void Preconditioner(ReadOnlySpan<double> r, double s, Span<double> result)
Parameters
rReadOnlySpan<double>The values, one per point.
sdoubleThe scale of the operator.
resultSpan<double>The result, of
r's length.
SetTime(double, double)
Sets the operator for the interval [t1, t2].
public override void SetTime(double t1, double t2)
Parameters
SolveSplitting(int, ReadOnlySpan<double>, double, Span<double>)
Solves (1 + s·Adirection) x = r for x, writing it into the
caller's span.
public override void SolveSplitting(int direction, ReadOnlySpan<double> r, double s, Span<double> result)
Parameters
directionintThe direction.
rReadOnlySpan<double>The right-hand side, one value per point.
sdoubleThe scale of the direction's operator.
resultSpan<double>The solution, of
r's length.
ToMatrixDecomp()
The operator as sparse matrices, one per part.
public override ImmutableArray<SparseMatrix> ToMatrixDecomp()
Returns
- ImmutableArray<SparseMatrix>
The matrices.
Exceptions
- NanoQLException
The operator has no sparse representation.