koblas

Companion

Factories for sparse vectors.

Functions

of

fun of(size: Int, indices: IntArray, values: DoubleArray): F64SparseVector(source)

Build a sparse vector, sorting by index and summing duplicates. Copies its inputs.

wrap

fun wrap(size: Int, indices: IntArray, values: DoubleArray): F64SparseVector(source)

Wrap existing arrays without copying, taking ownership; indices must already be strictly ascending and in range. The structural indices cannot be recovered for mutation afterwards.