Overview
Comment:Now packages up mtt_solve_lud OR mtt_solve_svd
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 1c85e9979639a14463054a36709c810ce8f65e67134e8d0460747f88e30c9fc2
User & Date: gawthrop@users.sourceforge.net on 1999-10-26 23:44:36
Other Links: branch diff | manifest | tags
Context
1999-10-26
23:45:30
Now calls mtt_solve instead of mtt_lud
(mtt_lud is now called by mtt_solve)
check-in: bb3161228e user: gawthrop@users.sourceforge.net tags: origin/master, trunk
23:44:36
Now packages up mtt_solve_lud OR mtt_solve_svd check-in: 1c85e99796 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
23:40:37
Put small as a constant - now has same arg list as mtt_solve_lud check-in: 126fc22ab7 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/p/mtt_solve.p from [ce9463201c] to [054ffa4011].

1
2
3
4

5
6
7
8
9
10
11
12
13



14
15
16
17
18
19
20
21
22
23
24
25
26
27


28
29
30
31
32

33
34
35
36
37
38

39
40
41
42
43
44
45
46
47
48
49
50
1
2
3

4

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27


28
29
30
31



32






33











34



-
+
-








+
+
+












-
-
+
+


-
-
-
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-

PROCEDURE mtt_solve(VAR x     : StateVector;
			A     : StateMatrix;
		    VAR B     : StateVector;
			n     : integer;
			n     : integer);
			Small : real);

{

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % $Id$
% % $Log$
% % Revision 1.2  1998/08/14 12:09:13  peterg
% % A passed by value - its destroyed by SVDcm
% %
% % Revision 1.1  1998/08/13 08:51:57  peterg
% % Initial revision
% %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 }

VAR
   i	     : integer;
   wmax,wmin : real;
   w	     : StateVector ;
   v	     : StateMatrix;

(*$I svdcmp.p *)
(*$I svbksb.p *)
(*$I mtt_solve_lud.p *)
(* I mtt_solve_svd.p *)

BEGIN{mtt_solve}
(* decompose matrix A using SVD *)
   svdcmp(A,n,n,w,v);
   
      mtt_solve_lud(xsub,AAsub,BB,Nx);
(* find maximum singular value *)
   wmax := 0.0;
   FOR i := 1 to n DO BEGIN
      IF  (w[i] > wmax) THEN  wmax := w[i]
   END;
   
      (*** mtt_solve_svd(xsub,AAsub,BB,Nx); ***)
(* define "small" *)
   wmin := wmax*Small;
   
(* zero the "small" singular values *)
   FOR i := 1 to n DO BEGIN
      IF  (w[i] < wmin) THEN  w[i] := 0.0
   END;
   
(* backsubstitute for B *)
      svbksb(A,w,v,n,n,B,x);
   
END{mtt_solve};


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