ILNumerics Ultimate VS

SizeGetElementSpan Method

ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
Gets the element index of the last element addressed by this size descriptor.

[ILNumerics Core Module]

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

public long GetElementSpan()

Return Value

Type: Int64
Element span.

The value computed indicates the size of memory region required to store all elements of an array according to this size descriptor. Basically, the value indicates the element position where the last (highest address) element is stored in the 1-dimensional array / memory region. Since no negative indices are allowed, the 'last' element is the one with index tupels corresponding to the value of "dimension length - 1" for each dimension. The value returned will simply be the sum of such tuple items.

This value is useful to 1) provide sufficiently large Array for exporting and copying of elements in arbitray storage layouts, and 2) to determine whether a certain storage layout stores the elements continously in memory (for cache performant iteration).

The storage layout is continous, if and only if the value returned is equal to NumberOfElements minus 1.

[ILNumerics Core Module]

See Also