This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
tutorial_lud [2017/04/19 13:26] waruna [Generating and Testing Alphabets] |
tutorial_lud [2017/04/19 14:09] 127.0.0.1 external edit |
||
---|---|---|---|
Line 28: | Line 28: | ||
Parameters are runtime constants represented with some symbol in the code. In this example, parameter N will be used to define the size of the matrices, which is not known until runtime. | Parameters are runtime constants represented with some symbol in the code. In this example, parameter N will be used to define the size of the matrices, which is not known until runtime. | ||
- | <sxh alphabets; gutter:false> | + | <sxh alphabets; gutter:true> |
affine LUD {N|N>0} | affine LUD {N|N>0} | ||
. | . | ||
Line 36: | Line 36: | ||
In most cases, a computation uses some inputs and produces outputs. Such variables must be declared with a name, a data type, and a shape/ | In most cases, a computation uses some inputs and produces outputs. Such variables must be declared with a name, a data type, and a shape/ | ||
For this example, the '' | For this example, the '' | ||
- | <sxh alphabets; gutter:false> | + | <sxh alphabets; gutter:true> |
float A {i, | float A {i, | ||
</ | </ | ||
Similarly, '' | Similarly, '' | ||
- | <sxh alphabets; gutter:false> | + | <sxh alphabets; gutter:true> |
// The convention is that i is the vertical axis going down, and j is the horizontal axis | // The convention is that i is the vertical axis going down, and j is the horizontal axis | ||
float L {i, | float L {i, | ||
Line 47: | Line 47: | ||
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:false> | + | <sxh alphabets; gutter:true> |
affine LUD {N|N>0} | affine LUD {N|N>0} | ||
input float A {i, | input float A {i, | ||
Line 152: | Line 152: | ||
====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:false> | + | <sxh alphabets; gutter:true> |
affine LUD {N|N>0} | affine LUD {N|N>0} | ||
input | input | ||
Line 229: | Line 229: | ||
====OOPS WHAT HAPPENED==== | ====OOPS WHAT HAPPENED==== | ||
You will see that when you execute the code, **//it will produce an error// | You will see that when you execute the code, **//it will produce an error// | ||
+ |