Changeset 2187


Ignore:
Timestamp:
09/10/09 14:28:52 (16 years ago)
Author:
Mathieu Morlighem
Message:

Added jump option in CM (waiting for Eric's commit)

File:
1 edited

Legend:

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

    r2108 r2187  
    4848        tolerance=optpars->tolerance;
    4949        maxiter=optpars->maxiter;
     50        cmjump=optpars->cmjump;
    5051       
    5152        //initialize counter and boundaries
     
    6263        fxmax = (*f)(xmax,optargs);
    6364        _printf_("        %s    %12.6g  %12.6g  %s","   N/A",xmax,fxmax,"         N/A         boundary\n");
     65
     66        //test if jump option activated and xmin==0
     67        if (!isnan(cmjump) && (xmin==0)){
     68
     69                //test ration between fxmin and fxmax. if < criterion, return
     70                if((fxmin/fxmax)<cmjump){
     71
     72                        /*Assign output pointers: */
     73                        *psearch_scalar=xmax;
     74                        *pJ=fxmax;
     75                        return;
     76                }
     77        }
    6478
    6579        //initialize the other variables
Note: See TracChangeset for help on using the changeset viewer.