|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixMathImpl<T>
com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixStorageImpl<T>
public abstract class MatrixStorageImpl<T extends Matrix>
This is one implementation of Matrix.
It provides default implementation for common methods used in the double based Matrix.
It assumes no knowledge of how a Matrix subclass is implemented and the data structure.
Subclasses can (and should) override these methods for performance whenever possible.
This implementation assumes that the user supplies a data storage.
| Constructor Summary | |
|---|---|
MatrixStorageImpl(int nRows,
int nCols,
MatrixData storage)
Construct a MatrixStorageImpl, allowing overriding the default implementation. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Check if two matrices (of different implementations) are equal. |
double |
get(int row,
int col)
Get the matrix entry at [row, col]. |
protected MatrixData |
getMatrixData()
|
int |
hashCode()
|
void |
set(int row,
int col,
double value)
Set the matrix entry at [row, col] to value. |
protected void |
setMatrixData(MatrixData storage)
|
| Methods inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixMathImpl |
|---|
add, call, getColumn, getRow, getSample, minus, multiply, multiply, nCols, nRows, opposite, scaled, setColumn, setColumn, setRow, setRow, t, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.numericalmethod.suanshu.matrix.doubles.Matrix |
|---|
deepCopy |
| Methods inherited from interface com.numericalmethod.suanshu.matrix.doubles.MatrixRing |
|---|
ONE, ZERO |
| Constructor Detail |
|---|
public MatrixStorageImpl(int nRows,
int nCols,
MatrixData storage)
nRows - number of rowsnCols - number of columnsstorage - matrix data storage/representation| Method Detail |
|---|
protected MatrixData getMatrixData()
protected void setMatrixData(MatrixData storage)
public void set(int row,
int col,
double value)
throws MatrixAccessException
MatrixAccessor[row, col] to value.
This is the only method that may change the entries of a matrix.
row - the row indexcol - the column indexvalue - the value to set A[row, col] to
MatrixAccessException - if row or col is out of range
public double get(int row,
int col)
throws MatrixAccessException
MatrixAccessor[row, col].
row - the row indexcol - the column index
A[row, col]
MatrixAccessException - if row or col is out of rangepublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objecttrue iff two matrices have the same values, entry-by-entrypublic int hashCode()
hashCode in class java.lang.Object
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||