koblas

F64BasisFactorization

A sparse factorization of a simplex basis that can follow a replacement of one basis column.

replaceColumn returns the factorization of the resulting basis, which supersedes this factorization. An implementation may update its factors directly or rebuild them when the replacement would be too dense or numerically unsafe to update.

Inheritors

BasicluBasisFactorization

Properties

basis

The square basis matrix represented by this factorization.

Link copied to clipboard
abstract val failedAt: Int

The pivot position that had no numerically acceptable candidate, or NOT_SINGULAR when the factorization succeeded.

Link copied to clipboard
abstract val n: Int

The dimension of the factored matrix.

Link copied to clipboard
abstract val nnz: Int

Nonzeros in the factors, the fill. Zero for a singular factorization, which has none.

Link copied to clipboard
abstract val rcond: Double

A cheap pivot-quality estimate: min(abs(U(k, k))) / max(abs(U(k, k))). A small value warns that the factorization may be inaccurate; it is not a reciprocal condition-number estimate.

Link copied to clipboard
open val singular: Boolean

Whether the factorization failed for want of a numerically acceptable pivot. Solving against one throws com.eignex.koblas.SingularMatrix rather than answering with infinities.

Functions

replaceColumn

abstract fun replaceColumn(column: Int, entering: F64SparseVector): F64BasisFactorization(source)

Replace column of basis with entering and return the factorization of the resulting basis, which supersedes this factorization.

column must name a column of basis, and entering must have length n.

Link copied to clipboard
open fun solve(b: DoubleArray, transpose: Boolean = false): DoubleArray

Solve B x = b, or Bᵀ x = b when transpose, into a fresh result.

Link copied to clipboard
abstract fun solveInto(b: DoubleArray, out: DoubleArray, transpose: Boolean = false, workspace: Workspace? = null): DoubleArray

Solve B x = b, or Bᵀ x = b when transpose, into out, which is returned. Allocates nothing when given a workspace. out may be b.