Go to the documentation of this file.
14 #ifndef __IPAMPLTMINLP_HPP__
15 #define __IPAMPLTMINLP_HPP__
33 class AmplSuffixHandler;
34 class AmplOptionsList;
57 const std::string& appName =
"bonmin",
58 std::string* nl_file_content = NULL);
65 const std::string& appName =
"bonmin",
66 std::string* nl_file_content = NULL);
204 return &perturb_info_;
222 return upperBoundingObj_ != -1;
233 if (constraintsConvexities_ != NULL) {
234 CoinCopyN(constraintsConvexities_, m, constraints_convexities);
244 number_non_conv = numberNonConvex_;
245 number_concave = numberSimpleConcave_;
251 assert(number_non_conv == numberNonConvex_);
252 CoinCopyN( nonConvexConstraintsAndRelaxations_, number_non_conv, non_convexes);
258 assert(number_concave == numberSimpleConcave_);
259 CoinCopyN(simpleConcaves_, numberSimpleConcave_, simple_concave);
266 return hasLinearObjective_;
271 return c_extra_id_();
290 std::string appName_;
293 int upperBoundingObj_;
300 BranchingInfo branch_;
304 PerturbInfo perturb_info_;
315 int numberNonConvex_;
317 MarkedNonConvex * nonConvexConstraintsAndRelaxations_;
319 int numberSimpleConcave_;
321 SimpleConcaveConstraint * simpleConcaves_;
324 bool hasLinearObjective_;
327 int writeAmplSolFile_;
virtual void getLinearPartOfObjective(double *obj)
This methods gives the linear part of the objective function.
Class to store sos constraints for model.
virtual bool hasUpperBoundingObjective()
Do we have an alternate objective for upper bounding?
virtual void Initialize(const Ipopt::SmartPtr< const Ipopt::Journalist > &jnlst, const Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions, const Ipopt::SmartPtr< Ipopt::OptionsList > options, char **&argv, Ipopt::AmplSuffixHandler *suffix_handler=NULL, const std::string &appName="bonmin", std::string *nl_file_content=NULL)
void CoinFillN(T *to, const CoinBigIndex size, const T value)
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)
returns bounds of the nlp.
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)
specifies the jacobian structure (if values is NULL) and evaluates the jacobian values (if values is ...
(C) Copyright International Business Machines Corporation 2007
virtual void finalize_solution(TMINLP::SolverReturn status, Ipopt::Index n, const Ipopt::Number *x, Ipopt::Number obj_value)
Called after optimizing to return results to ampl.
virtual bool get_constraint_convexities(int number_non_conv, MarkedNonConvex *non_convexes) const
Get array describing the constraints marked nonconvex in the model.
virtual const PerturbInfo * perturbInfo() const
Stores branching priorities information.
Structure which describes a constraints of the form $f[ y \gt F(x) \f] with a concave function.
virtual AmplTMINLP * createEmpty()
virtual bool hasLinearObjective()
Say if problem has a linear objective (for OA)
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)
returns dimensions of the nlp.
void read_convexities()
Read suffixes which indicate which constraints are convex.
virtual bool eval_upper_bound_f(Ipopt::Index n, const Ipopt::Number *x, Ipopt::Number &obj_value)
This method to returns the value of an alternative objective function for upper bounding (if one has ...
void write_solution(const std::string &message, const Ipopt::Number *x_sol)
Write the solution using ampl's write_sol (called by finalize_solution).
virtual bool eval_grad_f(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number *grad_f)
evaluates the gradient of the objective for the nlp.
virtual const int * get_const_xtra_id() const
Access array describing onoff constraint.
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
virtual const SosInfo * sosConstraints() const
virtual ~AmplTMINLP()
destructor
Class to store perturbation radii for variables in the model.
void CoinCopyN(const T *from, const CoinBigIndex size, T *to)
virtual bool get_constraint_convexities(int m, TMINLP::Convexity *constraints_convexities) const
Get accest to constraint convexities.
AmplTMINLP()
Default constructor.
SolverReturn
Return statuses of algorithm.
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)
provides a starting point for the nlp variables.
void read_sos()
read the sos constraints from ampl suffixes
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)
specifies the structure of the hessian of the lagrangian (if values is NULL) and evaluates the values...
Convexity
Used to mark constraints of the problem.
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
virtual void fillApplicationOptions(Ipopt::AmplOptionsList *amplOptList)
Additional application specific options.
virtual bool eval_g(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Number *g)
evaluates the constraint residuals for the nlp.
VariableType
Type of the variables.
virtual bool get_variables_types(Ipopt::Index n, VariableType *var_types)
returns the vector of variable types
void read_obj_suffixes()
Read suffixes on objective functions for upper bounding.
void read_priorities()
read the branching priorities from ampl suffixes.
virtual bool eval_f(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number &obj_value)
evaluates the objective value for the nlp.
virtual bool get_number_nonconvex(int &number_non_conv, int &number_concave) const
Get dimension information on nonconvex constraints.
@ Convex
Constraint is convex.
virtual const BranchingInfo * branchingInfo() const
AmplTMINLP(const Ipopt::SmartPtr< const Ipopt::Journalist > &jnlst, const Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions, const Ipopt::SmartPtr< Ipopt::OptionsList > options, char **&argv, Ipopt::AmplSuffixHandler *suffix_handler=NULL, const std::string &appName="bonmin", std::string *nl_file_content=NULL)
Constructor.
void read_onoff()
Read suffixes used to apply perspective in OA to some of the constraints.
Base class for all MINLPs that use a standard triplet matrix form and dense vectors.
virtual bool get_simple_concave_constraints(int number_concave, SimpleConcaveConstraint *simple_concave) const
Fill array containing indices of simple concave constraints.
virtual bool get_variables_linearity(Ipopt::Index n, Ipopt::TNLP::LinearityType *var_types)
return the variables linearity (linear or not)
const ASL_pfgh * AmplSolverObject() const
Return the ampl solver object (ASL*)
Structure for marked non-convex constraints.
virtual bool get_constraints_linearity(Ipopt::Index m, Ipopt::TNLP::LinearityType *const_types)
Returns the constraint linearity.