Interface Matrix

All Superinterfaces:
AbelianGroup<Matrix>, DeepCopyable, MatrixAccess, MatrixRing, MatrixTable, Monoid<Matrix>, Ring<Matrix>, Table
All Known Subinterfaces:
SparseMatrix
All Known Implementing Classes:
BidiagonalMatrix, BorderedHessian, ColumnBindMatrix, CongruentMatrix, CorrelationMatrix, CSCSparseMatrix, CSRSparseMatrix, DenseMatrix, DiagonalMatrix, DiagonalSum, DOKSparseMatrix, FastKroneckerProduct, GivensMatrix, GoldfeldQuandtTrotter, Hessian, HilbertMatrix, ImmutableMatrix, Inverse, Jacobian, KroneckerProduct, LILSparseMatrix, LowerTriangularMatrix, MAT, MatrixRootByDiagonalization, MatthewsDavies, OuterProduct, PermutationMatrix, PositiveDefiniteMatrixByPositiveDiagonal, PositiveSemiDefiniteMatrixNonNegativeDiagonal, Pow, PseudoInverse, ReturnsMatrix, SampleCovariance, SimilarMatrix, SubMatrixRef, SymmetricKronecker, SymmetricMatrix, TridiagonalMatrix, UpperTriangularMatrix

public interface Matrix extends MatrixTable, MatrixRing, DeepCopyable
This interface defines a Matrix as a Ring, a Table, and a few more methods not already defined in its mathematical definition. The interface is made minimal to avoid listing all possible matrix operations. Instead, matrix operations are grouped into packages and classes by their properties. This is to avoid interface "pollution", lengthy and cumbersome design.
  • Method Summary

    Modifier and Type
    Method
    Description
    The implementation returns an instance created from this by the copy constructor of the class, or just this if the instance itself is immutable.
    getColumn(int j)
    Get the specified column in the matrix as a vector.
    getRow(int i)
    Get the specified row in the matrix as a vector.
    Right multiply this matrix, A, by a vector.
    scaled(double c)
    Scale this matrix, A, by a constant.
    default String
     

    Methods inherited from interface dev.nm.algebra.linear.matrix.doubles.MatrixAccess

    get, set

    Methods inherited from interface dev.nm.algebra.linear.matrix.doubles.MatrixRing

    add, minus, multiply, ONE, opposite, t, ZERO

    Methods inherited from interface dev.nm.misc.datastructure.Table

    nCols, nRows
  • Method Details

    • multiply

      Vector multiply(Vector v)
      Right multiply this matrix, A, by a vector.
      Parameters:
      v - a vector
      Returns:
      Av, a vector
    • scaled

      Matrix scaled(double c)
      Scale this matrix, A, by a constant.
      Parameters:
      c - a double
      Returns:
      cA
    • getRow

      Vector getRow(int i) throws MatrixAccessException
      Get the specified row in the matrix as a vector.
      Parameters:
      i - the row index
      Returns:
      the vector A[i, ]
      Throws:
      MatrixAccessException - when i < 1, or when i > the number of rows
    • getColumn

      Vector getColumn(int j) throws MatrixAccessException
      Get the specified column in the matrix as a vector.
      Parameters:
      j - the column index
      Returns:
      a vector A[, j]
      Throws:
      MatrixAccessException - when j < 1, or when j > the number of columns
    • deepCopy

      Matrix deepCopy()
      Description copied from interface: DeepCopyable
      The implementation returns an instance created from this by the copy constructor of the class, or just this if the instance itself is immutable.
      Specified by:
      deepCopy in interface DeepCopyable
      Returns:
      an independent (deep) copy of the instance
    • toCSV

      default String toCSV()