koblas

F64SparseKernels

Sparse vector-vector routines as a backend half.

Inheritors

Properties

Link copied to clipboard

Whether this backend can do work on this host. koblas's own implementations always can, so the default is true; a binding reports whether the library it calls resolved.

Link copied to clipboard

Whether this is koblas's own implementation rather than a binding to a host library. The compiled-in SIMD kernels are portable however fast they are; only something calling out counts as accelerated.

Link copied to clipboard
abstract val name: String

A short backend identifier for diagnostics (e.g. "reference").

Link copied to clipboard
open val priority: Int

Relative preference among the backends offered for one half (F64Blas, F64Decompositions, F64Kernels or a sparse counterpart). registerBackend picks the highest; the portable reference is 0.

Functions

asum

abstract fun asum(x: F64SparseVector): Double(source)

Sum |x_i| over the stored entries.

axpy

abstract fun axpy(y: DoubleArray, alpha: Double, x: F64SparseVector)(source)

y += alpha·x for a sparse x into a dense y (Sparse BLAS usaxpy), touching only x's stored positions.

dot

xᵀ·y for a sparse x against a dense y (Sparse BLAS usdot); walks only the stored entries.


xᵀ·y for two sparse vectors, merging their index lists in one pass. Relies on both operands being strictly ascending, which F64SparseVector validates.

nrm2

abstract fun nrm2(x: F64SparseVector): Double(source)

Euclidean norm over the stored entries, rescaled as the dense euclideanNorm is.

scatter

abstract fun scatter(x: F64SparseVector, out: DoubleArray)(source)

Write x's stored entries into out at their positions, leaving the rest of out alone (Sparse BLAS ussc). Zero-fill out first for a plain densification.