10#ifndef __TMINLPQuad_HPP__
11#define __TMINLPQuad_HPP__
42 printf(
"Cloning TMINLP2TNLPQuadCuts.\n");
Generalizes OsiCuts to handle quadratic cuts.
This is a derived class fro TMINLP2TNLP to handle adding quadratic cuts.
TMINLP2TNLPQuadCuts(const TMINLP2TNLPQuadCuts &)
Copy Constructor.
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)
This call is just passed onto parent class and add lambda for quadratic cuts.
void addCuts(const Cuts &cuts, bool safe)
Add some linear or quadratic cuts to the problem formulation if some of the OsiRowCuts are quadratic ...
virtual bool eval_grad_f(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number *grad_f)
Returns the vector of the gradient of the objective w.r.t.
void addRowCuts(const OsiCuts &cuts, bool safe)
Add some cuts to the problem formulaiton (handles Quadratics).
TMINLP2TNLPQuadCuts(const Ipopt::SmartPtr< Bonmin::TMINLP > tminlp)
virtual bool get_nlp_info(Ipopt::Index &n, Ipopt::Index &m, Ipopt::Index &nnz_jac_g, Ipopt::Index &nnz_h_lag, Ipopt::TNLP::IndexStyleEnum &index_style)
This call is just passed onto parent class and add number of quadratic cuts.
virtual bool get_constraints_linearity(Ipopt::Index m, Ipopt::TNLP::LinearityType *const_types)
Returns the constraint linearity.
virtual ~TMINLP2TNLPQuadCuts()
Destructor.
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)
This call is just passed onto parent class and add bounds of quadratic cuts.
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 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)
Returns the jacobian of the constraints.
virtual bool get_scaling_parameters(Ipopt::Number &obj_scaling, bool &use_x_scaling, Ipopt::Index n, Ipopt::Number *x_scaling, bool &use_g_scaling, Ipopt::Index m, Ipopt::Number *g_scaling)
Method that returns scaling parameters (passed to parent all quadratic not scaled).
void reset_objective()
Reset objective to original one.
virtual bool eval_f(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number &obj_value)
Returns the value of the objective function in x.
virtual bool eval_gi(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index i, Ipopt::Number &gi)
compute the value of a single constraint
void removeCuts(unsigned int number, const int *toRemove)
Remove some cuts from the formulation.
virtual Bonmin::TMINLP2TNLP * clone() const
Virtual copy.
TMINLP2TNLPQuadCuts()
Default Constructor.
virtual bool eval_g(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Number *g)
Returns the vector of constraint values in x (appends constraint values for quadratics).
TMINLP2TNLPQuadCuts & operator=(const TMINLP2TNLP &)
Overloaded Equals Operator.
virtual bool eval_grad_gi(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index i, Ipopt::Index &nele_grad_gi, Ipopt::Index *jCol, Ipopt::Number *values)
compute the structure or values of the gradient for one constraint
void set_linear_objective(int n_var, const double *obj, double c_0)
Change objective to a linear one whith given objective function.
virtual void addCuts(unsigned int numberCuts, const OsiRowCut **cuts)
Add some linear cuts to the problem formulation.
void addCuts(const OsiCuts &cuts)
Add some cuts to the problem formulaiton (handles Quadratics).
This is an adapter class that converts a TMINLP to a TNLP to be solved by Ipopt.
TNLP::IndexStyleEnum index_style() const
Acces index_style.
const Ipopt::Number * x_u()
Get the current values for the upper bounds.
const Ipopt::Number * g_l()
Get the current values for constraints lower bounds.
Ipopt::Number obj_value() const
Get the objective value.
Ipopt::Index nnz_h_lag()
Get the nomber of nz in hessian.
const Ipopt::Number * x_l()
Get the current values for the lower bounds.
Ipopt::Index nnz_jac_g() const
Access number of entries in tminlp_ hessian.
const Ipopt::Number * g_u()
Get the current values for constraints upper bounds.
A small wrap around std::vector to give easy access to array for interfacing with fortran code.
(C) Copyright International Business Machines Corporation 2007
std::map< matEntry, matIdx > AdjustableMat