public class DenseVector extends AbstractVector
This is a trivial implementation for vector assuming dense logic, local on-heap JVM storage
based on double[]
array. It is only suitable for data sets where
local, non-distributed execution is satisfactory and on-heap JVM storage is enough
to keep the entire data set.
Vector.Element
Constructor and Description |
---|
DenseVector() |
DenseVector(double[] arr) |
DenseVector(double[] arr,
boolean shallowCp) |
DenseVector(int size) |
DenseVector(Map<String,Object> args) |
DenseVector(Serializable[] data) |
Modifier and Type | Method and Description |
---|---|
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.
|
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, nonZeroSpliterator, normalize, normalize, plus, plus, readExternal, set, setRaw, setRawX, setStorage, setX, size, sort, storageGet, storageGetRaw, storageSet, storageSetRaw, sum, times, times, toMatrix, toMatrixPlusOne, viewPart, writeExternal
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
asArray, labeled
getAttribute, hasAttribute, removeAttribute, setAttribute
public DenseVector(Serializable[] data)
data
- Data.public DenseVector(Map<String,Object> args)
args
- Parameters for new Vector.public DenseVector()
public DenseVector(int size)
size
- Vector cardinality.public DenseVector(double[] arr, boolean shallowCp)
arr
- Source array.shallowCp
- true
to use shallow copy.public DenseVector(double[] arr)
arr
- Source array.public Matrix likeMatrix(int rows, int cols)
rows
- Number of rows.cols
- Number of columns.public Vector like(int crd)
crd
- Cardinality for new vector.
GridGain In-Memory Computing Platform : ver. 8.9.19 Release Date : April 10 2025