Class HyperslabIndex
The start defines the origin of the hyperslab in the original coordinates.
The stride is the number of elements to increment between selected elements.
A stride of '1' is every element, a stride of '2' is every second element, etc.
The default stride is 1.
The count is the number of elements in the hyperslab selection.
When the stride is 1, the selection is a hyper rectangle with a corner at start
and size count[0] by count[1] by ...
When stride is greater than one, the hyperslab bounded by start and the corners
defined by stride[n] * count[n].
The block is a count on the number of repetitions of the hyperslab.
The default block size is '1', which is one hyperslab. A block of 2 would be
two hyperslabs in that dimension, with the second starting at start[n]+ (count[n] * stride[n]) + 1.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected long[]protected long[]protected long[]protected long[]Fields inherited from class StrideIndex
strides -
Constructor Summary
ConstructorsConstructorDescriptionHyperslabIndex(long[] sizes, long[] selectionOffsets, long[] selectionStrides, long[] selectionCounts, long[] selectionBlocks) CallsHyperslabIndex(sizes, defaultStrides(sizes), selectionOffsets, selectionStrides, selectionCounts, selectionBlocks).HyperslabIndex(long[] sizes, long[] strides, long[] selectionOffsets, long[] selectionStrides, long[] selectionCounts, long[] selectionBlocks) Constructor to set theIndex.sizes,StrideIndex.strides,selectionOffsets,selectionStrides,selectionCounts, andselectionBlocks. -
Method Summary
Modifier and TypeMethodDescriptionlongindex(long i) Returnsi * strides[0].longindex(long... indices) Computes the linear index as the dot product of indices and strides.longindex(long i, long j) Returnsi * strides[0] + j * strides[1].longindex(long i, long j, long k) Returnsi * strides[0] + j * strides[1] + k * strides[2].Methods inherited from class StrideIndex
defaultStrides, strides
-
Field Details
-
selectionOffsets
protected long[] selectionOffsets -
selectionStrides
protected long[] selectionStrides -
selectionCounts
protected long[] selectionCounts -
selectionBlocks
protected long[] selectionBlocks
-
-
Constructor Details
-
HyperslabIndex
public HyperslabIndex(long[] sizes, long[] selectionOffsets, long[] selectionStrides, long[] selectionCounts, long[] selectionBlocks) CallsHyperslabIndex(sizes, defaultStrides(sizes), selectionOffsets, selectionStrides, selectionCounts, selectionBlocks). -
HyperslabIndex
public HyperslabIndex(long[] sizes, long[] strides, long[] selectionOffsets, long[] selectionStrides, long[] selectionCounts, long[] selectionBlocks) Constructor to set theIndex.sizes,StrideIndex.strides,selectionOffsets,selectionStrides,selectionCounts, andselectionBlocks. Also updates theIndex.sizesfor the resulting selection.
-
-
Method Details
-
index
public long index(long i) Description copied from class:StrideIndexReturnsi * strides[0].- Overrides:
indexin classStrideIndex
-
index
public long index(long i, long j) Description copied from class:StrideIndexReturnsi * strides[0] + j * strides[1].- Overrides:
indexin classStrideIndex
-
index
public long index(long i, long j, long k) Description copied from class:StrideIndexReturnsi * strides[0] + j * strides[1] + k * strides[2].- Overrides:
indexin classStrideIndex
-
index
public long index(long... indices) Description copied from class:StrideIndexComputes the linear index as the dot product of indices and strides.- Overrides:
indexin classStrideIndex- Parameters:
indices- of each dimension- Returns:
- index to access array or buffer
-