Changeset 627cedd in tol


Ignore:
Timestamp:
Sep 11, 2009, 2:54:07 PM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
af55571
Parents:
da6cdaa
Message:

New _.verbose member

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@1365 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tol/stdlib/math/linalg
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tol/stdlib/math/linalg/_solve_precond_sym.tol

    rda6cdaa r627cedd  
    4343  Real _.do.normalize = do.normalize;
    4444  Real _.m = VRows(_.M);
    45 
     45  Real _.verbose = False;
    4646  //Returns a diagonal normalizer VMatrix for a symmetric VMatrix
    4747  VMatrix Normalizer(VMatrix M)
    … …  
    8585    Text _MID = "[SolvePrecondSym()::ScaleEval()] ";
    8686    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);
    9088    Real ok = VRows(_.Lc)==_.m;
    91     WriteLn(_MID+"("<<c+") = "<<ok);
     89    If( _.verbose, WriteLn(_MID+"("<<c+") = "<<ok));
    9290    ok
    9391  };
    … …  
    152150      Real ok.1 = VRows(_.x)==_.m;
    153151      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")));
    157156      And(ok.1,ok.2)
    158157    }
  • tol/stdlib/math/linalg/_solve_precond_unsym.tol

    rda6cdaa r627cedd  
    3434NameBlock SolvePrecondUnsym(VMatrix M, Real do.normalize)
    3535{[[
     36  Real _.verbose = False;
    3637  //Original s  //Original symmetric system to be solved M*x = y
    3738  VMatrix _.M = M;
    … …  
    7576    VMatrix Dc = Eye(_.n,_.n,0,c);
    7677    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);
    8079    Real ok = VRows(Lc)==_.n;
    8180    Real If(ok,
    … …  
    8584      1
    8685    });
    87     WriteLn(_MID+"("<<c+") = "<<ok);
     86    If(_.verbose, WriteLn(_MID+"("<<c+") = "<<ok));
    8887    ok
    8988  };
    … …  
    165164        Real ok.1 = VRows(_.x)==_.n;
    166165        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")));
    170170        And(ok.1,ok.2)
    171171      }
Note: See TracChangeset for help on using the changeset viewer.