summaryrefslogtreecommitdiff
path: root/sci_gateway/cpp/sci_minconNLP.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sci_gateway/cpp/sci_minconNLP.cpp')
-rw-r--r--sci_gateway/cpp/sci_minconNLP.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/sci_gateway/cpp/sci_minconNLP.cpp b/sci_gateway/cpp/sci_minconNLP.cpp
index 845e983..71e6b53 100644
--- a/sci_gateway/cpp/sci_minconNLP.cpp
+++ b/sci_gateway/cpp/sci_minconNLP.cpp
@@ -11,7 +11,6 @@
#include "minconNLP.hpp"
-#include "IpIpoptData.hpp"
#include "sci_iofunc.hpp"
extern "C"
@@ -24,7 +23,6 @@ extern "C"
#include <sciprint.h>
#include <string.h>
#include <assert.h>
-#include <iostream>
using namespace std;
using namespace Ipopt;
@@ -138,7 +136,7 @@ bool minconNLP::eval_f(Index n, const Number* x, bool new_x, Number& obj_value)
}
char name[18]="f";
double obj=0;
- double *xNew=x;
+ const Number *xNew=x;
double check;
createMatrixOfDouble(pvApiCtx, 14, 1, numVars_, xNew);
int positionFirstElementOnStackForScilabFunction = 14;
@@ -182,7 +180,7 @@ bool minconNLP::eval_grad_f(Index n, const Number* x, bool new_x, Number* grad_f
{
return 1;
}
- double *xNew=x;
+ const Number *xNew=x;
createMatrixOfDouble(pvApiCtx, 14, 1, numVars_, xNew);
int positionFirstElementOnStackForScilabFunction = 14;
int numberOfRhsOnScilabFunction = 1;
@@ -247,7 +245,7 @@ bool minconNLP::eval_g(Index n, const Number* x, bool new_x, Index m, Number* g)
return 1;
}
- double *xNew=x;
+ const Number *xNew=x;
double check;
createMatrixOfDouble(pvApiCtx, 14, 1, numVars_, xNew);
int positionFirstElementOnStackForScilabFunction = 14;
@@ -352,7 +350,7 @@ bool minconNLP::eval_jac_g(Index n, const Number* x, bool new_x,Index m, Index n
return 1;
}
- double *xNew=x;
+ const Number *xNew=x;
createMatrixOfDouble(pvApiCtx, 14, 1, numVars_, xNew);
int positionFirstElementOnStackForScilabFunction = 14;
int numberOfRhsOnScilabFunction = 1;
@@ -448,8 +446,8 @@ bool minconNLP::eval_h(Index n, const Number* x, bool new_x,Number obj_factor, I
{
return 1;
}
- double *xNew=x;
- double *lambdaNew=lambda;
+ const Number *xNew=x;
+ const Number *lambdaNew=lambda;
double objfac=obj_factor;
createMatrixOfDouble(pvApiCtx, 14, 1, numVars_, xNew);
createScalarDouble(pvApiCtx, 15,objfac);
@@ -543,7 +541,6 @@ void minconNLP::finalize_solution(SolverReturn status,Index n, const Number* x,
finalObjVal_ = obj_value;
status_ = status;
- iter_ = ip_data->iter_count();
}
@@ -582,11 +579,6 @@ double minconNLP::getObjVal()
return finalObjVal_;
}
-double minconNLP::iterCount()
-{
- return (double)iter_;
-}
-
int minconNLP::returnStatus()
{
return status_;