public class Indices extends Object
Constructor and Description |
---|
Indices() |
Modifier and Type | Method and Description |
---|---|
static NDArrayIndex[] |
adjustIndices(int[] originalShape,
NDArrayIndex... indexes)
Prunes indices of greater length than the shape
and fills in missing indices if there are any
|
static NDArrayIndex[] |
fillIn(int[] shape,
NDArrayIndex... indexes)
Fill in the missing indices to be the
same length as the original shape.
|
static boolean |
isContiguous(int[] indices)
Returns whether the indices are contiguous by one or not
|
static boolean |
isContiguous(int[] indices,
int diff)
Returns whether indices are contiguous
by a certain amount or not
|
static boolean |
isContiguous(int diff,
NDArrayIndex... indexes)
Returns whether indices are contiguous
by a certain amount or not
|
static boolean |
isContiguous(NDArrayIndex... indexes)
Returns whether the indices are contiguous by one or not
|
static int[] |
offsets(NDArrayIndex... indices)
The offsets (begin index) for each index
|
static int[] |
shape(int[] shape,
NDArrayIndex... indices)
Calculate the shape for the given set of indices.
|
static int[] |
shape(NDArrayIndex... indices)
Calculate the shape for the given set of indices.
|
static int[] |
strides(char ordering,
NDArrayIndex... indexes)
Calculate the strides based on the given indices
|
public static int[] offsets(NDArrayIndex... indices)
indices
- the indicespublic static NDArrayIndex[] fillIn(int[] shape, NDArrayIndex... indexes)
shape
- the original shapeindexes
- the indexes to start frompublic static NDArrayIndex[] adjustIndices(int[] originalShape, NDArrayIndex... indexes)
originalShape
- the original shape to adjust toindexes
- the indexes to adjustpublic static int[] strides(char ordering, NDArrayIndex... indexes)
ordering
- the ordering to calculate strides forindexes
- the indices to calculate stride forpublic static int[] shape(NDArrayIndex... indices)
indices
- the indices to calculate the shape forpublic static boolean isContiguous(NDArrayIndex... indexes)
indexes
- the indices to testpublic static boolean isContiguous(int diff, NDArrayIndex... indexes)
indexes
- the indices to testdiff
- the difference considered to be contiguouspublic static boolean isContiguous(int[] indices)
indices
- the indices to testpublic static boolean isContiguous(int[] indices, int diff)
indices
- the indices to testdiff
- the difference considered to be contiguouspublic static int[] shape(int[] shape, NDArrayIndex... indices)
shape
- the original shapeindices
- the indices to calculate the shape forCopyright © 2015. All Rights Reserved.