Changeset 18868


Ignore:
Timestamp:
11/26/14 11:56:38 (10 years ago)
Author:
Mathieu Morlighem
Message:

CHG: fixed cores/controlm1qn3_core.cpp, simul is a pointer and m1qn3 needs an initial gradient

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/cores/controlm1qn3_core.cpp

    r18856 r18868  
    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;
    100 
    101         indic = 4; //adjoint and gradient required
     101
     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);
     
    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
Note: See TracChangeset for help on using the changeset viewer.