Overview
Comment:iters now passed as an argument.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 049b8fa9a9a547ad1baba870bc781e96476d9c310eaf0c75d6598d2d80b19570
User & Date: gawthrop@users.sourceforge.net on 1998-08-15 13:49:19
Other Links: branch diff | manifest | tags
Context
1998-08-15
13:50:22
Doesn't zap preexisting files check-in: 6b678e47f4 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
13:49:19
iters now passed as an argument. check-in: 049b8fa9a9 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
13:48:35
New update methods check-in: 6f4b578e7c user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/p/mtt_sparse.p from [4534575ce1] to [e017e9cc15].

1
2
3
4




5
6
7
8
9
10



11
12
13
14
15
16
17




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   : integer;
		     VAR x   : glnarray;
		     VAR rsq : real);
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
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
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);
79
80
81
82
83
84
85
86

79
80
81
82
83
84
85

86







-
+
      END;
      gam := dgg/gg;
      FOR j := 1 TO n DO BEGIN
         g[j] := -xi[j];
         h[j] := g[j]+gam*h[j]
      END
   END;
END;
END {mtt_sparse};


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]