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

public interface StructureAnyD extends Structure1D
A (fixed size) any-dimensional data structure.
  • Method Details

    • compatible

      static long[] compatible(long[] left, long[] right)
    • compatible

      static long[] compatible(Structure1D left, Structure1D right)
    • 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 structure
      dimension - 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 structure
      reference - An access element reference
      Returns:
      The index of that element
    • index

      static long index(StructureAnyD structure, int[] reference)
      See Also:
    • index

      static long index(StructureAnyD structure, long[] reference)
      See Also:
    • mapperOf

    • 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 index
      shape - Relevant structure/shape
      reference - Will be updated to the correct reference array given the index and structure
    • shape

      static long[] shape(Structure1D structure)
    • 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 structure
      dimension - A dimension index
      Returns:
      The size of that dimension
    • step

      static int step(int[] shape, int dimension)
      Parameters:
      shape - An access structure
      dimension - 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 structure
      increment - 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 structure
      dimension - 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 structure
      increment - 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

      private void loop(int dim, long[] reference, StructureAnyD.ReferenceCallback callback)
    • count

      default long count(int dimension)
      count() == count(0) * count(1) * count(2) * count(3) * ...
    • loop

      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. (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

      default void loop(long[] initial, int dimension, Structure1D.LoopCallback callback)
    • loopAllReferences

      default void loopAllReferences(StructureAnyD.ReferenceCallback callback)
    • loopReferences

      default void loopReferences(Predicate<long[]> filter, StructureAnyD.ReferenceCallback callback)
    • 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)