java.io.Serializablepublic class SparseSquareMatrix
extends java.lang.Object
implements java.io.Serializable
| Constructor | Description |
|---|---|
SparseSquareMatrix(int N) |
initialize an N-by-N matrix of all 0s
|
| Modifier and Type | Method | Description |
|---|---|---|
double |
get(int i,
int j) |
access a value at i,j
|
int |
nnz() |
return the number of nonzero entries (not the most efficient implementation)
|
SparseSquareMatrix |
plus(SparseSquareMatrix B) |
return C = A + B
|
void |
put(int i,
int j,
double value) |
set A[i][j] = value
|
SparseVector |
times(SparseVector x) |
|
java.lang.String |
toString() |
public SparseSquareMatrix(int N)
N - - sizepublic void put(int i,
int j,
double value)
i - j - value - public double get(int i,
int j)
i - j - public int nnz()
public SparseVector times(SparseVector x)
x - public SparseSquareMatrix plus(SparseSquareMatrix B)
B - public java.lang.String toString()
toString in class java.lang.Object