Interface StructureAnyD
- All Superinterfaces:
Structure1D
- All Known Subinterfaces:
AccessAnyD<N>, AccessAnyD.Aggregatable<N>, AccessAnyD.Collectable<N,R>, AccessAnyD.Sliceable<N>, AccessAnyD.Visitable<N>, FactoryAnyD.Builder<I>, MutateAnyD, MutateAnyD.Fillable<N>, MutateAnyD.Mixable<N>, MutateAnyD.Modifiable<N>, MutateAnyD.ModifiableReceiver<N>, MutateAnyD.Receiver<N>, StructureAnyD.Logical<S, B>, StructureAnyD.ReducibleTo1D<R>, StructureAnyD.ReducibleTo2D<R>, StructureAnyD.Reshapable
- All Known Implementing Classes:
AccessAnyD.SelectionView, AnyTensor, ArrayAnyD, PrimitiveAnyD, PrimitiveAnyD.Simple, PrimitiveAnyD.Wrapper
A (fixed size) any-dimensional data structure.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classstatic interfaceStructureAnyD.Logical<S extends StructureAnyD, B extends StructureAnyD.Logical<S,B>> static final classstatic interfaceStructureAnyD.ReducibleTo1D<R extends Structure1D>static interfaceStructureAnyD.ReducibleTo2D<R extends Structure2D>static interfacestatic classstatic interfaceNested classes/interfaces inherited from interface Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.LongIndex, Structure1D.LoopCallback -
Method Summary
Modifier and TypeMethodDescriptionstatic long[]compatible(long[] left, long[] right) static long[]compatible(Structure1D left, Structure1D right) default longcount(int dimension) count() == count(0) * count(1) * count(2) * count(3) * ...static longcount(int... shape) static longcount(long... shape) static longcount(long[] shape, int dimension) static longindex(int[] shape, int[] reference) static longindex(int[] shape, long[] reference) static longindex(long[] shape, int[] reference) static longindex(long[] shape, long[] reference) static longindex(StructureAnyD structure, int[] reference) static longindex(StructureAnyD structure, long[] reference) private voidloop(int dim, long[] reference, Predicate<long[]> filter, StructureAnyD.ReferenceCallback callback) private voidloop(int dim, long[] reference, StructureAnyD.ReferenceCallback callback) default voidloop(int dimension, long dimensionalIndex, Structure1D.LoopCallback callback) Will loop through this multidimensional data structure so that one index value of one dimension is fixed.default voidloop(long[] initial, int dimension, Structure1D.LoopCallback callback) default voiddefault voidloopReferences(Predicate<long[]> filter, StructureAnyD.ReferenceCallback callback) mapperOf(StructureAnyD structure, Structure1D.IndexMapper<Object>[] mappers) default intrank()static long[]reference(long index, long[] shape) static voidreference(long index, long[] shape, long[] reference) Based on the input index and structure/shape the reference array will derived.default long[]shape()static long[]shape(Structure1D structure) intsize(int dimension) static intsize(int... shape) static intsize(int[] shape, int dimension) static intstep(int[] shape, int dimension) static intstep(int[] shape, int[] increment) A more complex/general version of step(int[], int).static longstep(long[] shape, int dimension) How does the index change when stepping to the next dimensional unit (next row, next column.static longstep(long[] shape, long[] increment) A more complex/general version of step(int[], int).Methods inherited from interface Structure1D
count, size
-
Method Details
-
compatible
static long[] compatible(long[] left, long[] right) -
compatible
-
count
static long count(int... shape) - Parameters:
structure- An access structure- Returns:
- The size of an access with that structure
-
count
static long count(long... shape) - Parameters:
shape- An access structure- Returns:
- The size of an access with that structure
-
count
static long count(long[] shape, int dimension) - Parameters:
shape- An access structuredimension- A dimension index- Returns:
- The size of that dimension
-
index
static long index(int[] shape, int[] reference) - See Also:
-
index
static long index(int[] shape, long[] reference) - See Also:
-
index
static long index(long[] shape, int[] reference) - See Also:
-
index
static long index(long[] shape, long[] reference) - Parameters:
shape- An access structurereference- An access element reference- Returns:
- The index of that element
-
index
- See Also:
-
index
- See Also:
-
mapperOf
static StructureAnyD.ReferenceMapper mapperOf(StructureAnyD structure, Structure1D.IndexMapper<Object>[] mappers) -
reference
static long[] reference(long index, long[] shape) -
reference
static void reference(long index, long[] shape, long[] reference) Based on the input index and structure/shape the reference array will derived.- Parameters:
index- Input indexshape- Relevant structure/shapereference- Will be updated to the correct reference array given the index and structure
-
shape
-
size
static int size(int... shape) - Parameters:
shape- An access structure- Returns:
- The size of an access with that structure
-
size
static int size(int[] shape, int dimension) - Parameters:
shape- An access structuredimension- A dimension index- Returns:
- The size of that dimension
-
step
static int step(int[] shape, int dimension) - Parameters:
shape- An access structuredimension- A dimension index indication a direction- Returns:
- The step size (index change) in that direction
-
step
static int step(int[] shape, int[] increment) A more complex/general version of step(int[], int).- Parameters:
shape- An access structureincrement- A vector indication a direction (and size)- Returns:
- The step size (index change)
-
step
static long step(long[] shape, int dimension) How does the index change when stepping to the next dimensional unit (next row, next column. next matrix/area, next cube...)- Parameters:
shape- An access structuredimension- Which reference index to increment- Returns:
- The step size (index change)
-
step
static long step(long[] shape, long[] increment) A more complex/general version of step(int[], int).- Parameters:
shape- An access structureincrement- A vector indication a direction (and size)- Returns:
- The step size (index change)
-
loop
private void loop(int dim, long[] reference, Predicate<long[]> filter, StructureAnyD.ReferenceCallback callback) -
loop
-
count
default long count(int dimension) count() == count(0) * count(1) * count(2) * count(3) * ... -
loop
Will loop through this multidimensional data structure so that one index value of one dimension is fixed. (Ex: Loop through all items with row index == 5.)- Parameters:
dimension- The dimension with a fixed/supplied index. (0==row, 1==column, 2=matrix/area...)dimensionalIndex- The index value that dimension is fixed to. (Which row, column or matrix/area)callback- A callback with parameters that define a sub-loop
-
loop
-
loopAllReferences
-
loopReferences
-
rank
default int rank()- Returns:
- The number of dimensions (the number of indices used to reference one element)
-
shape
default long[] shape() -
size
int size(int dimension)
-