Table of Contents

Class DoubleArray2DManaged

Namespace
FinanceSharp
Assembly
FinanceSharp.dll
public class DoubleArray2DManaged : DoubleArray, ICloneable, IDisposable, IEquatable<DoubleArray>
Inheritance
DoubleArray2DManaged
Implements
Inherited Members
Extension Methods

Constructors

DoubleArray2DManaged()

public DoubleArray2DManaged()

DoubleArray2DManaged(double[,])

public DoubleArray2DManaged(double[,] values)

Parameters

values double[,]

The structure value that'll be wrapped.

DoubleArray2DManaged(double[][])

public DoubleArray2DManaged(double[][] values)

Parameters

values double[][]

The structure value that'll be wrapped.

Remarks

This constructor copies given values to a double[Count, Properties]

DoubleArray2DManaged(int, int)

public DoubleArray2DManaged(int count, int properties)

Parameters

count int
properties int

Fields

values

protected double[,] values

Field Value

double[,]

Properties

AsDoubleSpan

Wraps this DoubleArray with Span<T>.

public override Span<double> AsDoubleSpan { get; }

Property Value

Span<double>

Examples

fixed (double* _ = doublearray) {
    doublearray.AsDoubleSpan.Fill(10d);
    double[] ret = doublearray.AsDoubleSpan.ToArray();
}

Remarks

Best practice to use AsDoubleSpan safely is first using fixed operator on the array and then access AsDoubleSpan. See examples.

Close

public override double Close { get; set; }

Property Value

double

Count

The number of items in this array, each having n Properties.

public override int Count { get; protected set; }

Property Value

int

InternalArray

Returns a reference to the unmanaged array stored internally.

public ref double[,] InternalArray { get; }

Property Value

double[,]

this[int]

Scalar overload.

public override double this[int property] { get; set; }

Parameters

property int

Property Value

double

this[int, int]

public override double this[int index, int property] { get; set; }

Parameters

index int
property int

Property Value

double

Properties

The count of properties for every

public override int Properties { get; protected set; }

Property Value

int

Value

public override double Value { get; set; }

Property Value

double

Methods

Clone()

Clones current DoubleArray.

public override DoubleArray Clone()

Returns

DoubleArray

A new copy of this.

ComputeHashCode()

Additional hashcode for inherieted classes.

protected override int ComputeHashCode()

Returns

int

ForEach(ReferenceForFunctionHandler)

public override void ForEach(ReferenceForFunctionHandler function)

Parameters

function ReferenceForFunctionHandler

GetLinear(int)

Reads from this DoubleArray linearly regardless to shape.

public override double GetLinear(int offset)

Parameters

offset int

Absolute offset

Returns

double

The value at given offset.

GetPinnableReference()

Provides a pinnable reference for fixing a DoubleArray.

public override ref double GetPinnableReference()

Returns

double

GetPinnableReference(int)

Provides a pinnable reference for fixing a DoubleArray at a specific index (of Count dimension).

public override ref double GetPinnableReference(int index)

Parameters

index int

Returns

double

Examples

fixed (double* pointer = &arr.GetPinnableReference(0)) {
    //use pointer to your needs
}

IsEqualExactlyTo(DoubleArray)

A comparison method used when Equals(DoubleArray) is called from IEquatable<T> to compare same types of DoubleArray.

protected override bool? IsEqualExactlyTo(DoubleArray other)

Parameters

other DoubleArray

An DoubleArray to compare to this.

Returns

bool?

Are this[int] equals to other. Null returned when test was not performed.

Reshape(int, int, bool)

Reshapes this DoubleArray to a shape of your choice, the shape must be

public override DoubleArray Reshape(int count, int properties, bool copy = true)

Parameters

count int

The count of items in this array.

properties int

Number of properties for every item in this array.

copy bool

Should a copy be reshaped?

Returns

DoubleArray

Exceptions

ReshapeException

When unable to reshape to reshape: LinearLength != (count * properties) then throws

SetLinear(int, double)

Writes to this DoubleArray linearly regardless to shape.

public override void SetLinear(int offset, double value)

Parameters

offset int

Absolute offset to set value at.

value double

The value to write

To2DArray()

Copies this array into a multi-dimensional array, double[,].

public override double[,] To2DArray()

Returns

double[,]

ToPinned(bool)

Pins this current InternalArray with DoubleArrayPinned2DManaged.

public DoubleArrayPinned2DManaged ToPinned(bool copy)

Parameters

copy bool

Should clone InternalArray passed to with DoubleArrayPinned2DManaged?

Returns

DoubleArrayPinned2DManaged