10#ifndef COUENNETNLP_HPP
11#define COUENNETNLP_HPP
24 class CouenneSparseMatrix;
183 {
return optHessian_;}
187 {
return saveOptHessian_;}
204 std::vector <std::pair <int, expression *> > gradient_;
207 std::set <int> nonLinVars_;
220 bool saveOptHessian_;
Class for MINLP problems with symbolic information.
Class for sparse Matrixs (used in modifying distances in FP)
Class for handling NLPs using CouenneProblem.
virtual bool get_nlp_info(Ipopt::Index &n, Ipopt::Index &m, Ipopt::Index &nnz_jac_g, Ipopt::Index &nnz_h_lag, enum Ipopt::TNLP::IndexStyleEnum &index_style)
return the number of variables and constraints, and the number of non-zeros in the jacobian and the h...
virtual bool get_bounds_info(Ipopt::Index n, Ipopt::Number *x_l, Ipopt::Number *x_u, Ipopt::Index m, Ipopt::Number *g_l, Ipopt::Number *g_u)
return the information about the bound on the variables and constraints.
virtual ~CouenneTNLP()
Destructor.
virtual bool get_starting_point(Ipopt::Index n, bool init_x, Ipopt::Number *x, bool init_z, Ipopt::Number *z_L, Ipopt::Number *z_U, Ipopt::Index m, bool init_lambda, Ipopt::Number *lambda)
return the starting point.
CouenneTNLP(CouenneProblem *)
Constructor.
CouenneSparseMatrix *& optHessian()
Get methods.
void setInitSol(const double *sol)
set initial solution
CouenneTNLP & operator=(const CouenneTNLP &rhs)
Assignment.
CouenneTNLP()
Empty constructor.
CouNumber getSolValue()
returns value of the best solution
virtual void setObjective(expression *newObj)
Change objective function and modify gradient expressions accordingly.
virtual Ipopt::Index get_number_of_nonlinear_variables()
bool & getSaveOptHessian()
set and get saveOptHessian_
virtual void finalize_solution(Ipopt::SolverReturn status, Ipopt::Index n, const Ipopt::Number *x, const Ipopt::Number *z_L, const Ipopt::Number *z_U, Ipopt::Index m, const Ipopt::Number *g, const Ipopt::Number *lambda, Ipopt::Number obj_value, const Ipopt::IpoptData *ip_data, Ipopt::IpoptCalculatedQuantities *ip_cq)
This method is called when the algorithm is complete so the TNLP can store/write the solution.
virtual bool intermediate_callback(Ipopt::AlgorithmMode mode, Ipopt::Index iter, Ipopt::Number obj_value, Ipopt::Number inf_pr, Ipopt::Number inf_du, Ipopt::Number mu, Ipopt::Number d_norm, Ipopt::Number regularization_size, Ipopt::Number alpha_du, Ipopt::Number alpha_pr, Ipopt::Index ls_trials, const Ipopt::IpoptData *ip_data, Ipopt::IpoptCalculatedQuantities *ip_cq)
Intermediate Callback method for the user.
virtual bool eval_h(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number obj_factor, Ipopt::Index m, const Ipopt::Number *lambda, bool new_lambda, Ipopt::Index nele_hess, Ipopt::Index *iRow, Ipopt::Index *jCol, Ipopt::Number *values)
return the hessian of the lagrangian.
virtual bool get_constraints_linearity(Ipopt::Index m, Ipopt::TNLP::LinearityType *const_types)
return the constraint linearity.
virtual bool get_list_of_nonlinear_variables(Ipopt::Index num_nonlin_vars, Ipopt::Index *pos_nonlin_vars)
get real list
CouNumber * getSolution()
returns best solution (if it exists)
virtual bool eval_grad_f(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number *grad_f)
return the vector of the gradient of the objective w.r.t. x
virtual bool eval_f(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number &obj_value)
return the value of the objective function
CouenneTNLP(const CouenneTNLP &)
Copy constructor.
virtual bool eval_g(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Number *g)
return the vector of constraint values
virtual bool eval_jac_g(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Index nele_jac, Ipopt::Index *iRow, Ipopt::Index *jCol, Ipopt::Number *values)
return the jacobian of the constraints.
virtual bool get_variables_linearity(Ipopt::Index n, Ipopt::TNLP::LinearityType *var_types)
return the variables linearity (TNLP::Linear or TNLP::NonLinear).
CouenneTNLP * clone()
Clone.
Jacobian of the problem (computed through Couenne expression classes).
general include file for different compilers
double CouNumber
main number type in Couenne