|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--Opus5.SparseMatrixAsLinkedList
Sparse matrix implemented using an array of linked lists.
| Field Summary | |
protected LinkedList[] |
lists
An array of linked lists---one linked list for each row. |
protected int |
numberOfColumns
The number of columns. |
protected int |
numberOfRows
The number of columns. |
| Fields inherited from interface Opus5.SparseMatrix |
copyright |
| Constructor Summary | |
SparseMatrixAsLinkedList(int numberOfRows,
int numberOfColumns)
Construct a SparseMatrixAsLinkedLists
with the specified dimensions. |
|
| Method Summary | |
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 LinkedList[] lists
| Constructor Detail |
public SparseMatrixAsLinkedList(int numberOfRows,
int numberOfColumns)
SparseMatrixAsLinkedLists
with the specified dimensions.numberOfRows - The number of rows.numberOfColumns - The number of columns.| Method Detail |
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.MethodNotImplemented - Always.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 | |||||||