Commit b8806fd3 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke
Browse files

Improved signature of IPOPTSolver::solve.


git-svn-id: http://www.openflipper.org/svnrepo/CoMISo/trunk@118 1355f012-dd97-4b2f-ae87-10fa9f823a57
parent 199168ef
...@@ -54,7 +54,7 @@ IPOPTSolver() ...@@ -54,7 +54,7 @@ IPOPTSolver()
int int
IPOPTSolver:: IPOPTSolver::
solve(NProblemInterface* _problem, std::vector<NConstraintInterface*>& _constraints) solve(NProblemInterface* _problem, const std::vector<NConstraintInterface*>& _constraints)
{ {
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// 1. Create an instance of IPOPT NLP // 1. Create an instance of IPOPT NLP
...@@ -148,7 +148,7 @@ solve(NProblemGmmInterface* _problem, std::vector<NConstraintInterface*>& _const ...@@ -148,7 +148,7 @@ solve(NProblemGmmInterface* _problem, std::vector<NConstraintInterface*>& _const
void void
NProblemIPOPT:: NProblemIPOPT::
split_constraints(std::vector<NConstraintInterface*>& _constraints) split_constraints(const std::vector<NConstraintInterface*>& _constraints)
{ {
// split user-provided constraints into general-constraints and bound-constraints // split user-provided constraints into general-constraints and bound-constraints
constraints_ .clear(); constraints_.reserve(_constraints.size()); constraints_ .clear(); constraints_.reserve(_constraints.size());
......
...@@ -82,7 +82,7 @@ public: ...@@ -82,7 +82,7 @@ public:
// }; // };
//------------------------------------------------------ //------------------------------------------------------
int solve(NProblemInterface* _problem, std::vector<NConstraintInterface*>& _constraints); int solve(NProblemInterface* _problem, const std::vector<NConstraintInterface*>& _constraints);
// deprecated interface for backwards compatibility // deprecated interface for backwards compatibility
int solve(NProblemGmmInterface* _problem, std::vector<NConstraintInterface*>& _constraints); int solve(NProblemGmmInterface* _problem, std::vector<NConstraintInterface*>& _constraints);
...@@ -129,7 +129,7 @@ public: ...@@ -129,7 +129,7 @@ public:
typedef NProblemInterface::SMatrixNP SMatrixNP; typedef NProblemInterface::SMatrixNP SMatrixNP;
/** default constructor */ /** default constructor */
NProblemIPOPT(NProblemInterface* _problem, std::vector<NConstraintInterface*>& _constraints) NProblemIPOPT(NProblemInterface* _problem, const std::vector<NConstraintInterface*>& _constraints)
: problem_(_problem) { split_constraints(_constraints);} : problem_(_problem) { split_constraints(_constraints);}
/** default destructor */ /** default destructor */
...@@ -208,7 +208,7 @@ private: ...@@ -208,7 +208,7 @@ private:
//@} //@}
// split user-provided constraints into general-constraints and bound-constraints // split user-provided constraints into general-constraints and bound-constraints
void split_constraints(std::vector<NConstraintInterface*>& _constraints); void split_constraints(const std::vector<NConstraintInterface*>& _constraints);
protected: protected:
double* P(std::vector<double>& _v) double* P(std::vector<double>& _v)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment