ILNumerics Ultimate VSSizeGetSeqIndex Method (UInt32, UInt32)ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
Retrieves the sequential index into an array stored according to this size descriptor object based on the provided index array d.

[ILNumerics Core Module]

Namespace: ILNumerics
Assembly: ILNumerics.Core (in ILNumerics.Core.dll) Version: 5.3.0.0 (5.3.7131.2749)
Syntax

public uint GetSeqIndex(
	uint* d,
	uint len
)

Parameters

d
Type: SystemUInt32*
System.Array with indices into the dimensions of this array.
len
Type: SystemUInt32
Length of d.

Return Value

Type: UInt32
Sequential index into the array when stored as 1D array of arbitrary storage order.
Exceptions

ExceptionCondition
IndexOutOfRangeException if any of the indices in d (except the last index stored, see above) is equal or greater than the length of its corresponding dimension.
IndexOutOfRangeException the resulting index points to a non-existing element.
Remarks

If the array addressed by this size has less dimensions than addressed by d, trailing indices (i.e.: such indices dealing with a dimension whose index is higher than existing in the array) correspond to 'virtual' or singleton dimensions. Those indices must address the 0-th element of the virtual dimension. Hence its value must be 0.

Conversely, if the array addressed by this size stores more dimensions than addressed by d the value of the last index from d may exceed the length of the corresponding dimension. In this case the sequential index to be returned is computed by subsequently merging trailing dimensions and folding the superflous modulus of the value of 'd[{last}]' to the next dimension, correspondingly. This process is repeated until either the number of dimensions is reached or the modified new value of 'd[{last}]' reaches 0.

This function recognizes arbitrarily strided size objects. It expects all sizes (dimension lengths, strides, the base offset and the number of elements) to fit into MaxValue. Use one of the overloads with Int64 parameters if you are dealing with very big arrays or negative indices.

[ILNumerics Core Module]

See Also

Reference