Changeset 17897


Ignore:
Timestamp:
04/30/14 14:41:58 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: minor

File:
1 edited

Legend:

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

    r17896 r17897  
    4848        long      indic        = 4;         /*compute f and g*/
    4949        long      reverse      = 0;         /*reverse or direct mode*/
    50         long      ndz          = 20000;     /*Dimension of the working area*/
    51         double    dz[20000];                /*Working array*/
    5250        long      iz[5];                    /*Integer m1qn3 working array of size 5*/
    53         long      niter        = 200;       /*Maximum number of iterations*/
    54         long      nsim         = 200;       /*Maximum number of function calls*/
    5551        long      io           = 6;         /*Channel number for the output*/
    5652
     
    5854        double    dxmin        = 1.e-10;    /*Resolution for the solution x*/
    5955        double    epsrel       = 1.e-5;     /*Gradient stopping criterion in ]0 1[ -> |gk|/|g1| < epsrel*/
     56        long      niter        = 200;       /*Maximum number of iterations*/
     57        long      nsim         = 200;       /*Maximum number of function calls*/
    6058
    6159        /*Get problem dimension and initialize gradient and initial guess*/
     
    6563        for(int i=0;i<n;i++) x[i]=5.;
    6664        dzs[0] = 10; //c = 10 function parameter
     65
     66        /*Allocate m1qn3 working arrays (see doc)*/
     67        long      m   = 100;
     68        long      ndz = 4*n+m*(2*n+1);
     69        double*   dz  = xNew<double>(ndz);
    6770
    6871        if(VerboseControl())_printf0_("   Computing initial solution\n");
     
    7679
    7780        switch(int(omode)){
    78                 case 0:  _printf0_("Stop requiered \n"); break;
    79                 case 1:  _printf0_("Stop on epsg (gradient too small)\n"); break;
    80                 case 2:  _printf0_("Bad initialization\n"); break;
    81                 case 3:  _printf0_("Line search failure\n"); break;
    82                 case 4:  _printf0_("Maximum number of iterations exceeded\n");break;
    83                 case 5:  _printf0_("Maximum number of function calls exceeded\n"); break;
    84                 case 6:  _printf0_("stoped on dxmin during line search\n"); break;
    85                 case 7:  _printf0_("<g,d> > 0  or  <y,s> <0\n"); break;
    86                 default: _printf0_("Unknown end condition\n");
     81                case 0:  _printf0_("   Stop requested (indic = 0)\n"); break;
     82                case 1:  _printf0_("   Convergence reached (gradient satisfies stopping criterion)\n"); break;
     83                case 2:  _printf0_("   Bad initialization\n"); break;
     84                case 3:  _printf0_("   Line search failure\n"); break;
     85                case 4:  _printf0_("   Maximum number of iterations exceeded\n");break;
     86                case 5:  _printf0_("   Maximum number of function calls exceeded\n"); break;
     87                case 6:  _printf0_("   stopped on dxmin during line search\n"); break;
     88                case 7:  _printf0_("   <g,d> > 0  or  <y,s> <0\n"); break;
     89                default: _printf0_("   Unknown end condition\n");
    8790        }
    8891
     
    9396        xDelete<double>(g);
    9497        xDelete<double>(x);
     98        xDelete<double>(dz);
    9599}
    96100#else
Note: See TracChangeset for help on using the changeset viewer.