Class HyperslabIndex
- java.lang.Object
-
- org.bytedeco.javacpp.indexer.Index
-
- org.bytedeco.javacpp.indexer.StrideIndex
-
- org.bytedeco.javacpp.indexer.HyperslabIndex
-
public class HyperslabIndex extends StrideIndex
A hyperslab is a rectangular pattern defined by four arrays.The
startdefines the origin of the hyperslab in the original coordinates. Thestrideis 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. Thecountis the number of elements in the hyperslab selection. When the stride is 1, the selection is a hyper rectangle with a corner atstartand sizecount[0]bycount[1]by ... When stride is greater than one, the hyperslab bounded by start and the corners defined bystride[n] * count[n]. Theblockis 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 atstart[n]+ (count[n] * stride[n]) + 1.
-
-
Field Summary
Fields Modifier and Type Field Description protected long[]selectionBlocksprotected long[]selectionCountsprotected long[]selectionOffsetsprotected long[]selectionStrides-
Fields inherited from class org.bytedeco.javacpp.indexer.StrideIndex
strides
-
-
Constructor Summary
Constructors Constructor Description HyperslabIndex(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longindex(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 org.bytedeco.javacpp.indexer.StrideIndex
defaultStrides, strides
-
-
-
-
Constructor Detail
-
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 Detail
-
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
-
-