F64Context
Every backend koblas will use for a piece of work, in one object you can hold. Immutable, and itself a F64LinearAlgebra and a F64SparseLinearAlgebra by delegation.
Constructors
F64Context
Properties
blas
decompositions
isAvailable
True when every half can run, which a context assembled from resolved backends always can.
isPortable
True when every half is koblas's own, so the context calls out to nothing.
kernels
name
The distinct names of the backends that do the matrix work, joined, such as "openblas+reference". The vector-kernel halves are left out; koblasInfo prints both parts.
priority
sparseBlas
sparseKernels
sparseLu
The slots still running koblas's own portable implementation, in declaration order.
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.
Functions
toString
with
A copy with the named halves replaced and the rest kept. A replaced kernels reaches the inherited routines of halves that follow the installed context, which requires installBackends; a half built around kernels of its own always keeps them.
The backend installed in slot.
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.
Factor a simplex basis for column replacements.
gemm with alpha = 1, beta = 0, into a fresh matrix. A.cols must equal B.rows.
C = alpha · op(A) · op(B) + beta · C (BLAS dgemm), with shapes op(A): m×k, op(B): k×n, C: m×n. beta == 0.0 overwrites c without reading it.
gemv with alpha = 1, beta = 0, into a fresh result.
y = alpha · op(A) · x + beta · y (BLAS dgemv), with op(A) being Aᵀ when transpose. beta == 0.0 overwrites y without reading it.
A · x, or Aᵀ · x when transpose, into a fresh result.
A = A + alpha · x · yᵀ (BLAS dger), the dense form a backend can dispatch. The free ger accepts F64VectorView operands and takes a sparse fast path.
Invert an SPD matrix from its Cholesky factorization, returning A⁻¹ given chol (LAPACK dpotri).
Invert a general matrix from its LU factorization, returning A⁻¹ given P·A = L·U (LAPACK dgetri). Prefer solve to apply A⁻¹, which costs less and is more accurate.
Whether slot is filled by something other than koblas's own portable implementation.
Symmetric indefinite factorization A = L·D·Lᵀ with Bunch-Kaufman pivoting (LAPACK dsytrf, lower). Reads only the lower triangle of a, so an upper-only matrix factors to silent nonsense.
QR with column pivoting, A·P = Q·R (LAPACK dgeqp3), reporting F64PivotedQrDecomposition.rank as the count of leading diagonal entries with |R_kk| > tolerance · |R₀₀|. tolerance is a fraction of |R₀₀|; AUTOMATIC_RANK_TOLERANCE derives one from the shape, max(m, n) · ε, and a negative value is rejected.
Throws unless every one of slots is filled by an accelerated backend.
Solve A · X = B for all right-hand-side columns of b at once against a symmetric indefinite factorization (LAPACK dsytrs with nrhs).
Solve A · x = b for a symmetric indefinite factorization ldl (LAPACK dsytrs).
Solve A · X = B, or Aᵀ · X = B when transpose, for all right-hand-side columns of b at once (LAPACK dgetrs with nrhs).
Least-squares solve from a pivoted factorization, with the column permutation undone. A rank-deficient factorization returns the basic solution, not the minimum-norm one: zero outside the pivoted rank.
Solve from a QR factorization. By default, finds the least-squares solution min ‖A·x − b‖₂ for a tall or square A; it requires full column rank and returns R⁻¹·(Qᵀb). With minimumNorm, finds the minimum-norm solution of a consistent wide system from qr(Aᵀ); it requires full row rank.
solveInto into a fresh vector.
Solve A · X = B, or Aᵀ · X = B when transpose, into out, which is returned. out may be b, and a workspace lends the transposed direction's n·nrhs staging block.
Solve A · x = b, or Aᵀ · x = b when transpose, into out, which is returned. out may be b, and a workspace lends the transposed direction's staging buffer.
solve into out, which is returned. Its length is n by default and m with minimumNorm. A workspace lends the intermediate for applying Q or Qᵀ.
A += alpha · (x · yᵀ + y · xᵀ) (BLAS dsyr2), writing the triangles uplo selects.
x = op(T) · x in place (BLAS dtrmv), the product counterpart of trsv.
Solve op(T) · x = b in place (BLAS dtrsv) for the lower or upper triangle of the square a, op transposing when transpose and unitDiag taking the diagonal as 1. x carries b in and x out.