koblas

SparseLinearAlgebra

Both sparse matrix seams at once, the counterpart of com.eignex.koblas.dense.LinearAlgebra.

Implement this when a backend provides both, which is the usual case for a host library — SuiteSparse ships the solver and the products together, unlike the CBLAS-without-LAPACKE split that made the dense halves worth ranking separately. The halves are still registered independently, because costing nothing to allow is better than discovering later that something needed it.

Inheritors

Properties

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 simultaneously available backends: automatic selection through registerBackend — JVM classpath discovery, native startup registration — picks the highest per half. The portable reference is 0; native-accelerated backends rank above it (koblas-openblas 100, koblas-cblas 90).

Functions

Link copied to clipboard
open fun factor(a: SparseMatrix, equilibrate: Boolean = false, dropTolerance: Double = NO_DROP): SparseFactorization

Factorize the square a into something solvable, never null.

Link copied to clipboard
open fun gemv(a: SparseMatrix, x: DoubleArray, transpose: Boolean = false): DoubleArray

A · x, or Aᵀ · x when transpose, into a fresh result — the restricted gemv with alpha = 1, beta = 0.

open fun gemv(alpha: Double, a: SparseMatrix, x: DoubleArray, beta: Double, y: DoubleArray, transpose: Boolean = false)

In-place y = alpha · op(A) · x + beta · y, where op(A) is Aᵀ when transpose — the sparse dgemv. Per BLAS convention beta == 0.0 overwrites y without reading it, so it may arrive uninitialized, and alpha == 0.0 reduces to the beta scale.

Link copied to clipboard
open fun trsv(a: SparseMatrix, x: DoubleArray, lower: Boolean, transpose: Boolean = false)

Solve op(T) · x = b in place, where T is the lower or upper triangle of the square a and op transposes when transpose — the sparse dtrsv. x holds the right-hand side on entry and the solution on return.