koblas

dense

Dense linear algebra: the three swappable seams and the routines behind them.

Types

Link copied to clipboard
typealias Blas = F64Blas

Double-precision F64Blas, the matrix half an unqualified Blas means.

Link copied to clipboard

Double-precision F64CholeskyDecomposition, the Cholesky factor an unqualified CholeskyDecomposition means.

Link copied to clipboard
sealed interface CholeskyPolicy

What F64Decompositions.cholesky does when the matrix turns out not to be positive-definite.

Link copied to clipboard
interface F64Blas : Backend

Dense matrix routines as a backend half.

Link copied to clipboard

A Cholesky factorization A = L·Lᵀ. Only the lower triangle of l is meaningful; the strict upper triangle holds whatever the factorization left there.

Link copied to clipboard

Dense factorizations as a backend half.

Link copied to clipboard
interface F64Kernels : Backend

The vector-vector routines as a backend half, alongside F64Blas and F64Decompositions. Implementations must agree with F64PlatformKernels to within rounding and read nothing outside the (offset, length) window.

Link copied to clipboard
class F64LdlDecomposition(val n: Int, val ldl: DoubleArray, val ipiv: IntArray, val failedAt: Int = NOT_SINGULAR)

A symmetric indefinite factorization A = L·D·Lᵀ in LAPACK dsytrf lower packed form. ldl and ipiv are live buffers, not copies, so treat them as read-only.

Link copied to clipboard

Both halves of the compute seam at once; implement F64Blas or F64Decompositions alone when a backend has one.

Link copied to clipboard
class F64LuDecomposition(val n: Int, val lu: DoubleArray, val piv: IntArray, failedAt: Int = NOT_SINGULAR)

A general LU factorization with partial pivoting, P·A = L·U, packed column-major with L below the diagonal and U on and above. lu and piv are live buffers, not copies, so treat them as read-only.

Link copied to clipboard
class F64PivotedQrDecomposition(val factorization: F64QrDecomposition, val pivots: IntArray, val rank: Int)

A QR factorization with column pivoting, A·P = Q·R (LAPACK dgeqp3), plus the numerical rank the pivoting revealed. factorization factorizes A·P, so its solutions come out in permuted column order. pivots is a live buffer, not a copy, so treat it as read-only: reordering it changes what every later solve against this factorization returns.

Link copied to clipboard
class F64QrDecomposition(val m: Int, val n: Int, val qr: DoubleArray, val tau: DoubleArray)

A QR factorization A = Q·R in LAPACK dgeqrf packed form, R on and above the diagonal and the Householder vectors below. qr and tau are live buffers, not copies, so treat them as read-only.

Link copied to clipboard

Portable pure-Kotlin backend, correct on every target with no native dependency, and the semantic reference a native backend is validated against. The routines themselves live in F64ReferenceBlas and F64ReferenceDecompositions; this composes them so one object satisfies the whole dense seam.

Link copied to clipboard
typealias Kernels = F64Kernels

Double-precision F64Kernels, the vector-vector half an unqualified Kernels means.

Link copied to clipboard

Double-precision F64Decompositions, the factorization half an unqualified Lapack means.

Link copied to clipboard

Double-precision F64LdlDecomposition, the LDLt factors an unqualified LdlDecomposition means.

Link copied to clipboard

Double-precision F64LinearAlgebra, the pair of halves an unqualified LinearAlgebra means.

Link copied to clipboard

Double-precision F64LuDecomposition, the LU factors an unqualified LuDecomposition means.

Link copied to clipboard

Double-precision F64PivotedQrDecomposition, the pivoted QR an unqualified PivotedQrDecomposition means.

Link copied to clipboard

Double-precision F64QrDecomposition, the QR factors an unqualified QrDecomposition means.

Link copied to clipboard

Double-precision F64ReferenceBackend, the portable backend an unqualified ReferenceBackend means.

Link copied to clipboard
enum Uplo : Enum<Uplo>

Triangle selector. FULL is a koblas extension to the lower/upper choice in BLAS and LAPACK.

Properties

Link copied to clipboard

The F64LinearAlgebra.qrPivoted tolerance meaning "derive one from the matrix", max(m, n) · ε.

Link copied to clipboard

The shared portable backend, the fallback every seam resolves to when nothing else is registered.

Functions

Link copied to clipboard

Q · y, or Qᵀ · y when transpose, without forming Q; see F64Decompositions.applyQ.

Link copied to clipboard
fun F64DenseMatrix.cholesky(policy: CholeskyPolicy = CholeskyPolicy.Strict, uplo: Uplo = Uplo.FULL): F64CholeskyDecomposition

Cholesky factorization A = L·Lᵀ with the active backend (koblas). Uplo.FULL checks that both triangles agree, while Uplo.LOWER or Uplo.UPPER names the authoritative triangle without checking the other. A non-positive pivot throws NotPositiveDefinite unless policy regularizes.

Link copied to clipboard

det(A) as sign(P) times the product of the U(k, k).

Link copied to clipboard

A⁻¹ from this factorization with the active backend; see F64Decompositions.invert.

A⁻¹ from this factorization (LAPACK dgetri); see F64Decompositions.invert.

Link copied to clipboard
fun F64DenseMatrix.ldl(workspace: Workspace? = null, uplo: Uplo = Uplo.FULL): F64LdlDecomposition

Symmetric indefinite factorization A = L·D·Lᵀ with the active backend. Uplo.FULL checks that both triangles agree; Uplo.LOWER or Uplo.UPPER selects one triangle without checking the other.

Link copied to clipboard

LU-factorize this square matrix with the active backend (koblas); see F64Decompositions.factor.

Link copied to clipboard

QR factorization A = Q·R with the active backend; see F64Decompositions.qr.

Link copied to clipboard
fun F64DenseMatrix.qrPivoted(tolerance: Double = AUTOMATIC_RANK_TOLERANCE, workspace: Workspace? = null): F64PivotedQrDecomposition

QR with column pivoting, A·P = Q·R, with the active backend; see F64Decompositions.qrPivoted.

Link copied to clipboard
fun F64LuDecomposition.rcond(anorm: Double, workspace: Workspace? = null): Double

Reciprocal condition estimate, given the 1-norm anorm of the matrix it came from; see F64Decompositions.rcond. Pair it with com.eignex.koblas.norm1, computed before factoring.

Link copied to clipboard

Solve A · x = b for this factorization with the active backend; see F64Decompositions.solve.

Solve A · X = B for the columns of b at once (LAPACK dsytrs with nrhs).

Solve A · x = b for this symmetric indefinite factorization; see F64Decompositions.solve.

Solve A · X = B for the columns of b at once (LAPACK dgetrs with nrhs).

Solve A · x = b (or Aᵀ · x = b when transpose) for this factorization with the active backend.

Least-squares solution against this rank-revealing factorization; see F64Decompositions.solve.

fun F64QrDecomposition.solve(b: DoubleArray, minimumNorm: Boolean = false, workspace: Workspace? = null): DoubleArray

Solve this QR factorization; minimumNorm solves a wide original system from qr(Aᵀ).

Link copied to clipboard
fun trmm(a: F64DenseMatrix, b: F64DenseMatrix, lower: Boolean, transpose: Boolean = false, unitDiag: Boolean = false, right: Boolean = false, alpha: Double = 1.0)

B = alpha · op(T) · B, or B = alpha · B · op(T) when right (BLAS dtrmm); see F64LinearAlgebra.trmm. Reads only the triangle lower selects.

Link copied to clipboard
fun trmv(a: F64DenseMatrix, x: DoubleArray, lower: Boolean, transpose: Boolean = false, unitDiag: Boolean = false)

Multiply x = op(T) · x in place (BLAS dtrmv); see F64LinearAlgebra.trmv. Reads only the triangle lower selects.

Link copied to clipboard
fun trsm(a: F64DenseMatrix, b: F64DenseMatrix, lower: Boolean, transpose: Boolean = false, unitDiag: Boolean = false, right: Boolean = false, alpha: Double = 1.0)

B = alpha · op(T)⁻¹ · B, or B = alpha · B · op(T)⁻¹ when right (BLAS dtrsm); see F64LinearAlgebra.trsm. Reads only the triangle lower selects, and a singular triangle yields infinities or NaNs.

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

Solve op(T) · x = b in place (BLAS dtrsv); see F64LinearAlgebra.trsv. Reads only the triangle lower selects, and does not check the diagonal, so a singular triangle yields infinities or NaNs.

Link copied to clipboard
fun trtri(a: F64DenseMatrix, lower: Boolean, unitDiag: Boolean = false): F64DenseMatrix

Invert the lower or upper triangle of a (LAPACK dtrtri); see F64LinearAlgebra.trtri.