Changeset 0776f70 in tol


Ignore:
Timestamp:
Oct 6, 2009, 5:12:08 PM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
4a044ad
Parents:
f3e971a
Message:

Fixed #754

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/bmath/blinalg/linalg.cpp

    rf3e971a r0776f70  
    217217//--------------------------------------------------------------------
    218218{
     219  double tolerance = chop*chop;
    219220  BInt k, rows=A_.Rows(), cols=A_.Columns();
    220221  /* PRECONDITIONS: ENSURING DIMENSIONS */
    … …  
    275276    relAdv = advance/oldR;
    276277#ifdef TRZ_MinimumResidualsSolve
    277     Std(pr+" Iteration "+k+
    278               "\tAbsMaxNorm : "+maxpa.Format("%lg")+
    279               "\tResNorm : "+BDat(R).Format("%lg"));
     278    if(k && !(k%cols))
     279    {
     280      Std(pr+" Iteration "+k+
     281                "\tAbsMaxNorm : "+maxpa.Format("%lg")+
     282                "\tResNorm : "+BDat(R).Format("%lg"));
     283      Std(BText(" - ")+
     284          BDat(oldR        ).Format("%lg"   )+" = "+
     285            BDat(advance           ).Format("%lg"   )+" ("+
     286            BDat(xNormAdvance).Format("%lg"   )+" ,"+
     287            BDat(100*relAdv  ).Format("%8.4lf")+"%)");
     288   }
    280289#endif
    281     if(k)
    282     {
    283 #ifdef TRZ_MinimumResidualsSolve
    284       Std(BText(" - ")+
    285           BDat(oldR        ).Format("%lg"   )+" = "+
    286           BDat(advance     ).Format("%lg"   )+" ("+
    287           BDat(xNormAdvance).Format("%lg"   )+" ,"+
    288           BDat(100*relAdv  ).Format("%8.4lf")+"%)");
    289 #endif
    290       if(S.IsUnknown()               ) { break; }
    291       if(maxpa.IsUnknown()           ) { break; }
    292       if(advance             >   0   ) { break; }
    293       if(S                   <= chop ) { break; }
    294 /*
    295       if(maxpa               <= chop ) { break; }
    296       if(fabs(advance)       <= chop ) { break; }
    297       if(fabs(relAdv)        <= chop ) { break; }
    298       if(fabs(R)             <= chop ) { break; }
    299       if(oldMaxpa            <= tol  ) { break; }
    300       if(maxpa               <= tol  ) { break; }
    301       if(fabs(advance)       <= tol  ) { break; }
    302       if(xNormAdvance.Abs()  <= tol  ) { break; }
    303 */
    304     }
    305     r -= q*a;
    306     s  = At*r;
    307     oldS = S;
    308     S  = MtMSqr(s)(0,0);
    309     b  = S.Value()/oldS.Value();
    310     p*=b; p+=s;
     290    if(S.IsUnknown()                    ) { break; }
     291    if(maxpa.IsUnknown()                ) { break; }
     292    if(advance             >=  0        ) { break; }
     293    if(S                   <= tolerance ) { break; }
     294    if(1+maxpa-1           == 0         ) { break; }
     295  }
     296  r -= q*a;
     297  s  = At*r;
     298  oldS = S;
     299  S  = MtMSqr(s)(0,0);
     300  b  = S.Value()/oldS.Value();
     301  p*=b; p+=s;
    311302
    312303//  Std(BText("\cols")+k+"\t"+S);
    313   }
    314304/*
    315305  Std(pr+" Iteration "+k+
Note: See TracChangeset for help on using the changeset viewer.