source: issm/oecreview/Archive/18296-19100/ISSM-18867-18868.diff@ 19102

Last change on this file since 19102 was 19102, checked in by Mathieu Morlighem, 10 years ago

NEW: added 18296-19100

File size: 1.3 KB
  • ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp

     
    9494        _printf0_("\n");
    9595        _printf0_("Cost function f(x)   | Gradient norm |g(x)| |  List of contributions\n");
    9696        _printf0_("____________________________________________________________________\n");
    97         indic = 0; //no adjoint required
     97
     98        /*Initialize Gradient and cost function of M1QN3*/
     99        indic = 4; //adjoint and gradient required
    98100        simul(&indic,&n,X,&f,G,izs,rzs,(void*)femmodel);
    99         double f1=f;
    100101
    101         indic = 4; //adjoint and gradient required
     102        /*Estimation of the expected decrease in f during the first iteration*/
     103        double df1=f;
     104
     105        /*Call M1QN3 solver*/
    102106        m1qn3_(costfuncion,prosca,&ctonbe_,&ctcabe_,
    103                                 &n,X,&f,G,&dxmin,&f1,
     107                                &n,X,&f,G,&dxmin,&df1,
    104108                                &gttol,normtype,&impres,&io,imode,&omode,&niter,&nsim,iz,dz,&ndz,
    105109                                &reverse,&indic,izs,rzs,(void*)femmodel);
    106110
     
    196200        femmodel->CostFunctionx(pf,&Jlist,NULL);
    197201        _printf0_("f(x) = "<<setw(12)<<setprecision(7)<<*pf<<"  |  ");
    198202
    199         if(indic==0){
     203        if(*indic==0){
    200204                /*dry run, no gradient required*/
    201205
    202206                /*Retrieve objective functions independently*/
Note: See TracBrowser for help on using the repository browser.