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
RevLine 
[19102]1Index: ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp
2===================================================================
3--- ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp (revision 18867)
4+++ ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp (revision 18868)
5@@ -94,13 +94,17 @@
6 _printf0_("\n");
7 _printf0_("Cost function f(x) | Gradient norm |g(x)| | List of contributions\n");
8 _printf0_("____________________________________________________________________\n");
9- indic = 0; //no adjoint required
10+
11+ /*Initialize Gradient and cost function of M1QN3*/
12+ indic = 4; //adjoint and gradient required
13 simul(&indic,&n,X,&f,G,izs,rzs,(void*)femmodel);
14- double f1=f;
15
16- indic = 4; //adjoint and gradient required
17+ /*Estimation of the expected decrease in f during the first iteration*/
18+ double df1=f;
19+
20+ /*Call M1QN3 solver*/
21 m1qn3_(costfuncion,prosca,&ctonbe_,&ctcabe_,
22- &n,X,&f,G,&dxmin,&f1,
23+ &n,X,&f,G,&dxmin,&df1,
24 &gttol,normtype,&impres,&io,imode,&omode,&niter,&nsim,iz,dz,&ndz,
25 &reverse,&indic,izs,rzs,(void*)femmodel);
26
27@@ -196,7 +200,7 @@
28 femmodel->CostFunctionx(pf,&Jlist,NULL);
29 _printf0_("f(x) = "<<setw(12)<<setprecision(7)<<*pf<<" | ");
30
31- if(indic==0){
32+ if(*indic==0){
33 /*dry run, no gradient required*/
34
35 /*Retrieve objective functions independently*/
Note: See TracBrowser for help on using the repository browser.