public class SparseVector extends AbstractVector implements StorageConstants
Vector.Element
COLUMN_STORAGE_MODE, RANDOM_ACCESS_MODE, ROW_STORAGE_MODE, SEQUENTIAL_ACCESS_MODE, UNKNOWN_STORAGE_MODE
Constructor and Description |
---|
SparseVector() |
SparseVector(int size) |
SparseVector(Map<Integer,Double> map,
boolean cp) |
Modifier and Type | Method and Description |
---|---|
it.unimi.dsi.fastutil.ints.IntSet |
indexes()
Indexes of non-default elements.
|
Vector |
like(int crd)
Creates new empty vector of the same underlying class but of different cardinality.
|
Matrix |
likeMatrix(int rows,
int cols)
Creates new matrix of compatible flavor with given size.
|
Spliterator<Double> |
nonZeroSpliterator()
Gets spliterator for all non-zero values in this vector.
|
Vector |
times(double x)
Gets a new vector that contains product of each element and the argument.
|
all, allSpliterator, assign, assign, assign, assign, checkCardinality, checkCardinality, checkCardinality, checkIndex, compute, copy, copyOfRange, cross, destroy, divide, dot, dotSelf, equals, foldMap, foldMap, get, getDistanceSquared, getElement, getLengthSquared, getMetaStorage, getRaw, getRawX, getStorage, getX, guid, hashCode, increment, incrementX, isArrayBased, isDense, isDistributed, isNumeric, isZero, kNorm, logNormalize, logNormalize, makeElement, map, map, map, maxElement, maxValue, minElement, minus, minValue, nonZeroElements, nonZeroes, normalize, normalize, plus, plus, readExternal, set, setRaw, setRawX, setStorage, setX, size, sort, storageGet, storageGetRaw, storageSet, storageSetRaw, sum, times, toMatrix, toMatrixPlusOne, viewPart, writeExternal
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
assertAccessMode, assertStorageMode
asArray, labeled
getAttribute, hasAttribute, removeAttribute, setAttribute
public SparseVector()
public SparseVector(Map<Integer,Double> map, boolean cp)
map
- Underlying map.cp
- Should given map be copied.public SparseVector(int size)
size
- Vector size.public Vector like(int crd)
public Matrix likeMatrix(int rows, int cols)
likeMatrix
in interface Vector
rows
- Number of rows.cols
- Number of columns.public Vector times(double x)
times
in interface Vector
times
in class AbstractVector
x
- Multiply argument.public it.unimi.dsi.fastutil.ints.IntSet indexes()
public Spliterator<Double> nonZeroSpliterator()
nonZeroSpliterator
in interface Vector
nonZeroSpliterator
in class AbstractVector
GridGain In-Memory Computing Platform : ver. 8.9.19 Release Date : April 10 2025