Package org.ojalgo.structure
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 class
static interface
StructureAnyD.Logical<S extends StructureAnyD,
B extends StructureAnyD.Logical<S, B>> static final class
static interface
StructureAnyD.ReducibleTo1D<R extends Structure1D>
static interface
StructureAnyD.ReducibleTo2D<R extends Structure2D>
static interface
static class
static interface
Nested classes/interfaces inherited from interface org.ojalgo.structure.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 long
count
(int dimension) count() == count(0) * count(1) * count(2) * count(3) * ...static long
count
(int... shape) static long
count
(long... shape) static long
count
(long[] shape, int dimension) static long
index
(int[] shape, int[] reference) static long
index
(int[] shape, long[] reference) static long
index
(long[] shape, int[] reference) static long
index
(long[] shape, long[] reference) static long
index
(StructureAnyD structure, int[] reference) static long
index
(StructureAnyD structure, long[] reference) private void
loop
(int dim, long[] reference, Predicate<long[]> filter, StructureAnyD.ReferenceCallback callback) private void
loop
(int dim, long[] reference, StructureAnyD.ReferenceCallback callback) default void
loop
(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 void
loop
(long[] initial, int dimension, Structure1D.LoopCallback callback) default void
default void
loopReferences
(Predicate<long[]> filter, StructureAnyD.ReferenceCallback callback) mapperOf
(StructureAnyD structure, Structure1D.IndexMapper<Object>[] mappers) default int
rank()
static long[]
reference
(long index, long[] shape) static void
reference
(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) int
size
(int dimension) static int
size
(int... shape) static int
size
(int[] shape, int dimension) static int
step
(int[] shape, int dimension) static int
step
(int[] shape, int[] increment) A more complex/general version of step(int[], int).static long
step
(long[] shape, int dimension) How does the index change when stepping to the next dimensional unit (next row, next column.static long
step
(long[] shape, long[] increment) A more complex/general version of step(int[], int).Methods inherited from interface org.ojalgo.structure.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)
-