Interface MatrixAccess
-
- All Superinterfaces:
Table
- All Known Subinterfaces:
Matrix
,MatrixTable
,SparseMatrix
- All Known Implementing Classes:
BidiagonalMatrix
,BorderedHessian
,ColumnBindMatrix
,CongruentMatrix
,CorrelationMatrix
,CSRSparseMatrix
,DefaultMatrixStorage
,DenseData
,DenseMatrix
,DiagonalMatrix
,DiagonalSum
,DOKSparseMatrix
,ElementaryOperation
,FastKroneckerProduct
,FlexibleTable
,GivensMatrix
,GoldfeldQuandtTrotter
,Hessian
,HilbertMatrix
,ImmutableMatrix
,Inverse
,Jacobian
,KroneckerProduct
,LILSparseMatrix
,LowerTriangularMatrix
,MAT
,MatrixRootByDiagonalization
,MatthewsDavies
,OuterProduct
,PermutationMatrix
,PositiveDefiniteMatrixByPositiveDiagonal
,PositiveSemiDefiniteMatrixNonNegativeDiagonal
,Pow
,PseudoInverse
,ReturnsMatrix
,SampleCovariance
,SimilarMatrix
,SimplexTable
,SubMatrixRef
,SymmetricKronecker
,SymmetricMatrix
,TridiagonalMatrix
,UpperTriangularMatrix
public interface MatrixAccess extends Table
This interface defines the methods for accessing entries in a matrix. Indices count from 1, e.g.,get(1,1)
. This is what mathematicians (not programmers) are accustomed to. Invalid access such as using out-of-range indices or altering immutable matrix will lead toMatrixAccessException
. The only way to change a matrix is by callingset(int, int, double)
. Other operations that "change" the matrix actually creates a new and independent copy.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double
get(int i, int j)
Get the matrix entry at [i,j].void
set(int i, int j, double value)
Set the matrix entry at [i,j] to a value.
-
-
-
Method Detail
-
set
void set(int i, int j, double value) throws MatrixAccessException
Set the matrix entry at [i,j] to a value. This is the only method that may change a matrix.- Parameters:
i
- the row indexj
- the column indexvalue
- the value to set A[i,j] to- Throws:
MatrixAccessException
- if i or j is out of range
-
get
double get(int i, int j) throws MatrixAccessException
Get the matrix entry at [i,j].- Parameters:
i
- the row indexj
- the column index- Returns:
- A[i,j]
- Throws:
MatrixAccessException
- if i or j is out of range
-
-