Changeset 393
- Timestamp:
- 05/13/09 14:46:33 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/shared/Numerics/BrentSearch.cpp
r84 r393 29 29 30 30 /*function values: */ 31 double fxmax,fxmin,fxbest ,fval;31 double fxmax,fxmin,fxbest; 32 32 double fx,fx1,fx2; 33 33 34 34 /*x : */ 35 35 double xmax,xmin,xbest; 36 double x,x1,x2,xm ,xval;36 double x,x1,x2,xm; 37 37 38 38 /*tolerances: */ … … 233 233 //Now, check that the value on the boundaries are not better than current fxbest 234 234 if (fxbest>fxmin){ 235 x val=xmin;236 f val=fxmin;235 xbest=xmin; 236 fxbest=fxmin; 237 237 } 238 elseif (fxbest>fxmax){239 x val=xmax;240 f val=fxmax;238 if (fxbest>fxmax){ 239 xbest=xmax; 240 fxbest=fxmax; 241 241 } 242 else{243 xval=xbest;244 fval=fxbest;245 }246 242 247 243 /*Assign output pointers: */ 248 *psearch_scalar=xval; 249 *pJ=fval; 250 244 *psearch_scalar=xbest; 245 *pJ=fxbest; 251 246 }
Note:
See TracChangeset
for help on using the changeset viewer.