Package ucar.array
Class IndexFn
- java.lang.Object
-
- ucar.array.IndexFn
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IndexFn.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IndexFn.Builder
builder(int[] shape)
boolean
contains(int... index)
Check if the given index is valid.boolean
equals(Object o)
int
get(int... index)
Get the 1-d index indicated by the list of multidimensional indices.int
getRank()
Get the number of dimensions in the array.Section
getSection()
Get the shape: length of array in each dimension.int[]
getShape()
Get the shape: length of array in each dimension.int
getShape(int index)
Get the length of the ith dimension.int
hashCode()
Iterator<Integer>
iterator()
Iterator<Integer>
iterator(int start, long length)
long
length()
Get the total number of elements in the array.int[]
odometer(long element)
what is the odometer (n-dim index) for element (1-d index)?IndexFn.Builder
toBuilder()
String
toString()
String
toString2()
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
get
public int get(int... index)
Get the 1-d index indicated by the list of multidimensional indices.- Parameters:
index
- list of indices, one for each dimension. For vlen, the last is ignored.
-
contains
public boolean contains(int... index)
Check if the given index is valid.
-
getRank
public int getRank()
Get the number of dimensions in the array.
-
getSection
public Section getSection()
Get the shape: length of array in each dimension.
-
getShape
public int[] getShape()
Get the shape: length of array in each dimension.
-
getShape
public int getShape(int index)
Get the length of the ith dimension.
-
length
public long length()
Get the total number of elements in the array.
-
toString2
public String toString2()
-
builder
public static IndexFn.Builder builder(int[] shape)
-
toBuilder
public IndexFn.Builder toBuilder()
-
odometer
public int[] odometer(long element)
what is the odometer (n-dim index) for element (1-d index)?
-
-