28.12.2012 Views

Figure Properties - SERC

Figure Properties - SERC

Figure Properties - SERC

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

inv<br />

2-1214<br />

while the statements<br />

tic, z = A\b, toc<br />

err = norm(z-x)<br />

res = norm(A*z-b)<br />

produce<br />

elapsed_time =<br />

0.6410<br />

err =<br />

7.1209e-006<br />

res =<br />

4.4509e-015<br />

It takes almost two and one half times as long to compute the solution with<br />

y = inv(A)*b as with z = A\b. Both produce computed solutions with about<br />

the same error, 1.e-6, reflecting the condition number of the matrix. But the<br />

size of the residuals, obtained by plugging the computed solution back into the<br />

original equations, differs by several orders of magnitude. The direct solution<br />

produces residuals on the order of the machine accuracy, even though the<br />

system is badly conditioned.<br />

The behavior of this example is typical. Using A\b instead of inv(A)*b is two<br />

to three times as fast and produces residuals on the order of machine accuracy,<br />

relative to the magnitude of the data.<br />

Algorithm Inputs of Type Double<br />

For inputs of type double, inv uses the following LAPACK routines to compute<br />

the matrix inverse:<br />

Matrix Routine<br />

Real DLANGE, DGETRF, DGECON, DGETRI<br />

Complex ZLANGE, ZGETRF, ZGECON, ZGETRI

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

Saved successfully!

Ooh no, something went wrong!