Solve Ax=b by preconditioned conjugate gradients
CG(
b,
env,
x = 0 * b,
max.it = length(b),
e = 1e+06 * length(b),
verbose = FALSE,
...
)
The (approximated) solution to Ax=b.
right hand side vector.
environment containing at least a function A_times
that computes
the matrix-vector product Ax for some input vector x, and a function M_solve
that computes M^-1 x for some preconditioner matrix M.
start value for the conjugate gradient algorithm.
maximum number of iterations.
total squared error stop criterion.
whether progress information is shown.
any parameters passed to A_times
and M_solve
.
M.R. Hestenes and E. Stiefel (1952). Methods of conjugate gradients for solving linear systems. Journal of Research of the National Bureau of Standards 49(6), 409-436.