conjugate_gradient

odl.solvers.iterative.iterative.conjugate_gradient(op, x, rhs, niter, callback=None)[source]

Optimized implementation of CG for self-adjoint operators.

This method solves the inverse problem (of the first kind):

A(x) = y

for a linear and self-adjoint Operator A.

It uses a minimum amount of memory copies by applying re-usable temporaries and in-place evaluation.

The method is described (for linear systems) in a Wikipedia article.

Parameters
oplinear Operator

Operator in the inverse problem. It must be linear and self-adjoint. This implies in particular that its domain and range are equal.

xop.domain element

Element to which the result is written. Its initial value is used as starting point of the iteration, and its values are updated in each iteration step.

rhsop.range element

Right-hand side of the equation defining the inverse problem.

niterint

Number of iterations.

callbackcallable, optional

Object executing code per iteration, e.g. plotting each iterate.

See also

conjugate_gradient_normal

Solver for nonsymmetric matrices