Class ColumnMajorSparseMatrix

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.Double>
    Direct Known Subclasses:
    CCSMatrix

    public abstract class ColumnMajorSparseMatrix
    extends SparseMatrix
    • Constructor Detail

      • ColumnMajorSparseMatrix

        public ColumnMajorSparseMatrix​(int rows,
                                       int columns)
      • ColumnMajorSparseMatrix

        public ColumnMajorSparseMatrix​(int rows,
                                       int columns,
                                       int cardinality)
    • Method Detail

      • fromMatrixMarket

        public static ColumnMajorSparseMatrix fromMatrixMarket​(java.lang.String mm)
        Parses ColumnMajorSparseMatrix from the given Matrix Market string.
        Parameters:
        mm - the string in Matrix Market format
        Returns:
        a parsed matrix
      • isRowMajor

        public boolean isRowMajor()
        Description copied from class: SparseMatrix
        Checks whether or not this sparse matrix row-major.
        Specified by:
        isRowMajor in class SparseMatrix
      • transpose

        public Matrix transpose()
        Description copied from class: Matrix
        Transposes this matrix.
        Overrides:
        transpose in class Matrix
        Returns:
        the transposed matrix
      • rotate

        public Matrix rotate()
        Description copied from class: Matrix
        Rotates this matrix by 90 degrees to the right.
        Overrides:
        rotate in class Matrix
        Returns:
        the rotated matrix
      • iterator

        public ColumnMajorMatrixIterator iterator()
        Description copied from class: Matrix
        Returns a matrix iterator.
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.Double>
        Overrides:
        iterator in class Matrix
        Returns:
        a matrix iterator
      • iteratorOrNonZeroColumns

        public abstract java.util.Iterator<java.lang.Integer> iteratorOrNonZeroColumns()
      • apply

        public <T> T apply​(MatrixOperation<T> operation)
        Description copied from class: Matrix
        Pipes this matrix to a given operation.
        Specified by:
        apply in class Matrix
        Type Parameters:
        T - the result type
        Parameters:
        operation - the matrix operation (an operation that takes a matrix and returns T)
        Returns:
        the result of an operation applied to this matrix
      • apply

        public <T> T apply​(MatrixMatrixOperation<T> operation,
                           Matrix that)
        Description copied from class: Matrix
        Pipes this matrix to a given operation.
        Specified by:
        apply in class Matrix
        Type Parameters:
        T - the result type
        Parameters:
        operation - the matrix-matrix operation (an operation that takes two matrices and returns T)
        that - the right hand matrix of the given operation
        Returns:
        the result of an operation applied to this matrix
      • apply

        public <T> T apply​(MatrixVectorOperation<T> operation,
                           Vector that)
        Description copied from class: Matrix
        Pipes this matrix to a given operation.
        Specified by:
        apply in class Matrix
        Type Parameters:
        T - the result type
        Parameters:
        operation - the matrix-vector operation (an operation that takes matrix and vector and returns T)
        that - the right hand vector of the given operation
        Returns:
        the result of an operation applied to this matrix