Interface StructureAnyD

    • Method Detail

      • compatible

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