ILNumerics Ultimate VS

SizeGetSeqIndex Method (Int64)

ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
Retrieves the storage element index into an array stored according to this size descriptor object based on the provided sequential index d0. Allows negative indices.

[ILNumerics Core Module]

Namespace:  ILNumerics
Assembly:  ILNumerics.Core (in ILNumerics.Core.dll) Version: 5.5.0.0 (5.5.7503.3146)
Syntax

public long GetSeqIndex(
	long d0
)

Parameters

d0
Type: SystemInt64
Index into the first dimension / sequential index.

Return Value

Type: Int64
Storage element index addressing the element in memory.
Exceptions

ExceptionCondition
IndexOutOfRangeException if the leading dimension specifier d0 is equal to or greater than the NumberOfElements.
Remarks

For arrays of column vector shape d0 references the index of the row of the storage element to return.

More general, for n-dimensional arrays the first index corresponds to the position in the first (index 0) dimension.

If the array refered to by this size stores more dimensions than addressable by this function d0 can exceed the limits of the first dimension. In this case the storage element index to be returned is computed by subsequently merging trailing dimensions and applying the superflous modulos of the value of d0 to the next dimension, correspondingly. This process is repeated until either the number of dimensions is reached or the superflous indices reach the value of 0.

d0 may be negative, in which case the resulting index is computed by adding the number of elements in the array to the parameters value. Hence, a value of -1 addresses the last element in the array.

This function recognizes arbitrary strides. It expects all sizes (dimension lengths, strides, the base offset and the number of elements) to fit into MaxValue. Consider using one of the overloads with UInt32 parameters if you are not dealing with very big arrays and don't require negative indexing. This may bring better performance in tight loops.

Performance hint: this function (and all corresponding overloads) are optimized for the case where the number of index parameters provided corresponds to the number of dimensions in the array and all provided index parameters are within the range of their corresponding dimension. The functions, however, handle arbitrary cases, including addressing, merging and ommitting trailing dimensions. Any of those extended features may introduce a performance penalty, though.

[ILNumerics Core Module]

See Also

Reference