pymoto.solvers.SolverDenseCholesky

class pymoto.solvers.SolverDenseCholesky(*args, **kwargs)

Solver for Hermitian positive-definite matrices using a Cholesky factorization. In case the matrix is singular and factorization fails, a backup-solver is used (SolverDenseLDL).

__init__(*args, **kwargs)

Initialize the solver

Parameters:

A (matrix, optional) – Optionally provide a matrix, which is used in :method:`update` right away.

Methods

__init__(*args, **kwargs)

Initialize the solver

residual(A, x, b[, trans])

Calculates the (relative) residual of the linear system of equations

solve(rhs[, x0, trans])

Solves the linear system of equations \(\mathbf{A} \mathbf{x} = \mathbf{b}\) by forward and backward substitution of \(\mathbf{x} = \mathbf{U}^{-1}\mathbf{U}^{-\text{H}}\mathbf{b}\).

update(A)

Factorize the matrix as \(\mathbf{A}=\mathbf{U}^{\text{H}}\mathbf{U}\), where \(\mathbf{U}\) is an upper triangular matrix.

Attributes

defined

update(A)

Factorize the matrix as \(\mathbf{A}=\mathbf{U}^{\text{H}}\mathbf{U}\), where \(\mathbf{U}\) is an upper triangular matrix.

solve(rhs, x0=None, trans='N')

Solves the linear system of equations \(\mathbf{A} \mathbf{x} = \mathbf{b}\) by forward and backward substitution of \(\mathbf{x} = \mathbf{U}^{-1}\mathbf{U}^{-\text{H}}\mathbf{b}\).

The right-hand-side \(\mathbf{b}\) can be of size (N) or (N, K), where N is the size of matrix \(\mathbf{A}\) and K is the number of right-hand sides.

defined = True
static residual(A, x, b, trans='N')

Calculates the (relative) residual of the linear system of equations

The residual is calculated as \(r = \frac{\left| \mathbf{A} \mathbf{x} - \mathbf{b} \right|}{\left| \mathbf{b} \right|}\)

Parameters:
  • A – The matrix

  • x – Solution vector

  • b – Right-hand side

  • trans (optional) – Matrix tranformation (N is normal, T is transposed, H is hermitian transposed)

Returns:

Residual value