17.11.2012 Views

Numerical recipes

Numerical recipes

Numerical recipes

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

88 Chapter 2. Solution of Linear Algebraic Equations<br />

}<br />

else if (itol == 3 || itol == 4) {<br />

zm1nrm=znrm;<br />

znrm=snrm(n,z,itol);<br />

if (fabs(zm1nrm-znrm) > EPS*znrm) {<br />

dxnrm=fabs(ak)*snrm(n,p,itol);<br />

*err=znrm/fabs(zm1nrm-znrm)*dxnrm;<br />

} else {<br />

*err=znrm/bnrm; Error may not be accurate, so loop again.<br />

continue;<br />

}<br />

xnrm=snrm(n,x,itol);<br />

if (*err

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!