Iterative Solution of Systems of Linear Equations

The pcg Module

A pure Python/numpy implementation of the Steihaug-Toint truncated preconditioned conjugate gradient algorithm as described in

T. Steihaug, The conjugate gradient method and trust regions in large scale optimization, SIAM Journal on Numerical Analysis 20 (3), pp. 626-637, 1983.
class pcg.TruncatedCG(qp, **kwargs)

Bases: object

__init__(qp, **kwargs)

Solve the quadratic trust-region subproblem

minimize g’s + 1/2 s’Hs subject to s’s <= radius

by means of the truncated conjugate gradient algorithm (aka the Steihaug-Toint algorithm). The notation x’y denotes the dot product of vectors x and y.

Parameters:
qp:an instance of the QPModel class. The Hessian H must be a symmetric linear operator of appropriate size, but not necessarily positive definite.
logger_name:name of a logger object that can be used during the iterations (default None)
Returns:

Upon return, the following attributes are set:

step:final step,
niter:number of iterations,
step_norm:Euclidian norm of the step,
dir:direction of infinite descent (if radius=None and H is not positive definite),
onBoundary:set to True if trust-region boundary was hit,
infDescent:set to True if a direction of infinite descent was found

The algorithm stops as soon as the preconditioned norm of the gradient falls under

max( abstol, reltol * g0 )

where g0 is the preconditioned norm of the initial gradient (or the Euclidian norm if no preconditioner is given), or as soon as the iterates cross the boundary of the trust region.

post_iteration(*args, **kwargs)

Subclass and override this method to implement custom post-iteration actions. This method will be called at the end of each CG iteration.

solve(**kwargs)

Solve the trust-region subproblem.

Keywords:
s0:initial guess (default: [0,0,...,0]),
radius:the trust-region radius (default: None),
abstol:absolute stopping tolerance (default: 1.0e-8),
reltol:relative stopping tolerance (default: 1.0e-6),
maxiter:maximum number of iterations (default: 2n),
prec:a user-defined preconditioner.

The projKrylov Module

The ppcg Module