33 using namespace ifopt;
46 ipopt.
SetOption(
"linear_solver",
"mumps");
47 ipopt.
SetOption(
"jacobian_approximation",
"exact");
52 std::cout << x.transpose() << std::endl;
56 assert(1.0-eps < x(0) && x(0) < 1.0+eps);
57 assert(0.0-eps < x(1) && x(1) < 0.0+eps);
void Solve(Problem &nlp) override
Creates an IpoptAdapter and solves the NLP.
A generic optimization problem with variables, costs and constraints.
void AddCostSet(CostTerm::Ptr cost_set)
Add a cost term to the optimization problem.
An interface to IPOPT, fully hiding its implementation.
void PrintCurrent() const
Prints the variables, costs and constraints.
common namespace for all elements in this library.
Example to generate a solver-independent formulation for the problem, taken from the IPOPT cpp_exampl...
void AddConstraintSet(ConstraintSet::Ptr constraint_set)
Add a set of multiple constraints to the optimization problem.
void AddVariableSet(VariableSet::Ptr variable_set)
Add one individual set of variables to the optimization problem.
void SetOption(const std::string &name, const std::string &value)
Composite::Ptr GetOptVariables() const
Read/write access to the current optimization variables.