SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.doubles
Interface Matrix

All Superinterfaces:
AbelianGroup<Matrix>, DeepCopyable, MatrixAccessor, MatrixDimension, MatrixRing, Monoid<Matrix>, Ring<Matrix>
All Known Subinterfaces:
SparseMatrix
All Known Implementing Classes:
BidiagonalMatrix, BorderedHessian, CovarianceMatrix, CsrSparseMatrix, DenseMatrix, DiagonalMatrix, DokSparseMatrix, GivensMatrix, GoldfeldQuandtTrotter, Gradient, Hessian, HilbertMatrix, ImmutableKroneckerProduct, ImmutableMatrix, Inverse, Jacobian, JordanExchange, KroneckerProduct, LilSparseMatrix, LowerTriangularMatrix, MatrixMathImpl, MatrixStorageImpl, MatthewsDavies, PermutationMatrix, Pow, PseudoInverse, SubMatrixRef, SymmetricMatrix, TriangularMatrix, TridiagonalMatrix, UpperTriangularMatrix

public interface Matrix
extends MatrixDimension, MatrixAccessor, MatrixRing, DeepCopyable

This interface defines basic operations for a matrix, of which all entries are double.

We do not dictate how a matrix should be implemented. Different implementations of the mathematical concept "real (double) matrix" implement this interface.

This interface is made minimal so that we do not list 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
 Matrix deepCopy()
          The implementation can return an instance created from this by the copy constructor of the class, or just this if the instance itself is immutable.
 Vector multiply(Vector v)
          Right multiply this matrix, A by a vector.
 Matrix scaled(double scalar)
          scalar * this
 
Methods inherited from interface com.numericalmethod.suanshu.matrix.MatrixDimension
nCols, nRows
 
Methods inherited from interface com.numericalmethod.suanshu.matrix.doubles.MatrixAccessor
get, getColumn, getRow, set
 
Methods inherited from interface com.numericalmethod.suanshu.matrix.doubles.MatrixRing
add, minus, multiply, ONE, opposite, t, ZERO
 

Method Detail

multiply

Vector multiply(Vector v)
Right multiply this matrix, A by a vector.

Parameters:
v - a vector
Returns:
A %*% v

scaled

Matrix scaled(double scalar)
scalar * this

Parameters:
scalar - a double
Returns:
scalar * this

deepCopy

Matrix deepCopy()
The implementation can return an instance created from this by the copy constructor of the class, or just this if the instance itself is immutable.

Override the return type.

Specified by:
deepCopy in interface DeepCopyable
Returns:
an independent copy of Matrix instance

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.