Table of Contents

Class FdmLinearOpLayout

Namespace
NanoQL.Methods
Assembly
NanoQL.dll

The memory layout of a finite-difference operator's points: the number of points in each direction, the first direction contiguous, each later one spaced by the product of the earlier dimensions.

public sealed class FdmLinearOpLayout
Inheritance
FdmLinearOpLayout
Inherited Members

Remarks

Immutable once built.

Constructors

FdmLinearOpLayout(IEnumerable<int>)

Initializes a new instance of the FdmLinearOpLayout class.

public FdmLinearOpLayout(IEnumerable<int> dim)

Parameters

dim IEnumerable<int>

The number of points in each direction.

Exceptions

ArgumentNullException

dim is null.

ArgumentOutOfRangeException

A dimension is negative.

ArgumentException

No dimension is given, where QuantLib writes the first spacing of an empty vector, undefined.

Properties

Dim

Gets the number of points in each direction.

public ImmutableArray<int> Dim { get; }

Property Value

ImmutableArray<int>

Size

Gets the number of points.

public int Size { get; }

Property Value

int

Spacing

Gets each direction's spacing in storage order.

public ImmutableArray<int> Spacing { get; }

Property Value

ImmutableArray<int>

Methods

Begin()

A new iterator at the first point: QuantLib's begin().

public FdmLinearOpIterator Begin()

Returns

FdmLinearOpIterator

The iterator.

End()

The iterator past the last point: QuantLib's end(), an index without coordinates.

public FdmLinearOpIterator End()

Returns

FdmLinearOpIterator

The iterator.

Index(ReadOnlySpan<int>)

The index of a point in storage order.

public int Index(ReadOnlySpan<int> coordinates)

Parameters

coordinates ReadOnlySpan<int>

The point's coordinates.

Returns

int

The index.

Exceptions

ArgumentException

coordinates holds more coordinates than the layout's directions, where QuantLib reads past its spacing.

IterNeighbourhood(FdmLinearOpIterator, int, int)

A new iterator at a point's neighbour offset steps away in direction i, reflected at the grid's edges.

public FdmLinearOpIterator IterNeighbourhood(FdmLinearOpIterator iterator, int i, int offset)

Parameters

iterator FdmLinearOpIterator

The point.

i int

The direction.

offset int

The offset.

Returns

FdmLinearOpIterator

The neighbour's iterator.

Exceptions

ArgumentNullException

iterator is null.

Neighbourhood(FdmLinearOpIterator, int, int)

The index of a point's neighbour offset steps away in direction i, reflected at the grid's edges.

public int Neighbourhood(FdmLinearOpIterator iterator, int i, int offset)

Parameters

iterator FdmLinearOpIterator

The point.

i int

The direction.

offset int

The offset.

Returns

int

The neighbour's index.

Exceptions

ArgumentNullException

iterator is null.

Neighbourhood(FdmLinearOpIterator, int, int, int, int)

The index of a point's neighbour offset1 steps away in direction i1 and offset2 in direction i2, reflected at the grid's edges.

public int Neighbourhood(FdmLinearOpIterator iterator, int i1, int offset1, int i2, int offset2)

Parameters

iterator FdmLinearOpIterator

The point.

i1 int

The first direction.

offset1 int

The offset in the first direction.

i2 int

The second direction.

offset2 int

The offset in the second direction.

Returns

int

The neighbour's index.

Exceptions

ArgumentNullException

iterator is null.