public class SparseMatrix extends AbstractMatrix implements StorageConstants
SparseVector
as rows.Matrix.Element
COLUMN_STORAGE_MODE, RANDOM_ACCESS_MODE, ROW_STORAGE_MODE, SEQUENTIAL_ACCESS_MODE, UNKNOWN_STORAGE_MODE
Constructor and Description |
---|
SparseMatrix() |
SparseMatrix(int rows,
int cols)
Construct new
SparseMatrix . |
Modifier and Type | Method and Description |
---|---|
void |
compute(int row,
int col,
IgniteTriFunction<Integer,Integer,Double,Double> f)
Replace matrix entry with value oldVal at (row, col) with result of computing f(row, col, oldVal).
|
Matrix |
copy()
Clones this matrix.
|
it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap<it.unimi.dsi.fastutil.ints.IntSet> |
indexesMap() |
Matrix |
like(int rows,
int cols)
Creates new empty matrix of the same underlying class but of different size.
|
Vector |
likeVector(int crd)
Creates new empty vector of compatible properties (similar or the same flavor) to this matrix.
|
int |
nonZeroElements()
Gets number of non-zero elements in this matrix.
|
allSpliterator, assign, assign, assign, assign, assignColumn, assignRow, columnSize, density, destroy, determinant, divide, equals, foldColumns, foldMap, foldRows, get, getCol, getElement, getMetaStorage, getRow, getStorage, getX, guid, hashCode, inverse, isArrayBased, isDense, isDistributed, likeIdentity, map, map, maxElement, maxValue, minElement, minus, minValue, nonZeroSpliterator, plus, plus, readExternal, rowSize, set, setColumn, setRow, setStorage, setX, storageGet, storageSet, sum, swapColumns, swapRows, times, times, times, toString, transpose, viewColumn, viewDiagonal, viewRow, writeExternal
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
assertAccessMode, assertStorageMode
getAttribute, hasAttribute, removeAttribute, setAttribute
public SparseMatrix()
public SparseMatrix(int rows, int cols)
SparseMatrix
.
By default storage sets in row optimized mode and in random access mode.public Matrix like(int rows, int cols)
NOTE: new matrix will have the same flavor as the this matrix but a different ID.
public Vector likeVector(int crd)
likeVector
in interface Matrix
crd
- Cardinality of the vector.public int nonZeroElements()
nonZeroElements
in interface Matrix
nonZeroElements
in class AbstractMatrix
public it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap<it.unimi.dsi.fastutil.ints.IntSet> indexesMap()
public Matrix copy()
NOTE: new matrix will have the same flavor as the this matrix but a different ID.
copy
in interface Matrix
copy
in class AbstractMatrix
public void compute(int row, int col, IgniteTriFunction<Integer,Integer,Double,Double> f)
compute
in interface Matrix
compute
in class AbstractMatrix
row
- Row.col
- Column.f
- Function used for replacing.
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024