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
start
defines the origin of the hyperslab in the original coordinates. Thestride
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. Thecount
is the number of elements in the hyperslab selection. When the stride is 1, the selection is a hyper rectangle with a corner atstart
and sizecount[0]
bycount[1]
by ... When stride is greater than one, the hyperslab bounded by start and the corners defined bystride[n] * count[n]
. Theblock
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 atstart[n]+ (count[n] * stride[n]) + 1
.
-
-
Field Summary
Fields Modifier and Type Field Description protected long[]
selectionBlocks
protected long[]
selectionCounts
protected long[]
selectionOffsets
protected 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 long
index(long i)
Returnsi * strides[0]
.long
index(long... indices)
Computes the linear index as the dot product of indices and strides.long
index(long i, long j)
Returnsi * strides[0] + j * strides[1]
.long
index(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.sizes
for the resulting selection.
-
-
Method Detail
-
index
public long index(long i)
Description copied from class:StrideIndex
Returnsi * strides[0]
.- Overrides:
index
in classStrideIndex
-
index
public long index(long i, long j)
Description copied from class:StrideIndex
Returnsi * strides[0] + j * strides[1]
.- Overrides:
index
in classStrideIndex
-
index
public long index(long i, long j, long k)
Description copied from class:StrideIndex
Returnsi * strides[0] + j * strides[1] + k * strides[2]
.- Overrides:
index
in classStrideIndex
-
index
public long index(long... indices)
Description copied from class:StrideIndex
Computes the linear index as the dot product of indices and strides.- Overrides:
index
in classStrideIndex
- Parameters:
indices
- of each dimension- Returns:
- index to access array or buffer
-
-