koblas

F64VectorView

@Serializable
sealed interface F64VectorView : F64VectorLike(source)

The vector storages koblas itself defines, F64DenseVector and F64SparseVector.

Inheritors

Properties

Link copied to clipboard
abstract val size: Int

Number of entries, counting the unstored zeros of a sparse vector.

Functions

Link copied to clipboard

Sum of absolute values (BLAS dasum). Sparse vectors sum over stored entries only.

Link copied to clipboard

aT * b. Any sparse operand goes through F64SparseKernels, walking the stored entries only.

Link copied to clipboard
inline fun F64VectorLike.forEachStored(block: (i: Int, v: Double) -> Unit)

Visit each stored entry as (index, value), in ascending index order for any storage. A F64SparseVector may present numerical zeros as stored, and any other F64VectorLike has every index visited.

Link copied to clipboard
abstract operator fun get(i: Int): Double

The entry at index (i). Throws IndexOutOfBoundsException outside 0 until size, whatever the storage.

Link copied to clipboard

Index of the entry with maximal absolute value (BLAS idamax), -1 for a zero-length vector. Ties resolve to the lowest index, and a vector with no stored entries returns 0.

Link copied to clipboard

Euclidean norm (BLAS dnrm2). Rescales when the sum of squares would overflow or underflow, so any finite input gives the correct norm.

Link copied to clipboard
abstract fun toDoubleArray(): DoubleArray

Materialise into a fresh dense DoubleArray, independent of the internal storage.