#include <AmplTMINLP.hpp>
Inheritance diagram for Ipopt::AmplTMINLP:
Public Member Functions | |
void | write_solution_file (const std::string &message, const Number *x) const |
Write the solution file. | |
virtual const BranchingInfo * | branchingInfo () const |
virtual const SosInfo * | sosConstraints () const |
virtual void | getLinearPartOfObjective (double *obj) |
This methods gives the linear part of the objective function. | |
bool | internal_objval (Number &obj_val) |
Make the objective call to ampl. | |
bool | internal_conval (Index m, Number *g=NULL) |
Make the constraint call to ampl. | |
void | apply_new_x (bool new_x, Index n, const Number *x) |
Internal function to update the internal and ampl state if the x value changes. | |
void | fillAmplOptionList (AmplOptionsList *amplOptList) |
Method to add the extra option for ampl. | |
Constructors/Destructors | |
AmplTMINLP (const SmartPtr< const Journalist > &jnlst, const SmartPtr< OptionsList > options, char **&argv, AmplSuffixHandler *suffix_handler=NULL, const std::string &appName="bonmin", std::string *nl_file_content=NULL) | |
Constructor. | |
virtual void | Initialize (const SmartPtr< const Journalist > &jnlst, const SmartPtr< OptionsList > options, char **&argv, AmplSuffixHandler *suffix_handler=NULL, const std::string &appName="bonmin", std::string *nl_file_content=NULL) |
Constructor. | |
void | read_priorities () |
read the branching priorities from ampl suffixes. | |
void | read_sos () |
read the sos constraints from ampl suffixes | |
AmplTMINLP () | |
Constructor. | |
virtual AmplTMINLP * | createEmpty () |
Constructor. | |
virtual | ~AmplTMINLP () |
Default destructor. | |
methods to gather information about the NLP. These | |
methods are overloaded from TMINLP. See TMINLP for their more detailed documentation. | |
virtual bool | get_nlp_info (Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, TNLP::IndexStyleEnum &index_style) |
returns dimensions of the nlp. | |
virtual bool | get_var_types (Index n, VariableType *var_types) |
returns the vector of variable types | |
virtual bool | get_constraints_types (Index n, ConstraintType *const_types) |
return the vector of constraints types | |
virtual bool | get_bounds_info (Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u) |
returns bounds of the nlp. | |
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) |
provides a starting point for the nlp variables. | |
virtual bool | eval_f (Index n, const Number *x, bool new_x, Number &obj_value) |
evaluates the objective value for the nlp. | |
virtual bool | eval_grad_f (Index n, const Number *x, bool new_x, Number *grad_f) |
evaluates the gradient of the objective for the nlp. | |
virtual bool | eval_g (Index n, const Number *x, bool new_x, Index m, Number *g) |
evaluates the constraint residuals for the nlp. | |
virtual bool | eval_jac_g (Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values) |
specifies the jacobian structure (if values is NULL) and evaluates the jacobian values (if values is not NULL) for the nlp. | |
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) |
specifies the structure of the hessian of the lagrangian (if values is NULL) and evaluates the values (if values is not NULL). | |
Solution Methods | |
virtual void | finalize_solution (SolverReturn status, Index n, const Number *x, Number obj_value) const |
void | write_solution (const std::string &message, const Number *x_sol) const |
User callbacks | |
virtual void | fillApplicationOptions (AmplOptionsList *amplOptList) |
Additional application specific options. | |
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. | |
AmplTMINLP (const AmplTMINLP &) | |
Copy Constructor. | |
void | operator= (const AmplTMINLP &) |
Overloaded Equals Operator. | |
Public Attributes | |
SmartPtr< const Journalist > | jnlst_ |
Journlist. | |
double | obj_sign_ |
Sign of the objective fn (1 for min, -1 for max). | |
AmplTNLP * | ampl_tnlp_ |
pointer to the internal AmplTNLP | |
BranchingInfo | branch_ |
Storage of branching priorities information. | |
SosInfo | sos_ |
Storage of sos constraints. | |
SmartPtr< AmplSuffixHandler > | suffix_handler_ |
Store a suffix handler (since Ipopt does not want to give access to his >:( ). | |
Problem Size Data | |
Index | nz_h_full_ |
Internal copies of data | |
Number * | non_const_x_ |
A non-const copy of x - this is kept up-to-date in apply_new_x. | |
Number * | x_sol_ |
Solution Vectors. | |
Number * | z_L_sol_ |
A non-const copy of x - this is kept up-to-date in apply_new_x. | |
Number * | z_U_sol_ |
A non-const copy of x - this is kept up-to-date in apply_new_x. | |
Number * | g_sol_ |
A non-const copy of x - this is kept up-to-date in apply_new_x. | |
Number * | lambda_sol_ |
A non-const copy of x - this is kept up-to-date in apply_new_x. | |
Number | obj_sol_ |
A non-const copy of x - this is kept up-to-date in apply_new_x. | |
Flags to track internal state | |
bool | objval_called_with_current_x_ |
true when the objective value has been calculated with the current x, set to false in apply_new_x, and set to true in internal_objval | |
bool | conval_called_with_current_x_ |
true when the constraint values have been calculated with the current x, set to false in apply_new_x, and set to true in internal_conval |
Ampl MINLP Interface, implemented as a TMINLP. This interface creates a AmplTNLP and also retrieves the information about the binary and integer variables
Definition at line 34 of file AmplTMINLP.hpp.
Ipopt::AmplTMINLP::AmplTMINLP | ( | const SmartPtr< const Journalist > & | jnlst, | |
const SmartPtr< OptionsList > | options, | |||
char **& | argv, | |||
AmplSuffixHandler * | suffix_handler = NULL , |
|||
const std::string & | appName = "bonmin" , |
|||
std::string * | nl_file_content = NULL | |||
) |
Constructor.
Ipopt::AmplTMINLP::AmplTMINLP | ( | ) |
Constructor.
virtual Ipopt::AmplTMINLP::~AmplTMINLP | ( | ) | [virtual] |
Default destructor.
Ipopt::AmplTMINLP::AmplTMINLP | ( | const AmplTMINLP & | ) |
Copy Constructor.
virtual void Ipopt::AmplTMINLP::Initialize | ( | const SmartPtr< const Journalist > & | jnlst, | |
const SmartPtr< OptionsList > | options, | |||
char **& | argv, | |||
AmplSuffixHandler * | suffix_handler = NULL , |
|||
const std::string & | appName = "bonmin" , |
|||
std::string * | nl_file_content = NULL | |||
) | [virtual] |
Constructor.
void Ipopt::AmplTMINLP::read_priorities | ( | ) |
read the branching priorities from ampl suffixes.
void Ipopt::AmplTMINLP::read_sos | ( | ) |
read the sos constraints from ampl suffixes
virtual AmplTMINLP* Ipopt::AmplTMINLP::createEmpty | ( | ) | [inline, virtual] |
virtual bool Ipopt::AmplTMINLP::get_nlp_info | ( | Index & | n, | |
Index & | m, | |||
Index & | nnz_jac_g, | |||
Index & | nnz_h_lag, | |||
TNLP::IndexStyleEnum & | index_style | |||
) | [virtual] |
virtual bool Ipopt::AmplTMINLP::get_var_types | ( | Index | n, | |
VariableType * | var_types | |||
) | [virtual] |
returns the vector of variable types
virtual bool Ipopt::AmplTMINLP::get_constraints_types | ( | Index | n, | |
ConstraintType * | const_types | |||
) | [virtual] |
return the vector of constraints types
virtual bool Ipopt::AmplTMINLP::eval_grad_f | ( | Index | n, | |
const Number * | x, | |||
bool | new_x, | |||
Number * | grad_f | |||
) | [virtual] |
evaluates the gradient of the objective for the nlp.
Overloaded from TMINLP
Implements Ipopt::TMINLP.
virtual bool Ipopt::AmplTMINLP::eval_jac_g | ( | Index | n, | |
const Number * | x, | |||
bool | new_x, | |||
Index | m, | |||
Index | nele_jac, | |||
Index * | iRow, | |||
Index * | jCol, | |||
Number * | values | |||
) | [virtual] |
specifies the jacobian structure (if values is NULL) and evaluates the jacobian values (if values is not NULL) for the nlp.
Overloaded from TMINLP
Implements Ipopt::TMINLP.
virtual bool Ipopt::AmplTMINLP::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 | |||
) | [virtual] |
specifies the structure of the hessian of the lagrangian (if values is NULL) and evaluates the values (if values is not NULL).
Overloaded from TMINLP
Implements Ipopt::TMINLP.
virtual void Ipopt::AmplTMINLP::finalize_solution | ( | SolverReturn | status, | |
Index | n, | |||
const Number * | x, | |||
Number | obj_value | |||
) | const [virtual] |
void Ipopt::AmplTMINLP::write_solution | ( | const std::string & | message, | |
const Number * | x_sol | |||
) | const |
void Ipopt::AmplTMINLP::write_solution_file | ( | const std::string & | message, | |
const Number * | x | |||
) | const |
Write the solution file.
This is a wrapper for AMPL's write_sol. TODO Maybe this should be at a different place, or collect the numbers itself?
virtual const BranchingInfo* Ipopt::AmplTMINLP::branchingInfo | ( | ) | const [inline, virtual] |
virtual const SosInfo* Ipopt::AmplTMINLP::sosConstraints | ( | ) | const [inline, virtual] |
virtual void Ipopt::AmplTMINLP::fillApplicationOptions | ( | AmplOptionsList * | amplOptList | ) | [inline, virtual] |
virtual void Ipopt::AmplTMINLP::getLinearPartOfObjective | ( | double * | obj | ) | [virtual] |
This methods gives the linear part of the objective function.
bool Ipopt::AmplTMINLP::internal_objval | ( | Number & | obj_val | ) |
Make the objective call to ampl.
Make the constraint call to ampl.
Internal function to update the internal and ampl state if the x value changes.
void Ipopt::AmplTMINLP::fillAmplOptionList | ( | AmplOptionsList * | amplOptList | ) |
Method to add the extra option for ampl.
void Ipopt::AmplTMINLP::operator= | ( | const AmplTMINLP & | ) |
Overloaded Equals Operator.
double Ipopt::AmplTMINLP::obj_sign_ |
Definition at line 167 of file AmplTMINLP.hpp.
A non-const copy of x - this is kept up-to-date in apply_new_x.
Definition at line 174 of file AmplTMINLP.hpp.
A non-const copy of x - this is kept up-to-date in apply_new_x.
Definition at line 178 of file AmplTMINLP.hpp.
A non-const copy of x - this is kept up-to-date in apply_new_x.
Definition at line 179 of file AmplTMINLP.hpp.
A non-const copy of x - this is kept up-to-date in apply_new_x.
Definition at line 180 of file AmplTMINLP.hpp.
A non-const copy of x - this is kept up-to-date in apply_new_x.
Definition at line 181 of file AmplTMINLP.hpp.
A non-const copy of x - this is kept up-to-date in apply_new_x.
Definition at line 182 of file AmplTMINLP.hpp.
true when the objective value has been calculated with the current x, set to false in apply_new_x, and set to true in internal_objval
Definition at line 190 of file AmplTMINLP.hpp.
true when the constraint values have been calculated with the current x, set to false in apply_new_x, and set to true in internal_conval
Definition at line 194 of file AmplTMINLP.hpp.
BranchingInfo Ipopt::AmplTMINLP::branch_ |
Storage of branching priorities information.
Definition at line 231 of file AmplTMINLP.hpp.
Referenced by branchingInfo().
SosInfo Ipopt::AmplTMINLP::sos_ |
Storage of sos constraints.
Definition at line 233 of file AmplTMINLP.hpp.
Referenced by sosConstraints().
Store a suffix handler (since Ipopt does not want to give access to his >:( ).
Definition at line 235 of file AmplTMINLP.hpp.