Changeset 477
- Timestamp:
- 05/18/09 15:14:17 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/shared/Numerics/BrentSearch.cpp
r393 r477 64 64 65 65 //initialize the other variables 66 seps=sqrt(DBL_EPSILON); //precision of a double66 seps=sqrt(DBL_EPSILON); //precision of a double 67 67 distance=0.0; //new_x=old_x + distance 68 68 gold=0.5*(3.0-sqrt(5.0)); //gold = 1 - golden ratio … … 115 115 intervalgold=distance; 116 116 117 // Is the parabola acceptable 117 // Is the parabola acceptable (we use seps here because in some configuration parab_num==parab_den*(xmax-xbest) 118 // and the result is not repeatable anymore 118 119 if (( sqrt(pow(parab_num,2)) < sqrt(pow(0.5*parab_den*oldintervalgold,2))) && 119 (parab_num>parab_den*(xmin-xbest) ) &&120 (parab_num<parab_den*(xmax-xbest) )){120 (parab_num>parab_den*(xmin-xbest)+seps) && 121 (parab_num<parab_den*(xmax-xbest)-seps)){ 121 122 122 123 // Yes, parabolic interpolation step
Note:
See TracChangeset
for help on using the changeset viewer.