Package org.bytedeco.javacpp.indexer
Class Index
- java.lang.Object
-
- org.bytedeco.javacpp.indexer.Index
-
- Direct Known Subclasses:
OneIndex,StrideIndex
public abstract class Index extends java.lang.ObjectProvides an interface for classes that compute a linear index from given array sizes.- See Also:
OneIndex,StrideIndex,HyperslabIndex
-
-
Field Summary
Fields Modifier and Type Field Description protected long[]sizesThe number of elements in each dimension.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Indexcreate(long size)Returnsnew OneIndex(size).static Indexcreate(long... sizes)Returnsnew StrideIndex(sizes).static Indexcreate(long[] sizes, long[] strides)Returnsnew StrideIndex(sizes, strides).static Indexcreate(long[] sizes, long[] selectionOffsets, long[] selectionStrides, long[] selectionCounts, long[] selectionBlocks)Returnsnew HyperslabIndex(sizes, selectionOffsets, selectionStrides, selectionCounts, selectionBlocks).static Indexcreate(long[] sizes, long[] strides, long[] selectionOffsets, long[] selectionStrides, long[] selectionCounts, long[] selectionBlocks)Returnsnew HyperslabIndex(sizes, strides, selectionOffsets, selectionStrides, selectionCounts, selectionBlocks).longindex(long i)Returnsindex(new long[] {i}).abstract longindex(long... indices)Computes the linear index.longindex(long i, long j)Returnsindex(new long[] {i, j}).longindex(long i, long j, long k)Returnsindex(new long[] {i, j, k}).intrank()Returnssizes.length.longsize(int i)Returnssizes[i].long[]sizes()Returnssizes.
-
-
-
Constructor Detail
-
Index
public Index(long... sizes)
Constructor to set thesizes.
-
-
Method Detail
-
create
public static Index create(long size)
Returnsnew OneIndex(size).
-
create
public static Index create(long... sizes)
Returnsnew StrideIndex(sizes).
-
create
public static Index create(long[] sizes, long[] strides)
Returnsnew StrideIndex(sizes, strides).
-
create
public static Index create(long[] sizes, long[] selectionOffsets, long[] selectionStrides, long[] selectionCounts, long[] selectionBlocks)
Returnsnew HyperslabIndex(sizes, selectionOffsets, selectionStrides, selectionCounts, selectionBlocks).
-
create
public static Index create(long[] sizes, long[] strides, long[] selectionOffsets, long[] selectionStrides, long[] selectionCounts, long[] selectionBlocks)
Returnsnew HyperslabIndex(sizes, strides, selectionOffsets, selectionStrides, selectionCounts, selectionBlocks).
-
rank
public int rank()
Returnssizes.length.
-
sizes
public long[] sizes()
Returnssizes.
-
size
public long size(int i)
Returnssizes[i].
-
index
public long index(long i)
Returnsindex(new long[] {i}).
-
index
public long index(long i, long j)Returnsindex(new long[] {i, j}).
-
index
public long index(long i, long j, long k)Returnsindex(new long[] {i, j, k}).
-
index
public abstract long index(long... indices)
Computes the linear index.- Parameters:
indices- of each dimension- Returns:
- index to access array or buffer
-
-