Skip to content
Commit c6597025 authored by Karl Rupp's avatar Karl Rupp
Browse files

BiCGStab, GMRES: Rearranged residual calculation to remove temporaries.

The use of y -= prod(A, x) is troublesome for matrix-free applications,
hence the residual calculation
 residual = rhs;
 residual -= prod(A, current_guess);
was modified to
 residual = prod(A, current_guess);
 residual = rhs - residual;
to circumvent the problem.
As an extra benefit, this also improves performance since our current
implementation of y -= prod(A, x) for sparse matrices A relies
on a temporary for prod(A, x).
parent b8d58253
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment