summaryrefslogtreecommitdiff
path: root/sci_gateway/cpp/sci_ipoptfminbnd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sci_gateway/cpp/sci_ipoptfminbnd.cpp')
-rw-r--r--sci_gateway/cpp/sci_ipoptfminbnd.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/sci_gateway/cpp/sci_ipoptfminbnd.cpp b/sci_gateway/cpp/sci_ipoptfminbnd.cpp
index aa5addf..b06c741 100644
--- a/sci_gateway/cpp/sci_ipoptfminbnd.cpp
+++ b/sci_gateway/cpp/sci_ipoptfminbnd.cpp
@@ -49,9 +49,9 @@ int sci_solveminbndp(char *fname)
int x1_rows, x1_cols, x2_rows, x2_cols;
// Output arguments
- double *fX = NULL, ObjVal=0,iteration=0,cpuTime=0,fobj_eval=0;
- double *fZl=NULL;
- double *fZu=NULL;
+ double ObjVal=0,iteration=0,cpuTime=0,fobj_eval=0;
+ const double *fX = NULL,*fZl=NULL;
+ const double *fZu=NULL;
double dual_inf, constr_viol, complementarity, kkt_error;
int rstatus = 0;
int int_fobj_eval, int_constr_eval, int_fobj_grad_eval, int_constr_jac_eval, int_hess_eval;
@@ -110,7 +110,6 @@ int sci_solveminbndp(char *fname)
SmartPtr<minbndNLP> Prob = new minbndNLP(nVars,nCons,varLB,varUB);
SmartPtr<IpoptApplication> app = IpoptApplicationFactory();
- app->RethrowNonIpoptException(true);
////////// Managing the parameters //////////
@@ -126,7 +125,7 @@ int sci_solveminbndp(char *fname)
return (int) status;
}
// Ask Ipopt to solve the problem
- status = app->OptimizeTNLP(Prob);
+ status = app->OptimizeTNLP((SmartPtr<TNLP>&)Prob);
//Get the solve statistics
cpuTime = app->Statistics()->TotalCPUTime();
@@ -139,7 +138,7 @@ int sci_solveminbndp(char *fname)
fX = Prob->getX();
ObjVal = Prob->getObjVal();
- iteration = Prob->iterCount();
+ iteration = (double)app->Statistics()->IterationCount();
fobj_eval=(double)int_fobj_eval;
fZl = Prob->getZl();
fZu = Prob->getZu();