|
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
A sparse matrix stores only non-zero values. When there are only a few non-zeros in a matrix, sparse matrix saves memory space for storing the matrix. In addition, the matrix operations based on sparse matrix are usually more efficient. The time complexities are proportional to the number of non-zero values instead of the dimension-squared of dense matrix.
| Method Summary | |
|---|---|
java.util.List<SparseEntry> |
getEntrytList()
Export the non-zero values in the matrix as a list of SparseEntrys. |
| Methods inherited from interface com.numericalmethod.suanshu.matrix.doubles.Matrix |
|---|
deepCopy, getColumn, getRow, multiply, scaled |
| Methods inherited from interface com.numericalmethod.suanshu.matrix.doubles.MatrixAccess |
|---|
get, set |
| Methods inherited from interface com.numericalmethod.suanshu.datastructure.Table |
|---|
nCols, nRows |
| 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 |
|---|
nNonZeros |
| Method Detail |
|---|
java.util.List<SparseEntry> getEntrytList()
SparseEntrys.
This is useful for converting between the different formats of SparseMatrix.
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.getEntrytList());
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||