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
,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 aMatrix
as aRing
, aTable
, 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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Matrix
deepCopy()
The implementation returns an instance created fromthis
by the copy constructor of the class, or justthis
if the instance itself is immutable.Vector
getColumn(int j)
Get the specified column in the matrix as a vector.Vector
getRow(int i)
Get the specified row in the matrix as a vector.Vector
multiply(Vector v)
Right multiply this matrix, A, by a vector.Matrix
scaled(double c)
Scale this matrix, A, by a constant.default String
toCSV()
-
Methods inherited from interface dev.nm.algebra.linear.matrix.doubles.MatrixAccess
get, set
-
-
-
-
Method Detail
-
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 fromthis
by the copy constructor of the class, or justthis
if the instance itself is immutable.- Specified by:
deepCopy
in interfaceDeepCopyable
- Returns:
- an independent (deep) copy of the instance
-
toCSV
default String toCSV()
-
-