12.07.2015 Views

Linear Algebra

Linear Algebra

Linear Algebra

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

70 Chapter One. <strong>Linear</strong> Systemschip, multiplication takes eleven ticks in single precision but fourteen in doubleprecision [Programmer’s Ref.]) and has twice the memory requirements. Soattempting to do all calculations in double precision is just not practical. Andbesides, the above systems can obviously be tweaked to give the same trouble inthe seventeenth digit, so double precision won’t fix all problems. What we needis a strategy to minimize the numerical trouble arising from solving systemson a computer, and some guidance as to how far the reported solutions can betrusted.Mathematicians have made a careful study of how to get the most reliableresults. A basic improvement on the naive code above is to not simply takethe entry in the pivot row, pivot row position for the pivot, but rather to lookat all of the entries in the pivot row column below the pivot row row, and takethe one that is most likely to give reliable results (e.g., take one that is not toosmall). This strategy is partial pivoting. For example, to solve the troublesomesystem (∗) above, we start by looking at both equations for a best first pivot,and taking the 1 in the second equation as more likely to give good results.Then, the pivot step of −.001ρ 2 + ρ 1 gives a first equation of 1.001y = 1, whichthe computer will represent as (1.0×10 0 )y = 1.0×10 0 , leading to the conclusionthat y = 1 and, after back-substitution, x = 1, both of which are close to right.The code from above can be adapted to this purpose.for(pivot_row=1;pivot_row

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

Saved successfully!

Ooh no, something went wrong!