|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
public interface SparseMatrix
This interface defines the sparse matrix which stores non-zero values only. If there are only a few non-zeros in a matrix, sparse matrix does save memory space for storing the matrix. In addition, matrix operations based on sparse matrix are also more efficient. Usually, the time complexities of are just proportional to the number of non-zero values, instead of the dimension of the matrix as in the dense case.
| Method Summary | |
|---|---|
java.util.List<SparseElement> |
toElementList()
Export the non-zero values in the matrix as a list of SparseElements. |
| Methods inherited from interface com.numericalmethod.suanshu.matrix.doubles.Matrix |
|---|
deepCopy, multiply, scaled |
| Methods inherited from interface com.numericalmethod.suanshu.matrix.MatrixDimension |
|---|
nCols, nRows |
| Methods inherited from interface com.numericalmethod.suanshu.matrix.doubles.MatrixAccessor |
|---|
get, getColumn, getRow, set |
| Methods inherited from interface com.numericalmethod.suanshu.matrix.doubles.MatrixRing |
|---|
add, minus, multiply, ONE, opposite, t, ZERO |
| Methods inherited from interface com.numericalmethod.suanshu.matrix.doubles.matrixtype.dense.Densifiable |
|---|
toDense |
| Methods inherited from interface com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.SparseStructure |
|---|
dropTolerance, nnz |
| Method Detail |
|---|
java.util.List<SparseElement> toElementList()
SparseElements.
This is useful for converting between SparseMatrix of different
formats. For example,
// construct matrix using DOK DokSparseMatrix dok = new DokSparseMatrix(5, 5); // ... insert some values to DOK matrix // convert to CSR matrix for efficient matrix operations CsrSparseMatrix csr = new CsrSparseMatrix(5, 5, dok.toElementList());
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||