koblas

F64BlasAdapter

abstract class F64BlasAdapter : F64Blas(source)

The dense matrix routines a host CBLAS provides, over whichever CblasCalls the platform supplies. Both host bindings are this class plus their own FFI mechanism.

Below the DispatchThresholds gate for its level, each routine hands back to the portable implementation: crossing into a native library costs more than the work saves on a small problem.

Inheritors

F64Cblas

Properties

isPortable

open override val isPortable: Boolean(source)

A binding that calls out, whatever the portable instance it falls back to reports.

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

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

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

ger

open override 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

open override 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

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

The shape is checked ahead of the gate: dsymv takes one dimension and a leading dimension, so a non-square matrix would have it read entries from a shorter array, past the end of the buffer.

syr

open override 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

open override 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

open override 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

open override 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

open override 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

open override 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

open override 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

open override 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.

Link copied to clipboard

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

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

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.

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

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

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

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

gemm

open override 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.

gemv

open override 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.