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

    • Field Detail

      • myColumns

        private final java.util.List<SparseArray<N extends java.lang.Comparable<N>>> myColumns
      • myPhysicalStoreFactory

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

        private final int myRowsCount
    • Method Detail

      • addColumns

        public void addColumns​(int numberToAdd)
      • columns

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

        public SparseArray<N> getColumn​(int index)
      • getRowDim

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

        public Access1D<N> removeColumn​(int index)
      • 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