1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
PROCEDURE mtt_sparse( b : glnarray;
n : integer;
VAR x : glnarray;
VAR rsq : real);
{*
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.3 1998/08/15 09:30:05 peterg
## Commented out the cariabel iteration stuff
##
## Revision 1.2 1998/08/15 08:26:30 peterg
## This is variable interations version - now going on to fixed
## iterations
##
|
|
|
|
|
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
PROCEDURE mtt_sparse( b : glnarray;
n,iters : INTEGER;
VAR x : glnarray);
{*
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.4 1998/08/15 09:33:25 peterg
## Deleted the commented out stuff
##
## Revision 1.3 1998/08/15 09:30:05 peterg
## Commented out the cariabel iteration stuff
##
## Revision 1.2 1998/08/15 08:26:30 peterg
## This is variable interations version - now going on to fixed
## iterations
##
|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
TYPE
glnarray = ARRAY [1..n] OF real;
in the main routine. They must also provide two routines,
PROCEDURE asub(x: glnarray; VAR y: glnarray; n: integer);
and
PROCEDURE atsub(x: glnarray; VAR z: glnarray; n: integer);
which calculate A*x and (A transpose)*x *)
LABEL 1,99;
CONST
iters = 500;
VAR
j,iter,irst: integer;
rp,gg,gam,eps2,dgg,bsq,anum,aden: real;
g,h,xi,xj: glnarray;
BEGIN
mtt_asub(x,xi,n);
rp := 0.0;
bsq := 0.0;
FOR j := 1 TO n DO BEGIN
xi[j] := xi[j]-b[j];
END;
mtt_atsub(xi,g,n);
|
<
<
<
|
|
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
TYPE
glnarray = ARRAY [1..n] OF real;
in the main routine. They must also provide two routines,
PROCEDURE asub(x: glnarray; VAR y: glnarray; n: integer);
and
PROCEDURE atsub(x: glnarray; VAR z: glnarray; n: integer);
which calculate A*x and (A transpose)*x *)
VAR
j,iter,irst: integer;
rp,gg,gam,eps2,dgg,bsq,anum,aden: real;
g,h,xi,xj: glnarray;
BEGIN {mtt_sparse}
mtt_asub(x,xi,n);
rp := 0.0;
bsq := 0.0;
FOR j := 1 TO n DO BEGIN
xi[j] := xi[j]-b[j];
END;
mtt_atsub(xi,g,n);
|