Skip to content

Commit ca295a0

Browse files
committed
adapt docstring for CG
1 parent ec1b9a2 commit ca295a0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cg.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ cg(A, b; kwargs...) = cg!(zerox(A, b), A, b; initially_zero = true, kwargs...)
185185
residual vector;
186186
- `Pl = Identity()`: left preconditioner of the method. Should be symmetric,
187187
positive-definite like `A`;
188-
- `tol::Real = sqrt(eps(real(eltype(b))))`: tolerance for stopping condition `|r_k| / |r_0| ≤ tol`;
188+
- `abstol::Real = zero(real(eltype(b)))`,
189+
`reltol::Real = sqrt(eps(real(eltype(b))))`: absolute and relative
190+
tolerance for the stopping condition
191+
`|r_k| / |r_0| ≤ max(reltol * resnorm, abstol)`, where `r_k = A * x_k - b`
192+
is the residual in the `k`th iteration;
189193
- `maxiter::Int = size(A,2)`: maximum number of iterations;
190194
- `verbose::Bool = false`: print method information;
191195
- `log::Bool = false`: keep track of the residual norm in each iteration.

0 commit comments

Comments
 (0)