Bonmin  1.7
Private Attributes
Bonmin::BranchingTQP Class Reference

This is an adapter class that converts a TMINLP2TNLP object into a TNLP, which is now just a QP. More...

#include <BonBranchingTQP.hpp>

List of all members.

Public Member Functions

Constructors/Destructors
 BranchingTQP (Ipopt::SmartPtr< TMINLP2TNLP > tminlp2tnlp)
 Default destructor.
virtual ~BranchingTQP ()
 Default destructor.
methods to gather information about the NLP, only those

that need to be overloaded from TNLP

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 the constraint linearity.
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 the constraint linearity.
virtual bool get_constraints_linearity (Ipopt::Index m, LinearityType *const_types)
 Returns the constraint linearity.
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)
 Method called by Ipopt to get the starting point.
virtual bool eval_f (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number &obj_value)
 Returns the value of the objective function in x.
virtual bool eval_grad_f (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number *grad_f)
 Returns the vector of the gradient of the objective w.r.t.
virtual bool eval_g (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Number *g)
 Returns the vector of constraint values in x.
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)
 Returns the jacobian of the constraints.
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)
 Return the hessian of the lagrangian.
virtual void finalize_solution (Ipopt::SolverReturn status, Ipopt::Index n, const Ipopt::Number *x, const Ipopt::Number *z_L, const Ipopt::Number *z_U, Ipopt::Index m, const Ipopt::Number *g, const Ipopt::Number *lambda, Ipopt::Number obj_value, const Ipopt::IpoptData *ip_data, Ipopt::IpoptCalculatedQuantities *ip_cq)
 Returns the constraint linearity.
const Ipopt::Number ObjVal ()
 Accessor Methods for QP data.
const Ipopt::Number * ObjGrad ()
 Accessor Methods for QP data.
const Ipopt::Number * ObjHessVals ()
 Accessor Methods for QP data.
const Ipopt::Index * ObjHessIRow ()
 Accessor Methods for QP data.
const Ipopt::Index * ObjHessJCol ()
 Accessor Methods for QP data.
const Ipopt::Number * ConstrRhs ()
 Accessor Methods for QP data.
const Ipopt::Number * ConstrJacVals ()
 Accessor Methods for QP data.
const Ipopt::Index * ConstrJacIRow ()
 Accessor Methods for QP data.
const Ipopt::Index * ConstrJacJCol ()
 Accessor Methods for QP data.

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.

 BranchingTQP ()
 Default Constructor.
 BranchingTQP (const BranchingTQP &)
 Copy Constructor.
void operator= (const BranchingTQP &)
 Overloaded Equals Operator.

Private Attributes

Ipopt::Number * x_sol_copy_
 Copy of original x_sol_.
Ipopt::Number * duals_sol_copy_
 Copy of original duals_sol_.
Ipopt::SmartPtr< TMINLP2TNLPtminlp2tnlp_
 Pointer to the TMINLP2TNLP model which stores the bounds information.
static information about the QP's constraints and

objective function

Ipopt::Number obj_val_
Ipopt::Number * obj_grad_
Ipopt::Number * obj_hess_
Ipopt::Index * obj_hess_irow_
Ipopt::Index * obj_hess_jcol_
Ipopt::Number * g_vals_
Ipopt::Number * g_jac_
Ipopt::Index * g_jac_irow_
Ipopt::Index * g_jac_jcol_
Data from the MINLP
Ipopt::Index n_
Ipopt::Index m_
Ipopt::Index nnz_jac_g_
Ipopt::Index nnz_h_lag_
Ipopt::TNLP::IndexStyleEnum index_style_

Detailed Description

This is an adapter class that converts a TMINLP2TNLP object into a TNLP, which is now just a QP.

The QP is the linear quadratic of the TNLP at the optimal point. The purpose of the BranchingTQP is that it is used in a strong-branching framework, strong branching is only done for the QP approximation of the TNLP, not on the TNLP itself. The variables of the QP are the displacement from the reference point.

Definition at line 25 of file BonBranchingTQP.hpp.


Constructor & Destructor Documentation

Bonmin::BranchingTQP::BranchingTQP ( Ipopt::SmartPtr< TMINLP2TNLP tminlp2tnlp)

Default destructor.

virtual Bonmin::BranchingTQP::~BranchingTQP ( ) [virtual]

Default destructor.

Bonmin::BranchingTQP::BranchingTQP ( ) [private]

Default Constructor.

Bonmin::BranchingTQP::BranchingTQP ( const BranchingTQP ) [private]

Copy Constructor.


Member Function Documentation

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

Returns the constraint linearity.

array should be alocated with length at least n. Since this is a QP, all constraints are linear.

virtual bool Bonmin::BranchingTQP::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 
) [virtual]

Returns the constraint linearity.

array should be alocated with length at least n. Since this is a QP, all constraints are linear.

virtual bool Bonmin::BranchingTQP::get_constraints_linearity ( Ipopt::Index  m,
LinearityType *  const_types 
) [virtual]

Returns the constraint linearity.

array should be alocated with length at least n. Since this is a QP, all constraints are linear.

virtual bool Bonmin::BranchingTQP::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 
) [virtual]

Method called by Ipopt to get 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.

virtual bool Bonmin::BranchingTQP::eval_f ( Ipopt::Index  n,
const Ipopt::Number *  x,
bool  new_x,
Ipopt::Number &  obj_value 
) [virtual]

Returns the value of the objective function in x.

virtual bool Bonmin::BranchingTQP::eval_grad_f ( Ipopt::Index  n,
const Ipopt::Number *  x,
bool  new_x,
Ipopt::Number *  grad_f 
) [virtual]

Returns the vector of the gradient of the objective w.r.t.

x

virtual bool Bonmin::BranchingTQP::eval_g ( Ipopt::Index  n,
const Ipopt::Number *  x,
bool  new_x,
Ipopt::Index  m,
Ipopt::Number *  g 
) [virtual]

Returns the vector of constraint values in x.

virtual bool Bonmin::BranchingTQP::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 
) [virtual]

Returns 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.

virtual bool Bonmin::BranchingTQP::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 
) [virtual]

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

virtual void Bonmin::BranchingTQP::finalize_solution ( Ipopt::SolverReturn  status,
Ipopt::Index  n,
const Ipopt::Number *  x,
const Ipopt::Number *  z_L,
const Ipopt::Number *  z_U,
Ipopt::Index  m,
const Ipopt::Number *  g,
const Ipopt::Number *  lambda,
Ipopt::Number  obj_value,
const Ipopt::IpoptData *  ip_data,
Ipopt::IpoptCalculatedQuantities *  ip_cq 
) [virtual]

Returns the constraint linearity.

array should be alocated with length at least n. Since this is a QP, all constraints are linear.

const Ipopt::Number Bonmin::BranchingTQP::ObjVal ( ) [inline]

Accessor Methods for QP data.

Definition at line 102 of file BonBranchingTQP.hpp.

References obj_val_.

const Ipopt::Number* Bonmin::BranchingTQP::ObjGrad ( ) [inline]

Accessor Methods for QP data.

Definition at line 106 of file BonBranchingTQP.hpp.

References obj_grad_.

const Ipopt::Number* Bonmin::BranchingTQP::ObjHessVals ( ) [inline]

Accessor Methods for QP data.

Definition at line 110 of file BonBranchingTQP.hpp.

References obj_hess_.

const Ipopt::Index* Bonmin::BranchingTQP::ObjHessIRow ( ) [inline]

Accessor Methods for QP data.

Definition at line 114 of file BonBranchingTQP.hpp.

References obj_hess_irow_.

const Ipopt::Index* Bonmin::BranchingTQP::ObjHessJCol ( ) [inline]

Accessor Methods for QP data.

Definition at line 118 of file BonBranchingTQP.hpp.

References obj_hess_jcol_.

const Ipopt::Number* Bonmin::BranchingTQP::ConstrRhs ( ) [inline]

Accessor Methods for QP data.

Definition at line 122 of file BonBranchingTQP.hpp.

References g_vals_.

const Ipopt::Number* Bonmin::BranchingTQP::ConstrJacVals ( ) [inline]

Accessor Methods for QP data.

Definition at line 126 of file BonBranchingTQP.hpp.

References g_jac_.

const Ipopt::Index* Bonmin::BranchingTQP::ConstrJacIRow ( ) [inline]

Accessor Methods for QP data.

Definition at line 130 of file BonBranchingTQP.hpp.

References g_jac_irow_.

const Ipopt::Index* Bonmin::BranchingTQP::ConstrJacJCol ( ) [inline]

Accessor Methods for QP data.

Definition at line 134 of file BonBranchingTQP.hpp.

References g_jac_jcol_.

void Bonmin::BranchingTQP::operator= ( const BranchingTQP ) [private]

Overloaded Equals Operator.


Member Data Documentation

Ipopt::Number Bonmin::BranchingTQP::obj_val_ [private]

Definition at line 162 of file BonBranchingTQP.hpp.

Referenced by ObjVal().

Ipopt::Number* Bonmin::BranchingTQP::obj_grad_ [private]

Definition at line 163 of file BonBranchingTQP.hpp.

Referenced by ObjGrad().

Ipopt::Number* Bonmin::BranchingTQP::obj_hess_ [private]

Definition at line 164 of file BonBranchingTQP.hpp.

Referenced by ObjHessVals().

Ipopt::Index* Bonmin::BranchingTQP::obj_hess_irow_ [private]

Definition at line 165 of file BonBranchingTQP.hpp.

Referenced by ObjHessIRow().

Ipopt::Index* Bonmin::BranchingTQP::obj_hess_jcol_ [private]

Definition at line 166 of file BonBranchingTQP.hpp.

Referenced by ObjHessJCol().

Ipopt::Number* Bonmin::BranchingTQP::g_vals_ [private]

Definition at line 167 of file BonBranchingTQP.hpp.

Referenced by ConstrRhs().

Ipopt::Number* Bonmin::BranchingTQP::g_jac_ [private]

Definition at line 168 of file BonBranchingTQP.hpp.

Referenced by ConstrJacVals().

Ipopt::Index* Bonmin::BranchingTQP::g_jac_irow_ [private]

Definition at line 169 of file BonBranchingTQP.hpp.

Referenced by ConstrJacIRow().

Ipopt::Index* Bonmin::BranchingTQP::g_jac_jcol_ [private]

Definition at line 170 of file BonBranchingTQP.hpp.

Referenced by ConstrJacJCol().

Ipopt::Index Bonmin::BranchingTQP::n_ [private]

Definition at line 175 of file BonBranchingTQP.hpp.

Ipopt::Index Bonmin::BranchingTQP::m_ [private]

Definition at line 176 of file BonBranchingTQP.hpp.

Ipopt::Index Bonmin::BranchingTQP::nnz_jac_g_ [private]

Definition at line 177 of file BonBranchingTQP.hpp.

Ipopt::Index Bonmin::BranchingTQP::nnz_h_lag_ [private]

Definition at line 178 of file BonBranchingTQP.hpp.

Ipopt::TNLP::IndexStyleEnum Bonmin::BranchingTQP::index_style_ [private]

Definition at line 179 of file BonBranchingTQP.hpp.

Ipopt::Number* Bonmin::BranchingTQP::x_sol_copy_ [private]

Copy of original x_sol_.

x_sol_ is changed after the first QP has been solved once.

Definition at line 184 of file BonBranchingTQP.hpp.

Ipopt::Number* Bonmin::BranchingTQP::duals_sol_copy_ [private]

Copy of original duals_sol_.

duals_sol_ is changed after the first QP has been solved once.

Definition at line 188 of file BonBranchingTQP.hpp.

Ipopt::SmartPtr<TMINLP2TNLP> Bonmin::BranchingTQP::tminlp2tnlp_ [private]

Pointer to the TMINLP2TNLP model which stores the bounds information.

Definition at line 192 of file BonBranchingTQP.hpp.


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