koblas

F64Blas

interface F64Blas : Backend(source)

Dense matrix routines as a backend half.

Inheritors

Properties

kernels

The vector kernels this half's inherited routines run on; the installed ones by default.

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

gemm

abstract fun gemm(alpha: Double, a: F64DenseMatrix, transposeA: Boolean, b: F64DenseMatrix, transposeB: Boolean, beta: Double, c: F64DenseMatrix)(source)

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.


gemm with alpha = 1, beta = 0, into a fresh matrix. A.cols must equal B.rows.

gemv

abstract fun gemv(alpha: Double, a: F64DenseMatrix, x: DoubleArray, beta: Double, y: DoubleArray, transpose: Boolean = false)(source)

y = alpha · op(A) · x + beta · y (BLAS dgemv), with op(A) being Aᵀ when transpose. beta == 0.0 overwrites y without reading it.


open fun gemv(a: F64DenseMatrix, x: DoubleArray, transpose: Boolean = false): DoubleArray(source)

gemv with alpha = 1, beta = 0, into a fresh result.

ger

abstract fun ger(alpha: Double, x: DoubleArray, y: DoubleArray, a: F64DenseMatrix)(source)

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.

symm

abstract fun symm(alpha: Double, a: F64DenseMatrix, b: F64DenseMatrix, beta: Double, c: F64DenseMatrix, lower: Boolean = true, right: Boolean = false)(source)

C = alpha · A · B + beta · C, or C = alpha · B · A + beta · C when right (BLAS dsymm). Only the lower triangle of a is read; beta == 0.0 overwrites c without reading it.

symv

abstract fun symv(alpha: Double, a: F64DenseMatrix, x: DoubleArray, beta: Double, y: DoubleArray, lower: Boolean = true)(source)

y = alpha · A · x + beta · y for a symmetric a (BLAS dsymv). Only the lower triangle is read, diagonal included; beta == 0.0 overwrites y without reading it.

syr

abstract fun syr(alpha: Double, x: F64VectorLike, a: F64DenseMatrix, uplo: Uplo = Uplo.FULL)(source)

A += alpha · x · xᵀ (BLAS dsyr), writing the triangles uplo selects. syrk is the rank-k form.

syr2

abstract fun syr2(alpha: Double, x: F64VectorLike, y: F64VectorLike, a: F64DenseMatrix, uplo: Uplo = Uplo.FULL)(source)

A += alpha · (x · yᵀ + y · xᵀ) (BLAS dsyr2), writing the triangles uplo selects.

syr2k

abstract fun syr2k(alpha: Double, a: F64DenseMatrix, b: F64DenseMatrix, transpose: Boolean, beta: Double, c: F64DenseMatrix, uplo: Uplo = Uplo.FULL, workspace: Workspace? = null)(source)

C = alpha · (op(A) · op(B)ᵀ + op(B) · op(A)ᵀ) + beta · C (BLAS dsyr2k), where op transposes when transpose. Writes the triangles uplo selects.

A non-transposed pair is transposed into scratch first, so pass a workspace to keep a loop over this routine from allocating 2·n·k doubles per call. syrk borrows the same way for its one operand.

syrk

abstract fun syrk(alpha: Double, a: F64DenseMatrix, transpose: Boolean, beta: Double, c: F64DenseMatrix, uplo: Uplo = Uplo.FULL, workspace: Workspace? = null)(source)

C = alpha · A·Aᵀ + beta · C, or alpha · Aᵀ·A + beta · C when transpose (BLAS dsyrk). Uplo.FULL writes both triangles, unlike standard dsyrk; beta == 0.0 overwrites without reading.

trmm

abstract fun trmm(a: F64DenseMatrix, b: F64DenseMatrix, lower: Boolean, transpose: Boolean = false, unitDiag: Boolean = false, right: Boolean = false, alpha: Double = 1.0)(source)

B = alpha · op(T) · B, or B = alpha · B · op(T) when right (BLAS dtrmm), the counterpart of trsm.

trmv

abstract fun trmv(a: F64DenseMatrix, x: DoubleArray, lower: Boolean, transpose: Boolean = false, unitDiag: Boolean = false)(source)

x = op(T) · x in place (BLAS dtrmv), the product counterpart of trsv.

trsm

abstract fun trsm(a: F64DenseMatrix, b: F64DenseMatrix, lower: Boolean, transpose: Boolean = false, unitDiag: Boolean = false, right: Boolean = false, alpha: Double = 1.0)(source)

B = alpha · op(T)⁻¹ · B in place, or B = alpha · B · op(T)⁻¹ when right (BLAS dtrsm). Flags follow trsv; the right-hand sides are the columns of b from the left and its rows from the right.

trsv

abstract fun trsv(a: F64DenseMatrix, x: DoubleArray, lower: Boolean, transpose: Boolean = false, unitDiag: Boolean = false)(source)

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.

The diagonal is divided by, not tested: dtrsv carries no info and reports nothing, so a singular triangle yields infinities or NaNs and the caller who needs the distinction tests the diagonal first. That is the convention rather than a cost, and trtri shows it: having an info to return, it throws on a zero diagonal. The sparse com.eignex.koblas.sparse.F64SparseBlas.trsv throws too, having no BLAS routine whose silence it has to match.