#include <TMINLP.hpp>
Inheritance diagram for Ipopt::TMINLP:
Public Types | |
SUCCESS | |
INFEASIBLE | |
LIMIT_EXCEEDED | |
MINLP_ERROR | |
CONTINUOUS | |
BINARY | |
INTEGER | |
LINEAR | |
Constraint contains only linear terms. | |
NON_LINEAR | |
Constraint contains some non-linear terms. | |
enum | SolverReturn { SUCCESS, INFEASIBLE, LIMIT_EXCEEDED, MINLP_ERROR } |
enum | VariableType { CONTINUOUS, BINARY, INTEGER } |
Type of the variables. More... | |
enum | ConstraintType { LINEAR, NON_LINEAR } |
Type of the constraints. More... | |
Public Member Functions | |
virtual const BranchingInfo * | branchingInfo () const =0 |
virtual const SosInfo * | sosConstraints () const =0 |
Constructors/Destructors | |
TMINLP () | |
virtual | ~TMINLP () |
Default destructor. | |
methods to gather information about the MINLP | |
virtual bool | get_nlp_info (Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, TNLP::IndexStyleEnum &index_style)=0 |
overload this method to return the number of variables and constraints, and the number of non-zeros in the jacobian and the hessian. | |
virtual bool | get_var_types (Index n, VariableType *var_types)=0 |
overload this method to set the variable type. | |
virtual bool | get_constraints_types (Index m, ConstraintType *const_types)=0 |
overload this method to set the constraint types (linear or not) | |
virtual bool | get_bounds_info (Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u)=0 |
overload this method to return the information about the bound on the variables and constraints. | |
virtual bool | get_starting_point (Index n, bool init_x, Number *x, bool init_z, Number *z_L, Number *z_U, Index m, bool init_lambda, Number *lambda)=0 |
overload this method to return the starting point. | |
virtual bool | eval_f (Index n, const Number *x, bool new_x, Number &obj_value)=0 |
overload this method to return the value of the objective function | |
virtual bool | eval_grad_f (Index n, const Number *x, bool new_x, Number *grad_f)=0 |
overload this method to return the vector of the gradient of the objective w.r.t. | |
virtual bool | eval_g (Index n, const Number *x, bool new_x, Index m, Number *g)=0 |
overload this method to return the vector of constraint values | |
virtual bool | eval_jac_g (Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values)=0 |
overload this method to return the jacobian of the constraints. | |
virtual bool | eval_h (Index n, const Number *x, bool new_x, Number obj_factor, Index m, const Number *lambda, bool new_lambda, Index nele_hess, Index *iRow, Index *jCol, Number *values)=0 |
overload this method to return the hessian of the lagrangian. | |
Solution Methods | |
virtual void | finalize_solution (SolverReturn status, Index n, const Number *x, Number obj_value) const =0 |
This method is called when the algorithm is complete so the TMINLP can store/write the solution. | |
Private Member Functions | |
Default Compiler Generated Methods | |
(Hidden to avoid implicit creation/calling). These methods are not implemented and we do not want the compiler to implement them for us, so we declare them private and do not define them. This ensures that they will not be implicitly created/called. | |
TMINLP (const TMINLP &) | |
Copy Constructor. | |
void | operator= (const TMINLP &) |
Overloaded Equals Operator. | |
Classes | |
struct | BranchingInfo |
Stores branching priorities information. More... | |
struct | SosInfo |
Class to store sos constraints for model. More... |
The class TMINLP2TNLP allows the caller to produce a viable TNLP from the MINLP (by relaxing binary and/or integers, or by fixing them), which can then be solved by Ipopt.
This interface presents the problem form:
Where each x_i is either a continuous, binary, or integer variable. If x_i is binary, the bounds [xL,xU] are assumed to be [0,1]. In order to specify an equality constraint, set gL_i = gU_i = rhs. The value that indicates "infinity" for the bounds (i.e. the variable or constraint has no lower bound (-infinity) or upper bound (+infinity)) is set through the option nlp_lower_bound_inf and nlp_upper_bound_inf. To indicate that a variable has no upper or lower bound, set the bound to -ipopt_inf or +ipopt_inf respectively
Definition at line 54 of file TMINLP.hpp.
Type of the constraints.
LINEAR | Constraint contains only linear terms. |
NON_LINEAR | Constraint contains some non-linear terms. |
Definition at line 211 of file TMINLP.hpp.
Ipopt::TMINLP::TMINLP | ( | ) | [inline] |
Definition at line 64 of file TMINLP.hpp.
virtual Ipopt::TMINLP::~TMINLP | ( | ) | [inline, virtual] |
Ipopt::TMINLP::TMINLP | ( | const TMINLP & | ) | [private] |
Copy Constructor.
virtual bool Ipopt::TMINLP::get_nlp_info | ( | Index & | n, | |
Index & | m, | |||
Index & | nnz_jac_g, | |||
Index & | nnz_h_lag, | |||
TNLP::IndexStyleEnum & | index_style | |||
) | [pure virtual] |
overload this method to return the number of variables and constraints, and the number of non-zeros in the jacobian and the hessian.
Implemented in MyTMINLP, and Ipopt::AmplTMINLP.
virtual bool Ipopt::TMINLP::get_var_types | ( | Index | n, | |
VariableType * | var_types | |||
) | [pure virtual] |
overload this method to set the variable type.
The var_types array will be allocated with length n.
virtual bool Ipopt::TMINLP::get_constraints_types | ( | Index | m, | |
ConstraintType * | const_types | |||
) | [pure virtual] |
overload this method to set the constraint types (linear or not)
virtual bool Ipopt::TMINLP::get_bounds_info | ( | Index | n, | |
Number * | x_l, | |||
Number * | x_u, | |||
Index | m, | |||
Number * | g_l, | |||
Number * | g_u | |||
) | [pure virtual] |
overload this method to return the information about the bound on the variables and constraints.
The value that indicates that a bound does not exist is specified in the parameters nlp_lower_bound_inf and nlp_upper_bound_inf. By default, nlp_lower_bound_inf is -1e19 and nlp_upper_bound_inf is 1e19. An exception will be thrown if x_l and x_u are not 0,1 for binary variables
Implemented in MyTMINLP, and Ipopt::AmplTMINLP.
virtual bool Ipopt::TMINLP::get_starting_point | ( | Index | n, | |
bool | init_x, | |||
Number * | x, | |||
bool | init_z, | |||
Number * | z_L, | |||
Number * | z_U, | |||
Index | m, | |||
bool | init_lambda, | |||
Number * | lambda | |||
) | [pure virtual] |
overload this method to return the starting point.
The bools init_x and init_lambda are both inputs and outputs. As inputs, they indicate whether or not the algorithm wants you to initialize x and lambda respectively. If, for some reason, the algorithm wants you to initialize these and you cannot, set the respective bool to false.
Implemented in MyTMINLP, and Ipopt::AmplTMINLP.
virtual bool Ipopt::TMINLP::eval_f | ( | Index | n, | |
const Number * | x, | |||
bool | new_x, | |||
Number & | obj_value | |||
) | [pure virtual] |
overload this method to return the value of the objective function
Implemented in MyTMINLP, and Ipopt::AmplTMINLP.
virtual bool Ipopt::TMINLP::eval_grad_f | ( | Index | n, | |
const Number * | x, | |||
bool | new_x, | |||
Number * | grad_f | |||
) | [pure virtual] |
overload this method to return the vector of the gradient of the objective w.r.t.
x
Implemented in MyTMINLP, and Ipopt::AmplTMINLP.
virtual bool Ipopt::TMINLP::eval_g | ( | Index | n, | |
const Number * | x, | |||
bool | new_x, | |||
Index | m, | |||
Number * | g | |||
) | [pure virtual] |
overload this method to return the vector of constraint values
Implemented in MyTMINLP, and Ipopt::AmplTMINLP.
virtual bool Ipopt::TMINLP::eval_jac_g | ( | Index | n, | |
const Number * | x, | |||
bool | new_x, | |||
Index | m, | |||
Index | nele_jac, | |||
Index * | iRow, | |||
Index * | jCol, | |||
Number * | values | |||
) | [pure virtual] |
overload this method to return the jacobian of the constraints.
The vectors iRow and jCol only need to be set once. The first call is used to set the structure only (iRow and jCol will be non-NULL, and values will be NULL) For subsequent calls, iRow and jCol will be NULL.
Implemented in MyTMINLP, and Ipopt::AmplTMINLP.
virtual bool Ipopt::TMINLP::eval_h | ( | Index | n, | |
const Number * | x, | |||
bool | new_x, | |||
Number | obj_factor, | |||
Index | m, | |||
const Number * | lambda, | |||
bool | new_lambda, | |||
Index | nele_hess, | |||
Index * | iRow, | |||
Index * | jCol, | |||
Number * | values | |||
) | [pure virtual] |
overload this method to return the hessian of the lagrangian.
The vectors iRow and jCol only need to be set once (during the first call). The first call is used to set the structure only (iRow and jCol will be non-NULL, and values will be NULL) For subsequent calls, iRow and jCol will be NULL. This matrix is symmetric - specify the lower diagonal only
Implemented in MyTMINLP, and Ipopt::AmplTMINLP.
virtual void Ipopt::TMINLP::finalize_solution | ( | SolverReturn | status, | |
Index | n, | |||
const Number * | x, | |||
Number | obj_value | |||
) | const [pure virtual] |
This method is called when the algorithm is complete so the TMINLP can store/write the solution.
virtual const BranchingInfo* Ipopt::TMINLP::branchingInfo | ( | ) | const [pure virtual] |
Implemented in MyTMINLP, and Ipopt::AmplTMINLP.
virtual const SosInfo* Ipopt::TMINLP::sosConstraints | ( | ) | const [pure virtual] |
Implemented in MyTMINLP, and Ipopt::AmplTMINLP.
void Ipopt::TMINLP::operator= | ( | const TMINLP & | ) | [private] |
Overloaded Equals Operator.