This paper proposes a preconditioner for the conjugate gradient method ( CG
) that is designed for solving systems of equations Ax = b(i) with differen
t right-hand-side vectors or for solving a sequence of slowly varying syste
ms A(k)x = b(k). The preconditioner has the form of a limited memory quasi-
Newton matrix and is generated using information from the CG iteration. The
automatic preconditioner does not require explicit knowledge of the coeffi
cient matrix A and is therefore suitable for problems where only products o
f A times a vector can be computed. Numerical experiments indicate that the
preconditioner has most to offer when these matrix-vector products are exp
ensive to compute and when low accuracy in the solution is required. The ef
fectiveness of the preconditioner is tested within a Hessian-free Newton me
thod for optimization and by solving certain linear systems arising infinit
e element models.