Changeset 393


Ignore:
Timestamp:
05/13/09 14:46:33 (16 years ago)
Author:
Mathieu Morlighem
Message:

minor (choose always the best value)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/shared/Numerics/BrentSearch.cpp

    r84 r393  
    2929
    3030        /*function values: */
    31         double fxmax,fxmin,fxbest,fval;
     31        double fxmax,fxmin,fxbest;
    3232        double fx,fx1,fx2;
    3333
    3434        /*x : */
    3535        double xmax,xmin,xbest;
    36         double x,x1,x2,xm,xval;
     36        double x,x1,x2,xm;
    3737
    3838        /*tolerances: */
     
    233233        //Now, check that the value on the boundaries are not better than current fxbest
    234234        if (fxbest>fxmin){
    235                 xval=xmin;
    236                 fval=fxmin;
     235                xbest=xmin;
     236                fxbest=fxmin;
    237237        }
    238         else if (fxbest>fxmax){
    239                 xval=xmax;
    240                 fval=fxmax;
     238        if (fxbest>fxmax){
     239                xbest=xmax;
     240                fxbest=fxmax;
    241241        }
    242         else{
    243                 xval=xbest;
    244                 fval=fxbest;
    245         }
    246242
    247243        /*Assign output pointers: */
    248         *psearch_scalar=xval;
    249         *pJ=fval;
    250        
     244        *psearch_scalar=xbest;
     245        *pJ=fxbest;
    251246}
Note: See TracChangeset for help on using the changeset viewer.