1 MAIN PART Gauss.
  !
  ! -
  !
2 BEGIN
3 INDEX k,l.
4 ks : (k=1..n).
5 ls : (l=1..n).
6 kls : (ks; ls).
7 VARIABLE a DEFINED ON kls.
8 VARIABLE b, x DEFINED ON ks.
9 INPUT a(FILE='gauss') ON kls,
10 b(FILE='gauss') ON ks.
11 DOMAIN PARAMETERS n=4.
12 COMPUTE Calculate(a ON kls, b ON ks RESULT x ON ks).
13 OUTPUT x(FILE='gauss.out',TAB(10),' :',STR(1)) ON ks.
14 END PART.
   
15 PART Calculate.
16 a,b RESULT x
  !
17 BEGIN
18 INDEX i,j
19 so : (ijs: (is: (i=1..n); js: (j=1..n));ts: (t=0..n)).
20 s1o:(ts;is). s:so/ts-LEFT(1). s1:s1o/t=1..n.
21 VARIABLE a DEFINED ON ijs.
22 VARIABLE b, x DEFINED ON is.
23 VARIABLE m DEFINED ON so.
24 VARIABLE r DEFINED ON s1o.
25 DOMAIN PARAMETERS n=4.
26 DISTRIBUTION INDEX i=2..8, j=1.
27 FOR so/t=0 ASSUME m=a.
28 FOR s1o/t=0 ASSUME r=b.
29 sa,sb:s/i=t. sa1,sb1:s1/i=t.
30 MACRO INDEX ti [t-1,i=t].
31 MACRO INDEX tij [ti,j=t].
32 FOR sa ASSUME m = m[ti] / m[tij].
33 FOR sa1 ASSUME r = r[ti] / m[tij].
34 FOR sb ASSUME m = m[t-1] - m[t-1,j=t] * m[i=t].
35 FOR sb1 ASSUME r = r[t-1] - m[t-1,j=t] * r[i=t].
36 FOR is ASSUME x = r[t=n].
37 END PART.

 

( ).

(1) Gauss.

(2) .

(3) .

(4-6) is, js ijs, .

(7-8) a, b x. a - , b - , - .

(9-10) gauss.dat, :

a(k=1..4,l=1..4)= 1.1161, 0.1254, 0.1397, 0.1490,
0.1582, 1.1675, 0.1768, 0.1871,
0.1968, 0.2071, 1.2168, 0.2271,
0.2368, 0.2471, 0.2568, 1.2671;
b(k=1..4)= 1.5471, 1.6471, 1.7471, 1.8471;

(11) ( ).

(12) Calculate, .

(13) gauss.out.

(14) .

(15) Calculate.

(16) (a, b) (x) .

(17) .

(18) .

(19) so, ts ijs. ijs is js.

(20) s1o s, s1 .

(21-22) , .

(23-24) m r, .

(25) .

(26) .

(27-28) m r.

(29) sa, sb, sa1, sb1.

(30-31) .

(32-36) .

(37) .