Changeset 627cedd in tol
- Timestamp:
- Sep 11, 2009, 2:54:07 PM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- af55571
- Parents:
- da6cdaa
- Location:
- tol/stdlib/math/linalg
- Files:
-
- 2 edited
-
_solve_precond_sym.tol (modified) (3 diffs)
-
_solve_precond_unsym.tol (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/stdlib/math/linalg/_solve_precond_sym.tol
rda6cdaa r627cedd 43 43 Real _.do.normalize = do.normalize; 44 44 Real _.m = VRows(_.M); 45 45 Real _.verbose = False; 46 46 //Returns a diagonal normalizer VMatrix for a symmetric VMatrix 47 47 VMatrix Normalizer(VMatrix M) … … 85 85 Text _MID = "[SolvePrecondSym()::ScaleEval()] "; 86 86 VMatrix _.Sc := _.S + VMatrix Eye(_.m,_.m,0,c); 87 Real old = Show(0,"ALL"); 88 VMatrix _.Lc := CholeskiFactor(_.Sc,"X"); 89 Real Show(old,"ALL"); 87 VMatrix _.Lc := CholeskiFactor(_.Sc,"X",FALSE,FALSE); 90 88 Real ok = VRows(_.Lc)==_.m; 91 WriteLn(_MID+"("<<c+") = "<<ok);89 If( _.verbose, WriteLn(_MID+"("<<c+") = "<<ok)); 92 90 ok 93 91 }; … … 152 150 Real ok.1 = VRows(_.x)==_.m; 153 151 Real ok.2 = _.maxErr <= _.tol.solver; 154 If(!ok.1,WriteLn(_MID+"Wrong dimensions" ,"W")); 155 If(!ok.2,WriteLn(_MID+"Solution has maximum absolute error "<<_.maxErr+ 156 " great than specified tolerance "<<_.tol.solver,"W")); 152 If( _.verbose, If(!ok.1,WriteLn(_MID+"Wrong dimensions" ,"W"))); 153 If( _.verbose, If(!ok.2,WriteLn(_MID+"Solution has maximum " 154 "absolute error "<<_.maxErr+ 155 " great than specified tolerance "<<_.tol.solver,"W"))); 157 156 And(ok.1,ok.2) 158 157 } -
tol/stdlib/math/linalg/_solve_precond_unsym.tol
rda6cdaa r627cedd 34 34 NameBlock SolvePrecondUnsym(VMatrix M, Real do.normalize) 35 35 {[[ 36 Real _.verbose = False; 36 37 //Original s //Original symmetric system to be solved M*x = y 37 38 VMatrix _.M = M; … … 75 76 VMatrix Dc = Eye(_.n,_.n,0,c); 76 77 VMatrix Hc = _.H << Dc; 77 Real old = Show(0,"ALL"); 78 VMatrix Lc = CholeskiFactor(Hc,"XtX"); 79 Real Show(old,"ALL"); 78 VMatrix Lc = CholeskiFactor(Hc,"XtX",FALSE,FALSE); 80 79 Real ok = VRows(Lc)==_.n; 81 80 Real If(ok, … … 85 84 1 86 85 }); 87 WriteLn(_MID+"("<<c+") = "<<ok);86 If(_.verbose, WriteLn(_MID+"("<<c+") = "<<ok)); 88 87 ok 89 88 }; … … 165 164 Real ok.1 = VRows(_.x)==_.n; 166 165 Real ok.2 = _.maxErr <= _.tol.solver; 167 If(!ok.1,WriteLn(_MID+"Wrong dimensions" ,"W")); 168 If(!ok.2,WriteLn(_MID+"Solution has maximum absolute error "<<_.maxErr+ 169 " great than specified tolerance "<<_.tol.solver,"W")); 166 If(_.verbose, If(!ok.1,WriteLn(_MID+"Wrong dimensions" ,"W"))); 167 If(_.verbose, If(!ok.2,WriteLn(_MID+"Solution has maximum " 168 "absolute error "<<_.maxErr+ 169 " great than specified tolerance "<<_.tol.solver,"W"))); 170 170 And(ok.1,ok.2) 171 171 }
Note: See TracChangeset
for help on using the changeset viewer.
