|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--Opus5.SparseMatrixAsArray
Sparse matrix implemented using arrays.
| Field Summary | |
protected int[][] |
columns
The column numbers corresponding to the non-zero entries. |
protected int |
fill
The maximum number of non-zero entries in any row of the sparse matrix. |
protected int |
numberOfColumns
The number of columns. |
protected int |
numberOfRows
The number of rows. |
protected double[][] |
values
The non-zero matrix entries. |
| Fields inherited from interface Opus5.SparseMatrix |
copyright |
| Constructor Summary | |
SparseMatrixAsArray(int numberOfRows,
int numberOfColumns,
int fill)
Construct a SparseMatrixAsArray
with the specified dimensions and row fill. |
|
| 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 numberOfColumns
protected int numberOfRows
protected int fill
protected double[][] values
protected int[][] columns
| Constructor Detail |
public SparseMatrixAsArray(int numberOfRows,
int numberOfColumns,
int fill)
SparseMatrixAsArray
with the specified dimensions and row fill.numberOfRows - The number of rows.numberOfColumns - The number of columns.fill - The maximum number of non-zero entries in any row.| 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 MatrixMethodNotImplemented - Always.public 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 | |||||||