Table of Contents

Class SlicedDoubleArray

Namespace
FinanceSharp
Assembly
FinanceSharp.dll

Provides a wrapping DoubleArray to contiguously slice.

public class SlicedDoubleArray : DoubleArray, ICloneable, IDisposable, IEquatable<DoubleArray>
Inheritance
SlicedDoubleArray
Implements
Inherited Members
Extension Methods

Constructors

SlicedDoubleArray(DoubleArray, int, int)

public SlicedDoubleArray(DoubleArray slicedArray, int start, int stop)

Parameters

slicedArray DoubleArray
start int
stop int

Fields

internalArray

protected DoubleArray internalArray

Field Value

DoubleArray

start

protected int start

Field Value

int

stop

protected int stop

Field Value

int

Properties

Count

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

public override int Count { get; protected set; }

Property Value

int

InternalArray

Provides access to the internal array that is being sliced by this class.

public DoubleArray InternalArray { get; }

Property Value

DoubleArray

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

Start

Start of interval. The interval includes this value. The default start value is 0.

public int Start { get; }

Property Value

int

Stop

End of interval. The interval does not include this value, except in some cases where step is not an integer and floating point round-off affects the length of out.

public int Stop { get; }

Property Value

int

Methods

AdjustIndex(int)

protected int AdjustIndex(int index)

Parameters

index int

Returns

int

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

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

Remarks

A sliced array always copies.

Exceptions

ReshapeException

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