Interface Structure2D

    • Method Detail

      • column

        static int column​(int index,
                          int structure)
      • column

        static int column​(int index,
                          int[] structure)
      • column

        static int column​(long index,
                          int structure)
      • column

        static long column​(long index,
                           long structure)
      • column

        static long column​(long index,
                           long[] structure)
      • count

        static long count​(long numberOfRows,
                          long numberOfColumnns)
      • firstInColumn

        static int firstInColumn​(Structure1D structure,
                                 int col,
                                 int defaultAndMinimum)
      • firstInColumn

        static long firstInColumn​(Structure1D structure,
                                  long col,
                                  long defaultAndMinimum)
      • firstInRow

        static int firstInRow​(Structure1D structure,
                              int row,
                              int defaultAndMinimum)
      • firstInRow

        static long firstInRow​(Structure1D structure,
                               long row,
                               long defaultAndMinimum)
      • index

        static long index​(long structure,
                          long row,
                          long column)
      • limitOfColumn

        static int limitOfColumn​(Structure1D structure,
                                 int col,
                                 int defaultAndMaximum)
      • limitOfColumn

        static long limitOfColumn​(Structure1D structure,
                                  long col,
                                  long defaultAndMaximum)
      • limitOfRow

        static int limitOfRow​(Structure1D structure,
                              int row,
                              int defaultAndMaximum)
      • limitOfRow

        static long limitOfRow​(Structure1D structure,
                               long row,
                               long defaultAndMaximum)
      • row

        static int row​(int index,
                       int structure)
      • row

        static int row​(int index,
                       int[] structure)
      • row

        static int row​(long index,
                       int structure)
      • row

        static long row​(long index,
                        long structure)
      • row

        static long row​(long index,
                        long[] structure)
      • count

        default long count()
        count() == countRows() * countColumns()
        Specified by:
        count in interface Structure1D
      • countColumns

        default long countColumns()
        Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.
        Returns:
        The number of columns
      • countRows

        default long countRows()
        Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.
        Returns:
        The number of rows
      • firstInColumn

        default int firstInColumn​(int col)
        The default value is simply 0, and if all elements are zeros then this.countRows().
        Parameters:
        col - The column index
        Returns:
        The row index of the first non-zero element in the specified column
      • firstInRow

        default int firstInRow​(int row)
        The default value is simply 0, and if all elements are zeros then this.countColumns().
        Returns:
        The column index of the first non-zero element in the specified row
      • getColDim

        int getColDim()
        Returns:
        The number of columns
      • getMaxDim

        default int getMaxDim()
      • getMinDim

        default int getMinDim()
      • getRowDim

        int getRowDim()
        Returns:
        The number of rows
      • isEmpty

        default boolean isEmpty()
        2D data structures are either square, tall, fat or empty.

        m <= 0 or n <= 0

        Historically some ojAlgo data structures did allow to create "empty" instances. Currently this is not encouraged, but still possible in some instances.
        Returns:
        true if matrix is empty
      • isFat

        default boolean isFat()
        2D data structures are either square, tall, fat or empty.

        1 <= m < n

        Returns:
        true if matrix is fat
      • isScalar

        default boolean isScalar()
        Returns:
        true if both the row and column dimensions are equal to 1.
      • isSquare

        default boolean isSquare()
        2D data structures are either square, tall, fat or empty.

        m = n <> 0

        Returns:
        true if matrix is square
      • isTall

        default boolean isTall()
        2D data structures are either square, tall, fat or empty.

        m < n >= 1

        Returns:
        true if matrix is tall
      • isVector

        default boolean isVector()
        Returns:
        true if either the row or column dimensions are equal to 1.
      • limitOfColumn

        default int limitOfColumn​(int col)
        The default value is simply this.countRows(), and if all elements are zeros then 0.
        Returns:
        The row index of the first zero element, after all non-zeros, in the specified column (index of the last non-zero + 1)
      • limitOfRow

        default int limitOfRow​(int row)
        The default value is simply this.countColumns(), and if all elements are zeros then 0.
        Returns:
        The column index of the first zero element, after all non-zeros, in the specified row (index of the last non-zero + 1)
      • size

        default int size()
        size() == getRowDim() * getColDim()
        Specified by:
        size in interface Structure1D