koblas

F64SparseLu

Sparse LU factorization as a backend half.

Inheritors

Properties

supportsBasisUpdates

Whether factorBasis answers with a factorization that updates its factors in place. When false a replacement costs a factorization, so a caller pacing its own refactorizations has nothing left to pace.

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

factor

abstract fun factor(a: F64SparseMatrix, equilibrate: Boolean = false, dropTolerance: Double = NO_DROP): F64SparseFactorization(source)

Factorize the square a into something solvable. A singular matrix comes back as a factorization reporting singular rather than as an exception, with a failedAt counting elimination steps rather than naming a column: the step that fails is the one with no acceptable pivot left, so there is no column of a to attribute it to.

Parameters

a

the square matrix to factorize.

equilibrate

scale rows by a power of two first; the solves undo it.

dropTolerance

discard produced entries this far below the largest magnitude, giving an incomplete factorization.

factorBasis

Factor a simplex basis for column replacements.

A general sparse LU backend need not support factor updates. The default refactorizes on every replacement, which every backend can do; supportsBasisUpdates tells the two apart.

refactor

open fun refactor(previous: F64SparseFactorization, a: F64SparseMatrix, equilibrate: Boolean = false, dropTolerance: Double = NO_DROP): F64SparseFactorization(source)

Factor a, reusing compatible state from previous when this backend can. The returned factorization supersedes previous, which must not be solved after this call. Backends that cannot reuse it answer as factor would.

solve

open fun solve(f: F64SparseFactorization, b: DoubleArray, transpose: Boolean = false): DoubleArray(source)

solveInto into a fresh vector.

solveInto

open fun solveInto(f: F64SparseFactorization, b: DoubleArray, out: DoubleArray, transpose: Boolean = false, workspace: Workspace? = null): DoubleArray(source)

Solve A·x = b from f into out, Aᵀ·x = b when transpose. The work belongs to the factorization; this is here so the seam reads the same from the sparse side as com.eignex.koblas .dense.F64Decompositions.solveInto does from the dense one.