[ILNumerics Core Module]
Assembly: ILNumerics.Core (in ILNumerics.Core.dll) Version: 188.8.131.52 (5.5.7503.3146)
public long GetSeqIndex( long d0, long d1, long d2, long d3, long d4, long d5, long d6 )
Public Function GetSeqIndex ( d0 As Long, d1 As Long, d2 As Long, d3 As Long, d4 As Long, d5 As Long, d6 As Long ) As Long Dim instance As Size Dim d0 As Long Dim d1 As Long Dim d2 As Long Dim d3 As Long Dim d4 As Long Dim d5 As Long Dim d6 As Long Dim returnValue As Long returnValue = instance.GetSeqIndex(d0, d1, d2, d3, d4, d5, d6)
Index into the first dimension.
Index into the second dimension.
Index into the third dimension.
Index into the fourth dimension.
Index into the fives dimension.
Index into the sixth dimension.
Index into the seventh dimension.
Sequential index into the array when stored as 1D array of arbitrary storage order.
|if any of the dimension specifiers d0 ... d6 is equal or greater than the length of its corresponding dimension.|
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 may exceeds the limit of its 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 the last parameter provided into the next dimension, correspondingly. This process is repeated until either the number of dimensions is reached or the remaining index value reaches 0.
Any index parameter may be negative, in which case the resulting index is computed by adding the corresponding dimension length to the parameters value. Hence, a value of -1 addresses the last element in the dimension. Note, that for the last specified dimension a value of -1 references the last element in the _virtual_ dimension, merged with any non specified trailing dimensions.
This function recognizes arbitrarily strided objects. It expects all sizes (dimension lengths, strides, the base offset and the number of elements) to fit into. Consider using one of the overloads with 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]