|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--Opus5.SparseMatrixAsVector
Sparse matrix implemented using a vector of triples.
| Field Summary | |
protected Opus5.SparseMatrixAsVector.Entry[] |
array
An array of triples (entries). |
protected int |
numberOfColumns
The number of columns. |
protected int |
numberOfElements
The maximum number of non-zero elements in this matrix. |
protected int |
numberOfRows
The number of rows. |
| Fields inherited from interface Opus5.SparseMatrix |
copyright |
| Constructor Summary | |
SparseMatrixAsVector(int numberOfRows,
int numberOfColumns,
int numberOfElements)
Construct a SparseMatrixAsVector
with the specified dimensions and maximum number of non-zero elements. |
|
| Method Summary | |
protected int |
findPosition(int i,
int j)
Finds the position of the (i,j)th matrix entry. |
double |
get(int i,
int j)
Returns the value in this matrix at the specified position. |
Matrix |
plus(Matrix mat)
Returns the sum of this matrix and the specified matrix. |
void |
put(int i,
int j,
double datum)
Stores the specified value in this matrix at the specified position. |
void |
putZero(int i,
int j)
Stores a zero in this matrix at the specified position. |
Matrix |
times(Matrix mat)
Returns the product of this matrix and the specified matrix. |
Matrix |
transpose()
Returns the transpose of this matrix. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int numberOfRows
protected int numberOfColumns
protected int numberOfElements
protected Opus5.SparseMatrixAsVector.Entry[] array
| Constructor Detail |
public SparseMatrixAsVector(int numberOfRows,
int numberOfColumns,
int numberOfElements)
SparseMatrixAsVector
with the specified dimensions and maximum number of non-zero elements.numberOfRows - The number of rows.numberOfColumns - The number of columns.numberOfElements - The maximum number of non-zero elements
in this matrix.| Method Detail |
protected int findPosition(int i,
int j)
i - The row number.j - The column number.-1 if the matrix entry is zero.
public double get(int i,
int j)
get in interface Matrixi - The row number.j - The column number.
public void put(int i,
int j,
double datum)
put in interface Matrixi - The row number.j - The column number.datum - The value to be stored.
public void putZero(int i,
int j)
putZero in interface SparseMatrixi - The row number.j - The column number.public Matrix transpose()
transpose in interface Matrixpublic Matrix times(Matrix mat)
times in interface MatrixThe - specified matrix.public Matrix plus(Matrix mat)
plus in interface MatrixThe - specified matrix.MethodNotImplemented - Always.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||