SparseVector
Stored indices are strictly ascending and in range within this vector's window. Factories validate the structure; of sorts and sums instead.
Use copyIndices or com.eignex.koblas.forEachStored for safe structural access. indices is a live zero-copy escape hatch for specialized kernels and requires UnsafeKoblasApi; mutating it can invalidate the sparse structure. values remains live so coefficients can be updated without changing the sparse pattern. Column views borrow their owner's arrays: only the nnz entries beginning at offset belong to the vector. A view follows its matrix after structural changes; serialization and copies contain only its stored entries. Inserting an entry through set or changing the pattern through Vector.copyFrom or KoblasEngine.axpy replaces the buffers; obtain current arrays from the accessors after structural writes.
Properties
indices
nnz
offset
size
values
Live stored values; structural writes may replace this buffer.
Functions
copyIndices
A copy of this vector's stored positions, in strictly ascending order.
equals
get
hashCode
set
toDoubleArray
Materialise into a fresh dense DoubleArray, independent of the internal storage.
toString
Visit each stored entry as (index, value), in ascending index order for any storage. A SparseVector may present numerical zeros as stored, and any other Vector has every index visited.
Vector norm of type: Norm.One sums absolute values, Norm.Two is the Euclidean norm, and Norm.Infinity and Norm.MaxAbs select the maximum absolute value. An empty vector has norm zero.