public class HyperslabIndex extends StrideIndex
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.
| Modifier and Type | Field and Description |
|---|---|
protected long[] |
selectionBlocks |
protected long[] |
selectionCounts |
protected long[] |
selectionOffsets |
protected long[] |
selectionStrides |
strides| Constructor and Description |
|---|
HyperslabIndex(long[] sizes,
long[] selectionOffsets,
long[] selectionStrides,
long[] selectionCounts,
long[] selectionBlocks)
Calls
HyperslabIndex(sizes, defaultStrides(sizes), selectionOffsets, selectionStrides, selectionCounts, selectionBlocks). |
HyperslabIndex(long[] sizes,
long[] strides,
long[] selectionOffsets,
long[] selectionStrides,
long[] selectionCounts,
long[] selectionBlocks)
Constructor to set the
Index.sizes, StrideIndex.strides, selectionOffsets, selectionStrides,
selectionCounts, and selectionBlocks. |
| Modifier and Type | Method and Description |
|---|---|
long |
index(long... indices)
Computes the linear index as the dot product of indices and strides.
|
long |
index(long i)
Returns
i * strides[0]. |
long |
index(long i,
long j)
Returns
i * strides[0] + j * strides[1]. |
long |
index(long i,
long j,
long k)
Returns
i * strides[0] + j * strides[1] + k * strides[2]. |
defaultStrides, stridesprotected long[] selectionOffsets
protected long[] selectionStrides
protected long[] selectionCounts
protected long[] selectionBlocks
public HyperslabIndex(long[] sizes,
long[] selectionOffsets,
long[] selectionStrides,
long[] selectionCounts,
long[] selectionBlocks)
HyperslabIndex(sizes, defaultStrides(sizes), selectionOffsets, selectionStrides, selectionCounts, selectionBlocks).public HyperslabIndex(long[] sizes,
long[] strides,
long[] selectionOffsets,
long[] selectionStrides,
long[] selectionCounts,
long[] selectionBlocks)
Index.sizes, StrideIndex.strides, selectionOffsets, selectionStrides,
selectionCounts, and selectionBlocks. Also updates the Index.sizes for the resulting selection.public long index(long i)
StrideIndexi * strides[0].index in class StrideIndexpublic long index(long i,
long j)
StrideIndexi * strides[0] + j * strides[1].index in class StrideIndexpublic long index(long i,
long j,
long k)
StrideIndexi * strides[0] + j * strides[1] + k * strides[2].index in class StrideIndexpublic long index(long... indices)
StrideIndexindex in class StrideIndexindices - of each dimensionCopyright © 2023. All rights reserved.