public class DefaultMatrixStorage extends Object implements MatrixAccess
storage are known.| Constructor and Description |
|---|
DefaultMatrixStorage(MatrixAccess storage)
Construct a
DefaultMatrixStorage to wrap a storage for access. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
double |
get(int row,
int col)
Get the matrix entry at [i,j].
|
Vector |
getColumn(int j)
Get a column.
|
Vector |
getRow(int i)
Get a row.
|
int |
hashCode() |
int |
nCols()
Gets the number of columns.
|
int |
nRows()
Gets the number of rows.
|
void |
set(int row,
int col,
double value)
Set the matrix entry at [i,j] to a value.
|
void |
setColumn(int j,
double... values)
Set the values for a column in the matrix, i.e., [*, j].
|
void |
setColumn(int j,
Vector v)
Set the values for a column in the matrix, i.e., [*, j].
|
void |
setRow(int i,
double... values)
Set the values for a row in the matrix, i.e., [i, *].
|
void |
setRow(int i,
Vector v)
Set the values for a row in the matrix, i.e., [i, *].
|
String |
toString() |
public DefaultMatrixStorage(MatrixAccess storage)
DefaultMatrixStorage to wrap a storage for access.storage - the matrix data storage/representationpublic int nRows()
Tablepublic int nCols()
Tablepublic void set(int row,
int col,
double value)
throws MatrixAccessException
MatrixAccessset in interface MatrixAccessrow - the row indexcol - the column indexvalue - the value to set A[i,j] toMatrixAccessException - if i or j is out of rangepublic double get(int row,
int col)
throws MatrixAccessException
MatrixAccessget in interface MatrixAccessrow - the row indexcol - the column indexMatrixAccessException - if i or j is out of rangepublic void setRow(int i,
double... values)
i - the row index, counting from 1values - the values to change the row entries toMatrixAccessException - if the number of values does not match the column sizepublic void setRow(int i,
Vector v)
i - the row index, counting from 1v - the vector to change the row entries toMatrixAccessException - if the number of values does not match the column sizepublic Vector getRow(int i) throws MatrixAccessException
i - the row index, counting from 1MatrixAccessException - if the row index is invalidpublic void setColumn(int j,
double... values)
j - the column index, counting from 1values - the values to change the column entries toMatrixAccessException - if the number of values does not match the row sizepublic void setColumn(int j,
Vector v)
j - the column index, counting from 1v - the vector to change the column entries toMatrixAccessException - if the number of values does not match the row sizepublic Vector getColumn(int j) throws MatrixAccessException
j - the column index, counting from 1MatrixAccessException - if the column index is invalidCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.