| 1 |
<!DOCTYPE html> |
| 2 |
<html><head> |
| 3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
| 4 |
<title>highlight.cgis</title> |
| 5 |
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (CGiS) - Theme (Breeze Light)"/> |
| 6 |
</head><body style="background-color:#ffffff;color:#1f1c1b"><pre> |
| 7 |
<span style="font-weight:bold;">PROGRAM</span> testtest; |
| 8 |
|
| 9 |
|
| 10 |
<span style="font-weight:bold;">INTERFACE</span> |
| 11 |
|
| 12 |
<span style="font-weight:bold;">extern</span> <span style="font-weight:bold;">inout</span> <span style="color:#0057ae;">int</span> inputs_int[]; |
| 13 |
<span style="font-weight:bold;">extern</span> <span style="font-weight:bold;">out</span> <span style="color:#0057ae;">int</span> nur_out[]; |
| 14 |
<span style="font-weight:bold;">extern</span> <span style="font-weight:bold;">in</span> <span style="color:#0057ae;">int</span> nur_in[]; |
| 15 |
|
| 16 |
<span style="font-weight:bold;">CODE</span> |
| 17 |
|
| 18 |
<span style="font-weight:bold;">function</span> jetzt_mach_schon(<span style="font-weight:bold;">in</span> <span style="color:#0057ae;">int</span> grenze, <span style="font-weight:bold;">out</span> <span style="color:#0057ae;">int</span> fak)<span style="color:#ca60ca;">{</span> |
| 19 |
<span style="color:#0057ae;">int</span> temp, counter; |
| 20 |
counter=grenze; |
| 21 |
temp=<span style="color:#b08000;">1</span>; |
| 22 |
<span style="font-weight:bold;">while</span>(counter><span style="color:#b08000;">1</span>) |
| 23 |
temp*=(counter--); |
| 24 |
fak=temp; |
| 25 |
<span style="color:#ca60ca;">}</span> |
| 26 |
|
| 27 |
<span style="font-weight:bold;">function</span> mach_mal(<span style="font-weight:bold;">inout</span> <span style="color:#0057ae;">int</span> i)<span style="color:#ca60ca;">{</span> |
| 28 |
<span style="font-weight:bold;">if</span>(i==<span style="color:#b08000;">3</span>) i=<span style="color:#b08000;">6</span>; |
| 29 |
<span style="font-weight:bold;">else</span> <span style="font-weight:bold;">if</span>(i==<span style="color:#b08000;">4</span>) i=<span style="color:#b08000;">24</span>; |
| 30 |
<span style="font-weight:bold;">else</span> <span style="font-weight:bold;">if</span>(i>=<span style="color:#b08000;">5</span>) jetzt_mach_schon(i,i); |
| 31 |
<span style="color:#898887;">// 1 und 2: gleich.</span> |
| 32 |
<span style="color:#ca60ca;">}</span> |
| 33 |
|
| 34 |
<span style="font-weight:bold;">function</span> mach_nochmal(<span style="font-weight:bold;">in</span> <span style="color:#0057ae;">int</span> k1, <span style="font-weight:bold;">out</span> <span style="color:#0057ae;">int</span> k2, <span style="font-weight:bold;">in</span> <span style="color:#0057ae;">int</span> vektor)<span style="color:#ca60ca;">{</span> |
| 35 |
<span style="color:#0057ae;">int4</span> hossa; |
| 36 |
hossa=k1; |
| 37 |
<span style="color:#0057ae;">int4</span> hasso; |
| 38 |
hasso=-vektor; |
| 39 |
|
| 40 |
k2=(hasso|hossa>k1)?k1:-k1; <span style="color:#898887;">//parse error before `|'</span> |
| 41 |
<span style="color:#898887;">// k2=(hasso||hossa>k1)?k1:-k1; //only works on expressions of equal dimension</span> |
| 42 |
|
| 43 |
<span style="color:#ca60ca;">}</span> |
| 44 |
|
| 45 |
<span style="font-weight:bold;">CONTROL</span> |
| 46 |
<span style="font-weight:bold;">forall</span> (<span style="color:#0057ae;">int</span> i <span style="font-weight:bold;">in</span> inputs_int:<span style="font-weight:bold;">1D</span>) <span style="font-weight:bold;">do</span> <span style="color:#ca60ca;">{</span> |
| 47 |
mach_mal(i); |
| 48 |
<span style="color:#ca60ca;">}</span> |
| 49 |
<span style="font-weight:bold;">forall</span> (<span style="color:#0057ae;">int</span> j <span style="font-weight:bold;">in</span> inputs_int:<span style="font-weight:bold;">1D</span>; |
| 50 |
<span style="color:#0057ae;">int</span> i <span style="font-weight:bold;">in</span> nur_out:<span style="font-weight:bold;">1D</span>; |
| 51 |
<span style="color:#0057ae;">int</span> vektor <span style="font-weight:bold;">in</span> nur_in:<span style="font-weight:bold;">1D</span>) <span style="font-weight:bold;">do</span> <span style="color:#ca60ca;">{</span> |
| 52 |
mach_nochmal(j,i, vektor); |
| 53 |
<span style="color:#ca60ca;">}</span> |
| 54 |
</pre></body></html> |