Ipopt::AmplTMINLP Class Reference

Ampl MINLP Interface. More...

#include <AmplTMINLP.hpp>

Inheritance diagram for Ipopt::AmplTMINLP:

Inheritance graph
[legend]
Collaboration diagram for Ipopt::AmplTMINLP:

Collaboration graph
[legend]
List of all members.

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 AmplTMINLPcreateEmpty ()
 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 Journalistjnlst_
 Journlist.
double obj_sign_
 Sign of the objective fn (1 for min, -1 for max).
AmplTNLPampl_tnlp_
 pointer to the internal AmplTNLP
BranchingInfo branch_
 Storage of branching priorities information.
SosInfo sos_
 Storage of sos constraints.
SmartPtr< AmplSuffixHandlersuffix_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
Numbernon_const_x_
 A non-const copy of x - this is kept up-to-date in apply_new_x.
Numberx_sol_
 Solution Vectors.
Numberz_L_sol_
 A non-const copy of x - this is kept up-to-date in apply_new_x.
Numberz_U_sol_
 A non-const copy of x - this is kept up-to-date in apply_new_x.
Numberg_sol_
 A non-const copy of x - this is kept up-to-date in apply_new_x.
Numberlambda_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

Detailed Description

Ampl MINLP Interface.

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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]

Constructor.

Definition at line 62 of file AmplTMINLP.hpp.

virtual bool Ipopt::AmplTMINLP::get_nlp_info ( Index n,
Index m,
Index nnz_jac_g,
Index nnz_h_lag,
TNLP::IndexStyleEnum index_style 
) [virtual]

returns dimensions of the nlp.

Overloaded from TMINLP

Implements Ipopt::TMINLP.

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::get_bounds_info ( Index  n,
Number x_l,
Number x_u,
Index  m,
Number g_l,
Number g_u 
) [virtual]

returns bounds of the nlp.

Overloaded from TMINLP

Implements Ipopt::TMINLP.

virtual bool Ipopt::AmplTMINLP::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 
) [virtual]

provides a starting point for the nlp variables.

Overloaded from TMINLP

Implements Ipopt::TMINLP.

virtual bool Ipopt::AmplTMINLP::eval_f ( Index  n,
const Number x,
bool  new_x,
Number obj_value 
) [virtual]

evaluates the objective value for the nlp.

Overloaded from TMINLP

Implements Ipopt::TMINLP.

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_g ( Index  n,
const Number x,
bool  new_x,
Index  m,
Number g 
) [virtual]

evaluates the constraint residuals 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]

Implements Ipopt::TMINLP.

Definition at line 139 of file AmplTMINLP.hpp.

References branch_.

virtual const SosInfo* Ipopt::AmplTMINLP::sosConstraints (  )  const [inline, virtual]

Implements Ipopt::TMINLP.

Definition at line 144 of file AmplTMINLP.hpp.

References sos_.

virtual void Ipopt::AmplTMINLP::fillApplicationOptions ( AmplOptionsList amplOptList  )  [inline, virtual]

Additional application specific options.

Definition at line 152 of file AmplTMINLP.hpp.

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.

bool Ipopt::AmplTMINLP::internal_conval ( Index  m,
Number g = NULL 
)

Make the constraint call to ampl.

void Ipopt::AmplTMINLP::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 Ipopt::AmplTMINLP::fillAmplOptionList ( AmplOptionsList amplOptList  ) 

Method to add the extra option for ampl.

void Ipopt::AmplTMINLP::operator= ( const AmplTMINLP  ) 

Overloaded Equals Operator.


Member Data Documentation

SmartPtr<const Journalist> Ipopt::AmplTMINLP::jnlst_

Journlist.

Definition at line 160 of file AmplTMINLP.hpp.

double Ipopt::AmplTMINLP::obj_sign_

Sign of the objective fn (1 for min, -1 for max).

Definition at line 163 of file AmplTMINLP.hpp.

Index Ipopt::AmplTMINLP::nz_h_full_

Definition at line 167 of file AmplTMINLP.hpp.

Number* Ipopt::AmplTMINLP::non_const_x_

A non-const copy of x - this is kept up-to-date in apply_new_x.

Definition at line 174 of file AmplTMINLP.hpp.

Number* Ipopt::AmplTMINLP::x_sol_

Solution Vectors.

Definition at line 177 of file AmplTMINLP.hpp.

Number* Ipopt::AmplTMINLP::z_L_sol_

A non-const copy of x - this is kept up-to-date in apply_new_x.

Definition at line 178 of file AmplTMINLP.hpp.

Number* Ipopt::AmplTMINLP::z_U_sol_

A non-const copy of x - this is kept up-to-date in apply_new_x.

Definition at line 179 of file AmplTMINLP.hpp.

Number* Ipopt::AmplTMINLP::g_sol_

A non-const copy of x - this is kept up-to-date in apply_new_x.

Definition at line 180 of file AmplTMINLP.hpp.

Number* Ipopt::AmplTMINLP::lambda_sol_

A non-const copy of x - this is kept up-to-date in apply_new_x.

Definition at line 181 of file AmplTMINLP.hpp.

Number Ipopt::AmplTMINLP::obj_sol_

A non-const copy of x - this is kept up-to-date in apply_new_x.

Definition at line 182 of file AmplTMINLP.hpp.

bool Ipopt::AmplTMINLP::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

Definition at line 190 of file AmplTMINLP.hpp.

bool Ipopt::AmplTMINLP::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

Definition at line 194 of file AmplTMINLP.hpp.

AmplTNLP* Ipopt::AmplTMINLP::ampl_tnlp_

pointer to the internal AmplTNLP

Definition at line 228 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().

SmartPtr<AmplSuffixHandler> Ipopt::AmplTMINLP::suffix_handler_

Store a suffix handler (since Ipopt does not want to give access to his >:( ).

Definition at line 235 of file AmplTMINLP.hpp.


The documentation for this class was generated from the following file:
Generated on Fri May 16 21:16:51 2008 for Bonmin by  doxygen 1.4.7