Confusion about output

2 views
Skip to first unread message

Antonio Medrano

unread,
Apr 13, 2011, 7:09:51 PM4/13/11
to ucsb-computer-scien...@googlegroups.com
In the Matlab code, the output of the program is relres

relres = sqrt(rtr) / normb, where normb = norm(b).

In the MPI code, the output is the value norm. What exactly is this norm
value of? Is it norm(r)? Or should we output the equivalent to relres
from the matlab code?

-Antonio


Matt Weiden

unread,
Apr 14, 2011, 3:20:09 AM4/14/11
to ucsb-computer-scien...@googlegroups.com
In the email the professor sent to me he asks for the "norm of the residual". So in the notation from the lecture slides I believe that would be norm(r). Does that sound right?

Matt

Rachel L. Moore

unread,
Apr 17, 2011, 5:28:09 PM4/17/11
to ucsb-computer-scien...@googlegroups.com

The output is norm(r) but for calculating relres you use the norm(b),
which never changes. If you use norm(r) for relres I don't think it
will converge.

Rachel


Quoting Matt Weiden <wei...@cs.ucsb.edu>:

--
Rachel Moore
Department of Economics
University of California Santa Barbara

John Gilbert

unread,
Apr 17, 2011, 5:37:11 PM4/17/11
to ucsb-computer-scien...@googlegroups.com
Sorry for the confusion here.  The convergence test for CG is usually to stop when the residual r = b-Ax is small compared to b, the right-hand side.  That's measured by the "relative residual", which is norm(r)/norm(b).  As Rachel says, norm(b) doesn't change during the CG iteration.  We probably should have made the harness code print norm(r)/norm(b).

Thanks,

- John
Reply all
Reply to author
Forward
0 new messages