Class RowsSupplier<N extends java.lang.Comparable<N>>

    • Field Detail

      • myColumnsCount

        private final int myColumnsCount
      • myPhysicalStoreFactory

        private final PhysicalStore.Factory<N extends java.lang.Comparable<N>,​?> myPhysicalStoreFactory
      • myRows

        private final java.util.List<SparseArray<N extends java.lang.Comparable<N>>> myRows
    • Method Detail

      • addRows

        public void addRows​(int numberToAdd)
      • countColumns

        public long countColumns()
        Description copied from interface: Structure2D
        Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.
        Specified by:
        countColumns in interface Structure2D
        Returns:
        The number of columns
      • countRows

        public long countRows()
        Description copied from interface: Structure2D
        Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.
        Specified by:
        countRows in interface Structure2D
        Returns:
        The number of rows
      • doubleValue

        public double doubleValue​(int row,
                                  int col)
        Description copied from interface: Access2D
        Extracts one element of this matrix as a double.
        Specified by:
        doubleValue in interface Access2D<N extends java.lang.Comparable<N>>
        Specified by:
        doubleValue in interface MatrixStore<N extends java.lang.Comparable<N>>
        Parameters:
        row - A row index.
        col - A column index.
        Returns:
        One matrix element
      • get

        public N get​(int row,
                     int col)
        Specified by:
        get in interface MatrixStore<N extends java.lang.Comparable<N>>
      • getColDim

        public int getColDim()
        Specified by:
        getColDim in interface Structure2D
        Returns:
        The number of columns
      • getRowDim

        public int getRowDim()
        Specified by:
        getRowDim in interface Structure2D
        Returns:
        The number of rows
      • removeRow

        public SparseArray<N> removeRow​(int index)
      • rows

        public MatrixStore<N> rows​(int... rows)
        Description copied from interface: MatrixStore
        A selection (re-ordering) of rows. Note that it's ok to reference the same base row more than once, and any negative row reference/index will translate to a row of zeros. The number of rows in the resulting matrix is the same as the number of elements in the rows index array.
        Specified by:
        rows in interface Access2D<N extends java.lang.Comparable<N>>
        Specified by:
        rows in interface MatrixStore<N extends java.lang.Comparable<N>>
        Specified by:
        rows in interface Structure2D.Logical<Access2D<N extends java.lang.Comparable<N>>,​MatrixStore<N extends java.lang.Comparable<N>>>
      • selectRows

        public RowsSupplier<N> selectRows​(int[] indices)
      • set

        public void set​(int row,
                        int col,
                        double value)
        Specified by:
        set in interface Mutate2D
      • set

        public void set​(long row,
                        long col,
                        java.lang.Comparable<?> value)
        Specified by:
        set in interface Mutate2D
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object