This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
tutorial_lud [2015/02/27 08:36] guillaume Corrected condition of second domain of L in equation + alpha program |
tutorial_lud [2016/12/12 10:12] waruna Changed the latex notation to support new dokuwiki |
||
---|---|---|---|
Line 2: | Line 2: | ||
The equation for LU Decomposition, | The equation for LU Decomposition, | ||
- | < | + | |
- | $U_{i, | + | /*< |
+ | $$ | ||
+ | | ||
1=i\le j & A_{i,j}\\ | 1=i\le j & A_{i,j}\\ | ||
1<i\le j & A_{i, | 1<i\le j & A_{i, | ||
- | \end{cases} | + | \end{cases}\\ |
L_{i, | L_{i, | ||
- | 1=j\le i & \frac{A_{i, | + | 1 = i\le j & \frac{A_{i, |
- | 1<j\le i & \frac{1}{U_{j, | + | 1< i\le j & \frac{1}{U_{j, |
- | \end{cases}$ | + | \end{cases} |
- | </latex> | + | $$ |
+ | /*<\latex>*/ | ||
+ | |||
+ | |||
+ | [Temp note due to : in the last case of L, the condition is "1 < j <= i"] | ||
=====Writing Alphabets===== | =====Writing Alphabets===== | ||
Line 40: | Line 46: | ||
</ | </ | ||
Now these variable declarations need to be placed at appropriate places to specify whether they are input/ | Now these variable declarations need to be placed at appropriate places to specify whether they are input/ | ||
- | '' | + | '' |
<sxh alphabets; gutter: | <sxh alphabets; gutter: | ||
affine LUD {N|N>0} | affine LUD {N|N>0} | ||
- | given | + | input float A {i, |
- | float A {i, | + | output |
- | returns | + | |
float L {i, | float L {i, | ||
float U {i, | float U {i, | ||
Line 142: | Line 147: | ||
L = case | L = case | ||
| | ||
- | | + | |
esac; | esac; | ||
</ | </ | ||
====Final Alphabets Program==== | ====Final Alphabets Program==== | ||
- | Combine all of the above, and you will get the Alphabets program for LU decomposition. Don't forget the keyword '' | + | Combine all of the above, and you will get the Alphabets program for LU decomposition. Don't forget the keyword |
<sxh alphabets; gutter: | <sxh alphabets; gutter: | ||
affine LUD {N|N>0} | affine LUD {N|N>0} | ||
- | given | + | input |
float A {i, | float A {i, | ||
- | returns | + | output |
float L {i, | float L {i, | ||
float U {i, | float U {i, | ||
- | through | + | let |
| | ||
{|1==i} : A[i,j]; | {|1==i} : A[i,j]; |