ILNumerics Ultimate VS

SizeGetSeqIndex Method (UInt32, UInt32, UInt32, UInt32, 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 indices d0 ... d5.

[ILNumerics Core Module]

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

public uint GetSeqIndex(
	uint d0,
	uint d1,
	uint d2,
	uint d3,
	uint d4,
	uint d5


Type: SystemUInt32
Index into the first dimension.
Type: SystemUInt32
Index into the second dimension.
Type: SystemUInt32
Index into the third dimension.
Type: SystemUInt32
Index into the fourth dimension.
Type: SystemUInt32
Index into the fives dimension.
Type: SystemUInt32
Index into the sixth dimension.

Return Value

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

IndexOutOfRangeException if any of the leading dimension specifiers d0 ... d4 is equal or greater than the length of its corresponding dimension.
IndexOutOfRangeException if d5 is equal or greater than the length of the last dimension and the resulting index after merging trailing dimensions points to a non-existing element.

For arrays of matrix shape d0 references the index of the row and d1 references the index of the column of the sequential index to return.

More general, for n-dimensional arrays the first index corresponds to the position in the first (index: 0) dimension, the second index to the position of the element in the second dimension (index: 1) and so forth ...

If the array addressed by this size has less dimensions than addressed by this function, trailing indices (i.e.: such indices which deal 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 this function the last index parameter d5 may exceeds the limit of its corresponding dimension. In this case the sequential index returned is computed by subsequently merging trailing dimensions and folding the superflous modulus of the value of d5 to the next dimension, correspondingly. This process is repeated until either the number of dimensions is reached or the modified new value of d5 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.

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