Difference between revisions of "LinAlgebraPacks"
Jump to navigation
Jump to search
m (Protected "LinAlgebraPacks" ([edit=sysop] (indefinite) [move=sysop] (indefinite))) |
|||
Line 1: | Line 1: | ||
− | |||
=Introduction= | =Introduction= | ||
Line 7: | Line 6: | ||
</pre> | </pre> | ||
− | http://en.wikipedia.org/wiki/System_of_linear_equations | + | From http://en.wikipedia.org/wiki/System_of_linear_equations: |
+ | |||
+ | The following computation shows Gauss-Jordan elimination applied to the matrix above: | ||
+ | :<math>\left[\begin{array}{rrr|r} | ||
+ | 1 & 3 & -2 & 5 \\ | ||
+ | 3 & 5 & 6 & 7 \\ | ||
+ | 2 & 4 & 3 & 8 | ||
+ | \end{array}\right]</math><math>\sim | ||
+ | \left[\begin{array}{rrr|r} | ||
+ | 1 & 3 & -2 & 5 \\ | ||
+ | 0 & -4 & 12 & -8 \\ | ||
+ | 2 & 4 & 3 & 8 | ||
+ | \end{array}\right]</math><math>\sim | ||
+ | \left[\begin{array}{rrr|r} | ||
+ | 1 & 3 & -2 & 5 \\ | ||
+ | 0 & -4 & 12 & -8 \\ | ||
+ | 0 & -2 & 7 & -2 | ||
+ | \end{array}\right]</math><math>\sim | ||
+ | \left[\begin{array}{rrr|r} | ||
+ | 1 & 3 & -2 & 5 \\ | ||
+ | 0 & 1 & -3 & 2 \\ | ||
+ | 0 & -2 & 7 & -2 | ||
+ | \end{array}\right]</math><math>\sim | ||
+ | \left[\begin{array}{rrr|r} | ||
+ | 1 & 3 & -2 & 5 \\ | ||
+ | 0 & 1 & -3 & 2 \\ | ||
+ | 0 & 0 & 1 & 2 | ||
+ | \end{array}\right]</math><math>\sim | ||
+ | \left[\begin{array}{rrr|r} | ||
+ | 1 & 3 & -2 & 5 \\ | ||
+ | 0 & 1 & 0 & 8 \\ | ||
+ | 0 & 0 & 1 & 2 | ||
+ | \end{array}\right]</math><math>\sim | ||
+ | \left[\begin{array}{rrr|r} | ||
+ | 1 & 3 & 0 & 9 \\ | ||
+ | 0 & 1 & 0 & 8 \\ | ||
+ | 0 & 0 & 1 & 2 | ||
+ | \end{array}\right]</math><math>\sim | ||
+ | \left[\begin{array}{rrr|r} | ||
+ | 1 & 0 & 0 & -15 \\ | ||
+ | 0 & 1 & 0 & 8 \\ | ||
+ | 0 & 0 & 1 & 2 | ||
+ | \end{array}\right].</math> | ||
+ | |||
+ | To solve this using LAPACK: | ||
<pre> | <pre> |
Revision as of 15:36, 27 January 2011
Introduction
svn co https://svn.ggy.bris.ac.uk/subversion-open/num-methods1 ./num-methods1
From http://en.wikipedia.org/wiki/System_of_linear_equations:
The following computation shows Gauss-Jordan elimination applied to the matrix above:
- [math]\displaystyle{ \left[\begin{array}{rrr|r} 1 & 3 & -2 & 5 \\ 3 & 5 & 6 & 7 \\ 2 & 4 & 3 & 8 \end{array}\right] }[/math][math]\displaystyle{ \sim \left[\begin{array}{rrr|r} 1 & 3 & -2 & 5 \\ 0 & -4 & 12 & -8 \\ 2 & 4 & 3 & 8 \end{array}\right] }[/math][math]\displaystyle{ \sim \left[\begin{array}{rrr|r} 1 & 3 & -2 & 5 \\ 0 & -4 & 12 & -8 \\ 0 & -2 & 7 & -2 \end{array}\right] }[/math][math]\displaystyle{ \sim \left[\begin{array}{rrr|r} 1 & 3 & -2 & 5 \\ 0 & 1 & -3 & 2 \\ 0 & -2 & 7 & -2 \end{array}\right] }[/math][math]\displaystyle{ \sim \left[\begin{array}{rrr|r} 1 & 3 & -2 & 5 \\ 0 & 1 & -3 & 2 \\ 0 & 0 & 1 & 2 \end{array}\right] }[/math][math]\displaystyle{ \sim \left[\begin{array}{rrr|r} 1 & 3 & -2 & 5 \\ 0 & 1 & 0 & 8 \\ 0 & 0 & 1 & 2 \end{array}\right] }[/math][math]\displaystyle{ \sim \left[\begin{array}{rrr|r} 1 & 3 & 0 & 9 \\ 0 & 1 & 0 & 8 \\ 0 & 0 & 1 & 2 \end{array}\right] }[/math][math]\displaystyle{ \sim \left[\begin{array}{rrr|r} 1 & 0 & 0 & -15 \\ 0 & 1 & 0 & 8 \\ 0 & 0 & 1 & 2 \end{array}\right]. }[/math]
To solve this using LAPACK:
cd num-methods1/examples/example1 make ./dgesv-example.exe