Public Member Functions | Private Attributes | List of all members
MyTMINLP Class Reference

A C++ example for interfacing an MINLP with bonmin. More...

#include <MyTMINLP.hpp>

Inheritance diagram for MyTMINLP:
Inheritance graph
[legend]
Collaboration diagram for MyTMINLP:
Collaboration graph
[legend]

Public Member Functions

 MyTMINLP ()
 Default constructor. More...
 
virtual ~MyTMINLP ()
 virtual destructor. More...
 
 MyTMINLP (const MyTMINLP &other)
 Copy constructor. More...
 
virtual const SosInfososConstraints () const
 
virtual const BranchingInfobranchingInfo () const
 
void printSolutionAtEndOfAlgorithm ()
 
 MyTMINLP ()
 Default constructor. More...
 
virtual ~MyTMINLP ()
 virtual destructor. More...
 
 MyTMINLP (const MyTMINLP &other)
 Copy constructor. More...
 
virtual const SosInfososConstraints () const
 
virtual const BranchingInfobranchingInfo () const
 
void printSolutionAtEndOfAlgorithm ()
 
Overloaded functions specific to a TMINLP.

Assignment operator.

no data = nothing to assign

virtual bool get_variables_types (Index n, VariableType *var_types)
 Pass the type of the variables (INTEGER, BINARY, CONTINUOUS) to the optimizer. More...
 
virtual bool get_variables_linearity (Index n, Ipopt::TNLP::LinearityType *var_types)
 Pass info about linear and nonlinear variables. More...
 
virtual bool get_constraints_linearity (Index m, Ipopt::TNLP::LinearityType *const_types)
 Pass the type of the constraints (LINEAR, NON_LINEAR) to the optimizer. More...
 
virtual bool get_variables_types (Index n, VariableType *var_types)
 Pass the type of the variables (INTEGER, BINARY, CONTINUOUS) to the optimizer. More...
 
virtual bool get_variables_linearity (Index n, Ipopt::TNLP::LinearityType *var_types)
 Pass info about linear and nonlinear variables. More...
 
virtual bool get_constraints_linearity (Index m, Ipopt::TNLP::LinearityType *const_types)
 Pass the type of the constraints (LINEAR, NON_LINEAR) to the optimizer. More...
 
Overloaded functions defining a TNLP.

This group of function implement the various elements needed to define and solve a TNLP.

They are the same as those in a standard Ipopt NLP problem

virtual bool get_nlp_info (Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, TNLP::IndexStyleEnum &index_style)
 Method to pass the main dimensions of the problem to Ipopt. More...
 
virtual bool get_bounds_info (Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u)
 Method to pass the bounds on variables and constraints to Ipopt. More...
 
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)
 Method to to pass the starting point for optimization to Ipopt. More...
 
virtual bool eval_f (Index n, const Number *x, bool new_x, Number &obj_value)
 Method which compute the value of the objective function at point x. More...
 
virtual bool eval_grad_f (Index n, const Number *x, bool new_x, Number *grad_f)
 Method which compute the gradient of the objective at a point x. More...
 
virtual bool eval_g (Index n, const Number *x, bool new_x, Index m, Number *g)
 Method which compute the value of the functions defining the constraints at a point x. More...
 
virtual bool eval_jac_g (Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values)
 Method to compute the Jacobian of the functions defining the constraints. More...
 
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)
 Method to compute the Jacobian of the functions defining the constraints. More...
 
virtual void finalize_solution (TMINLP::SolverReturn status, Index n, const Number *x, Number obj_value)
 Method called by Ipopt at the end of optimization. More...
 
virtual bool get_nlp_info (Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, TNLP::IndexStyleEnum &index_style)
 Method to pass the main dimensions of the problem to Ipopt. More...
 
virtual bool get_bounds_info (Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u)
 Method to pass the bounds on variables and constraints to Ipopt. More...
 
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)
 Method to to pass the starting point for optimization to Ipopt. More...
 
virtual bool eval_f (Index n, const Number *x, bool new_x, Number &obj_value)
 Method which compute the value of the objective function at point x. More...
 
virtual bool eval_grad_f (Index n, const Number *x, bool new_x, Number *grad_f)
 Method which compute the gradient of the objective at a point x. More...
 
virtual bool eval_g (Index n, const Number *x, bool new_x, Index m, Number *g)
 Method which compute the value of the functions defining the constraints at a point x. More...
 
virtual bool eval_jac_g (Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values)
 Method to compute the Jacobian of the functions defining the constraints. More...
 
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)
 Method to compute the Jacobian of the functions defining the constraints. More...
 
virtual void finalize_solution (TMINLP::SolverReturn status, Index n, const Number *x, Number obj_value)
 Method called by Ipopt at the end of optimization. More...
 
- Public Member Functions inherited from Bonmin::TMINLP
virtual const PerturbInfoperturbInfo () const
 
virtual bool hasUpperBoundingObjective ()
 Say if has a specific function to compute upper bounds. More...
 
virtual bool eval_upper_bound_f (Ipopt::Index n, const Ipopt::Number *x, Ipopt::Number &obj_value)
 overload this method to return the value of an alternative objective function for upper bounding (to use it hasUpperBoundingObjective should return true). More...
 
virtual bool get_constraint_convexities (int m, TMINLP::Convexity *constraints_convexities) const
 Get accest to constraint convexities. More...
 
virtual bool get_number_nonconvex (int &number_non_conv, int &number_concave) const
 Get dimension information on nonconvex constraints. More...
 
virtual bool get_constraint_convexities (int number_non_conv, MarkedNonConvex *non_convs) const
 Get array describing the constraints marked nonconvex in the model. More...
 
virtual bool get_simple_concave_constraints (int number_concave, SimpleConcaveConstraint *simple_concave) const
 Fill array containing indices of simple concave constraints. More...
 
virtual bool hasLinearObjective ()
 Say if problem has a linear objective (for OA) More...
 
bool hasGeneralInteger ()
 Say if problem has general integer variables. More...
 
virtual const intget_const_xtra_id () const
 Access array describing constraint to which perspectives should be applied. More...
 
 TMINLP ()
 Default destructor. More...
 
virtual ~TMINLP ()
 Default destructor. More...
 
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)=0
 overload this method to return the number of variables and constraints, and the number of non-zeros in the jacobian and the hessian. More...
 
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)
 overload this method to return scaling parameters. More...
 
virtual bool get_variables_types (Ipopt::Index n, VariableType *var_types)=0
 overload this method to provide the variables types. More...
 
virtual bool get_variables_linearity (Ipopt::Index n, Ipopt::TNLP::LinearityType *var_types)=0
 overload this method to provide the variables linearity. More...
 
virtual bool get_constraints_linearity (Ipopt::Index m, Ipopt::TNLP::LinearityType *const_types)=0
 overload this method to provide the constraint linearity. More...
 
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)=0
 overload this method to return the information about the bound on the variables and constraints. More...
 
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)=0
 overload this method to return the starting point. More...
 
virtual bool eval_f (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number &obj_value)=0
 overload this method to return the value of the objective function More...
 
virtual bool eval_grad_f (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number *grad_f)=0
 overload this method to return the vector of the gradient of the objective w.r.t. More...
 
virtual bool eval_g (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Number *g)=0
 overload this method to return the vector of constraint values More...
 
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)=0
 overload this method to return the jacobian of the constraints. More...
 
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)=0
 overload this method to return the hessian of the lagrangian. More...
 
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. More...
 
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. More...
 
virtual void finalize_solution (TMINLP::SolverReturn status, Ipopt::Index n, const Ipopt::Number *x, Ipopt::Number obj_value)=0
 This method is called when the algorithm is complete so the TNLP can store/write the solution. More...
 

Private Attributes

bool printSol_
 

Additional Inherited Members

- Public Types inherited from Bonmin::TMINLP
enum  SolverReturn {
  SUCCESS, INFEASIBLE, CONTINUOUS_UNBOUNDED, LIMIT_EXCEEDED,
  USER_INTERRUPT, MINLP_ERROR
}
 Return statuses of algorithm. More...
 
enum  VariableType { CONTINUOUS, BINARY, INTEGER }
 Type of the variables. More...
 
enum  Convexity { Convex, NonConvex, SimpleConcave }
 Used to mark constraints of the problem. More...
 
- Protected Member Functions inherited from Bonmin::TMINLP
 TMINLP (const TMINLP &)
 Copy constructor. More...
 
void operator= (const TMINLP &)
 Overloaded Equals Operator. More...
 

Detailed Description

A C++ example for interfacing an MINLP with bonmin.

This class implements the following NLP :

\[ \begin{array}{l} \min - x_0 - x_1 - x_2 \\ \mbox{s.t}\\ (x_1 - \frac{1}{2})^2 + (x_2 - \frac{1}{2})^2 \leq \frac{1}{4} \\ x_0 - x_1 \leq 0 \\ x_0 + x_2 + x_3 \leq 2\\ x_0 \in \{0,1\}^n \; (x_1, x_2) \in R^2 \; x_3 \in N \end{array} \]

This class implements the following NLP :

\[ \begin{array}{l} \min x_0 - x_1 - x_2 \\ \mbox{s.t}\\ (x_1 - \frac{1}{2})^2 + (x_2 - \frac{1}{2})^2 \leq \frac{1}{4} \\ x_0 - x_1 \leq 0 \\ x_1 + x_2 + x_3 \leq 2\\ x_0 \in \{0,1\}^n \; (x_1, x_2) \in R^2 \; x_3 \in N \end{array} \]

Definition at line 28 of file MyTMINLP.hpp.

Constructor & Destructor Documentation

MyTMINLP::MyTMINLP ( )
inline

Default constructor.

Definition at line 32 of file MyTMINLP.hpp.

virtual MyTMINLP::~MyTMINLP ( )
inlinevirtual

virtual destructor.

Definition at line 36 of file MyTMINLP.hpp.

MyTMINLP::MyTMINLP ( const MyTMINLP other)
inline

Copy constructor.

Definition at line 40 of file MyTMINLP.hpp.

MyTMINLP::MyTMINLP ( )
inline

Default constructor.

Definition at line 32 of file MyTMINLP.hpp.

virtual MyTMINLP::~MyTMINLP ( )
inlinevirtual

virtual destructor.

Definition at line 36 of file MyTMINLP.hpp.

MyTMINLP::MyTMINLP ( const MyTMINLP other)
inline

Copy constructor.

Definition at line 40 of file MyTMINLP.hpp.

Member Function Documentation

bool MyTMINLP::get_variables_types ( Index  n,
VariableType var_types 
)
virtual

Pass the type of the variables (INTEGER, BINARY, CONTINUOUS) to the optimizer.

Parameters
nsize of var_types (has to be equal to the number of variables in the problem)
var_typestypes of the variables (has to be filled by function).

Definition at line 13 of file MyTMINLP.cpp.

bool MyTMINLP::get_variables_linearity ( Index  n,
Ipopt::TNLP::LinearityType *  var_types 
)
virtual

Pass info about linear and nonlinear variables.

Definition at line 24 of file MyTMINLP.cpp.

bool MyTMINLP::get_constraints_linearity ( Index  m,
Ipopt::TNLP::LinearityType *  const_types 
)
virtual

Pass the type of the constraints (LINEAR, NON_LINEAR) to the optimizer.

Parameters
msize of const_types (has to be equal to the number of constraints in the problem)
const_typestypes of the constraints (has to be filled by function).

Definition at line 35 of file MyTMINLP.cpp.

bool MyTMINLP::get_nlp_info ( Index &  n,
Index &  m,
Index &  nnz_jac_g,
Index &  nnz_h_lag,
TNLP::IndexStyleEnum &  index_style 
)
virtual

Method to pass the main dimensions of the problem to Ipopt.

Parameters
nnumber of variables in problem.
mnumber of constraints.
nnz_jac_gnumber of nonzeroes in Jacobian of constraints system.
nnz_h_lagnumber of nonzeroes in Hessian of the Lagrangean.
index_styleindicate wether arrays are numbered from 0 (C-style) or from 1 (Fortran).
Returns
true in case of success.

Definition at line 44 of file MyTMINLP.cpp.

bool MyTMINLP::get_bounds_info ( Index  n,
Number *  x_l,
Number *  x_u,
Index  m,
Number *  g_l,
Number *  g_u 
)
virtual

Method to pass the bounds on variables and constraints to Ipopt.

 \param n size of x_l and x_u (has to be equal to the number of variables in the problem)
 \param x_l lower bounds on variables (function should fill it).
 \param x_u upper bounds on the variables (function should fill it).
 \param m size of g_l and g_u (has to be equal to the number of constraints in the problem).
 \param g_l lower bounds of the constraints (function should fill it).
 \param g_u upper bounds of the constraints (function should fill it).
Returns
true in case of success.

Definition at line 56 of file MyTMINLP.cpp.

bool MyTMINLP::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

Method to to pass the starting point for optimization to Ipopt.

Parameters
init_xdo we initialize primals?
xpass starting primal points (function should fill it if init_x is 1).
msize of lambda (has to be equal to the number of constraints in the problem).
init_lambdado we initialize duals of constraints?
lambdalower bounds of the constraints (function should fill it).
Returns
true in case of success.

Definition at line 85 of file MyTMINLP.cpp.

bool MyTMINLP::eval_f ( Index  n,
const Number *  x,
bool  new_x,
Number &  obj_value 
)
virtual

Method which compute the value of the objective function at point x.

Parameters
nsize of array x (has to be the number of variables in the problem).
xpoint where to evaluate.
new_xIs this the first time we evaluate functions at this point? (in the present context we don't care).
obj_valuevalue of objective in x (has to be computed by the function).
Returns
true in case of success.

Definition at line 103 of file MyTMINLP.cpp.

bool MyTMINLP::eval_grad_f ( Index  n,
const Number *  x,
bool  new_x,
Number *  grad_f 
)
virtual

Method which compute the gradient of the objective at a point x.

Parameters
nsize of array x (has to be the number of variables in the problem).
xpoint where to evaluate.
new_xIs this the first time we evaluate functions at this point? (in the present context we don't care).
grad_fgradient of objective taken in x (function has to fill it).
Returns
true in case of success.

Definition at line 111 of file MyTMINLP.cpp.

bool MyTMINLP::eval_g ( Index  n,
const Number *  x,
bool  new_x,
Index  m,
Number *  g 
)
virtual

Method which compute the value of the functions defining the constraints at a point x.

Parameters
nsize of array x (has to be the number of variables in the problem).
xpoint where to evaluate.
new_xIs this the first time we evaluate functions at this point? (in the present context we don't care).
msize of array g (has to be equal to the number of constraints in the problem)
grad_fvalues of the constraints (function has to fill it).
Returns
true in case of success.

Definition at line 122 of file MyTMINLP.cpp.

bool MyTMINLP::eval_jac_g ( Index  n,
const Number *  x,
bool  new_x,
Index  m,
Index  nele_jac,
Index *  iRow,
Index *  jCol,
Number *  values 
)
virtual

Method to compute the Jacobian of the functions defining the constraints.

If the parameter values==NULL fill the arrays iCol and jRow which store the position of the non-zero element of the Jacobian. If the paramenter values!=NULL fill values with the non-zero elements of the Jacobian.

Parameters
nsize of array x (has to be the number of variables in the problem).
xpoint where to evaluate.
new_xIs this the first time we evaluate functions at this point? (in the present context we don't care).
msize of array g (has to be equal to the number of constraints in the problem)
grad_fvalues of the constraints (function has to fill it).
Returns
true in case of success.

Definition at line 135 of file MyTMINLP.cpp.

bool MyTMINLP::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

Method to compute the Jacobian of the functions defining the constraints.

If the parameter values==NULL fill the arrays iCol and jRow which store the position of the non-zero element of the Jacobian. If the paramenter values!=NULL fill values with the non-zero elements of the Jacobian.

Parameters
nsize of array x (has to be the number of variables in the problem).
xpoint where to evaluate.
new_xIs this the first time we evaluate functions at this point? (in the present context we don't care).
msize of array g (has to be equal to the number of constraints in the problem)
grad_fvalues of the constraints (function has to fill it).
Returns
true in case of success.

Definition at line 181 of file MyTMINLP.cpp.

void MyTMINLP::finalize_solution ( TMINLP::SolverReturn  status,
Index  n,
const Number *  x,
Number  obj_value 
)
virtual

Method called by Ipopt at the end of optimization.

Definition at line 205 of file MyTMINLP.cpp.

virtual const SosInfo* MyTMINLP::sosConstraints ( ) const
inlinevirtual

Implements Bonmin::TMINLP.

Definition at line 169 of file MyTMINLP.hpp.

virtual const BranchingInfo* MyTMINLP::branchingInfo ( ) const
inlinevirtual

Implements Bonmin::TMINLP.

Definition at line 170 of file MyTMINLP.hpp.

void MyTMINLP::printSolutionAtEndOfAlgorithm ( )
inline

Definition at line 173 of file MyTMINLP.hpp.

virtual bool MyTMINLP::get_variables_types ( Index  n,
VariableType var_types 
)
virtual

Pass the type of the variables (INTEGER, BINARY, CONTINUOUS) to the optimizer.

Parameters
nsize of var_types (has to be equal to the number of variables in the problem)
var_typestypes of the variables (has to be filled by function).
virtual bool MyTMINLP::get_variables_linearity ( Index  n,
Ipopt::TNLP::LinearityType *  var_types 
)
virtual

Pass info about linear and nonlinear variables.

virtual bool MyTMINLP::get_constraints_linearity ( Index  m,
Ipopt::TNLP::LinearityType *  const_types 
)
virtual

Pass the type of the constraints (LINEAR, NON_LINEAR) to the optimizer.

Parameters
msize of const_types (has to be equal to the number of constraints in the problem)
const_typestypes of the constraints (has to be filled by function).
virtual bool MyTMINLP::get_nlp_info ( Index &  n,
Index &  m,
Index &  nnz_jac_g,
Index &  nnz_h_lag,
TNLP::IndexStyleEnum &  index_style 
)
virtual

Method to pass the main dimensions of the problem to Ipopt.

Parameters
nnumber of variables in problem.
mnumber of constraints.
nnz_jac_gnumber of nonzeroes in Jacobian of constraints system.
nnz_h_lagnumber of nonzeroes in Hessian of the Lagrangean.
index_styleindicate wether arrays are numbered from 0 (C-style) or from 1 (Fortran).
Returns
true in case of success.
virtual bool MyTMINLP::get_bounds_info ( Index  n,
Number *  x_l,
Number *  x_u,
Index  m,
Number *  g_l,
Number *  g_u 
)
virtual

Method to pass the bounds on variables and constraints to Ipopt.

 \param n size of x_l and x_u (has to be equal to the number of variables in the problem)
 \param x_l lower bounds on variables (function should fill it).
 \param x_u upper bounds on the variables (function should fill it).
 \param m size of g_l and g_u (has to be equal to the number of constraints in the problem).
 \param g_l lower bounds of the constraints (function should fill it).
 \param g_u upper bounds of the constraints (function should fill it).
Returns
true in case of success.
virtual bool MyTMINLP::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

Method to to pass the starting point for optimization to Ipopt.

Parameters
init_xdo we initialize primals?
xpass starting primal points (function should fill it if init_x is 1).
msize of lambda (has to be equal to the number of constraints in the problem).
init_lambdado we initialize duals of constraints?
lambdalower bounds of the constraints (function should fill it).
Returns
true in case of success.
virtual bool MyTMINLP::eval_f ( Index  n,
const Number *  x,
bool  new_x,
Number &  obj_value 
)
virtual

Method which compute the value of the objective function at point x.

Parameters
nsize of array x (has to be the number of variables in the problem).
xpoint where to evaluate.
new_xIs this the first time we evaluate functions at this point? (in the present context we don't care).
obj_valuevalue of objective in x (has to be computed by the function).
Returns
true in case of success.
virtual bool MyTMINLP::eval_grad_f ( Index  n,
const Number *  x,
bool  new_x,
Number *  grad_f 
)
virtual

Method which compute the gradient of the objective at a point x.

Parameters
nsize of array x (has to be the number of variables in the problem).
xpoint where to evaluate.
new_xIs this the first time we evaluate functions at this point? (in the present context we don't care).
grad_fgradient of objective taken in x (function has to fill it).
Returns
true in case of success.
virtual bool MyTMINLP::eval_g ( Index  n,
const Number *  x,
bool  new_x,
Index  m,
Number *  g 
)
virtual

Method which compute the value of the functions defining the constraints at a point x.

Parameters
nsize of array x (has to be the number of variables in the problem).
xpoint where to evaluate.
new_xIs this the first time we evaluate functions at this point? (in the present context we don't care).
msize of array g (has to be equal to the number of constraints in the problem)
grad_fvalues of the constraints (function has to fill it).
Returns
true in case of success.
virtual bool MyTMINLP::eval_jac_g ( Index  n,
const Number *  x,
bool  new_x,
Index  m,
Index  nele_jac,
Index *  iRow,
Index *  jCol,
Number *  values 
)
virtual

Method to compute the Jacobian of the functions defining the constraints.

If the parameter values==NULL fill the arrays iCol and jRow which store the position of the non-zero element of the Jacobian. If the paramenter values!=NULL fill values with the non-zero elements of the Jacobian.

Parameters
nsize of array x (has to be the number of variables in the problem).
xpoint where to evaluate.
new_xIs this the first time we evaluate functions at this point? (in the present context we don't care).
msize of array g (has to be equal to the number of constraints in the problem)
grad_fvalues of the constraints (function has to fill it).
Returns
true in case of success.
virtual bool MyTMINLP::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

Method to compute the Jacobian of the functions defining the constraints.

If the parameter values==NULL fill the arrays iCol and jRow which store the position of the non-zero element of the Jacobian. If the paramenter values!=NULL fill values with the non-zero elements of the Jacobian.

Parameters
nsize of array x (has to be the number of variables in the problem).
xpoint where to evaluate.
new_xIs this the first time we evaluate functions at this point? (in the present context we don't care).
msize of array g (has to be equal to the number of constraints in the problem)
grad_fvalues of the constraints (function has to fill it).
Returns
true in case of success.
virtual void MyTMINLP::finalize_solution ( TMINLP::SolverReturn  status,
Index  n,
const Number *  x,
Number  obj_value 
)
virtual

Method called by Ipopt at the end of optimization.

virtual const SosInfo* MyTMINLP::sosConstraints ( ) const
inlinevirtual

Implements Bonmin::TMINLP.

Definition at line 169 of file MyTMINLP.hpp.

virtual const BranchingInfo* MyTMINLP::branchingInfo ( ) const
inlinevirtual

Implements Bonmin::TMINLP.

Definition at line 170 of file MyTMINLP.hpp.

void MyTMINLP::printSolutionAtEndOfAlgorithm ( )
inline

Definition at line 173 of file MyTMINLP.hpp.

Member Data Documentation

bool MyTMINLP::printSol_
private

Definition at line 177 of file MyTMINLP.hpp.


The documentation for this class was generated from the following files: