pymoto.solvers.SolverSparseCholeskyCVXOPT

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

Solver for positive-definite Hermitian matrices using a Cholesky factorization.

This solver requires the Python package cvxopt.

References

__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{L}^{-\text{H}}\mathbf{L}^{-1}\mathbf{b}\).

update(A)

Factorize the matrix using CVXOPT's Cholmod as \(\mathbf{A}=\mathbf{L}\mathbf{L}^\text{H}\).

Attributes

defined

defined = False
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

update(A)

Factorize the matrix using CVXOPT’s Cholmod as \(\mathbf{A}=\mathbf{L}\mathbf{L}^\text{H}\).

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{L}^{-\text{H}}\mathbf{L}^{-1}\mathbf{b}\).