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 (SmartPtr< TMINLP2TNLP > tminlp2tnlp)
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 (Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style)
virtual bool get_bounds_info (Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u)
virtual bool get_constraints_linearity (Index m, LinearityType *const_types)
 Returns the constraint linearity.
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 called by Ipopt to get the starting point.
virtual bool eval_f (Index n, const Number *x, bool new_x, Number &obj_value)
 Returns the value of the objective function in x.
virtual bool eval_grad_f (Index n, const Number *x, bool new_x, Number *grad_f)
 Returns 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)
 Returns the vector of constraint values in x.
virtual bool eval_jac_g (Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values)
 Returns 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)
 Return the hessian of the lagrangian.
virtual void finalize_solution (SolverReturn status, Index n, const Number *x, const Number *z_L, const Number *z_U, Index m, const Number *g, const Number *lambda, Number obj_value, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq)
const Number ObjVal ()
 Accessor Methods for QP data.
const Number * ObjGrad ()
 Accessor Methods for QP data.
const Number * ObjHessVals ()
 Accessor Methods for QP data.
const Index * ObjHessIRow ()
 Accessor Methods for QP data.
const Index * ObjHessJCol ()
 Accessor Methods for QP data.
const Number * ConstrRhs ()
 Accessor Methods for QP data.
const Number * ConstrJacVals ()
 Accessor Methods for QP data.
const Index * ConstrJacIRow ()
 Accessor Methods for QP data.
const 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

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

Number obj_val_
Number * obj_grad_
Number * obj_hess_
Index * obj_hess_irow_
Index * obj_hess_jcol_
Number * g_vals_
Number * g_jac_
Index * g_jac_irow_
Index * g_jac_jcol_
Data from the MINLP
Index n_
Index m_
Index nnz_jac_g_
Index nnz_h_lag_
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 ( SmartPtr< TMINLP2TNLP tminlp2tnlp  ) 

Definition at line 19 of file BonBranchingTQP.cpp.

References duals_sol_copy_, g_jac_, g_jac_irow_, g_jac_jcol_, g_vals_, index_style_, m_, n_, nnz_h_lag_, nnz_jac_g_, obj_grad_, obj_hess_, obj_hess_irow_, obj_hess_jcol_, obj_val_, tminlp2tnlp_, and x_sol_copy_.

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

Default destructor.

Definition at line 107 of file BonBranchingTQP.cpp.

References duals_sol_copy_, g_jac_, g_jac_irow_, g_jac_jcol_, g_vals_, obj_grad_, obj_hess_, obj_hess_irow_, obj_hess_jcol_, and x_sol_copy_.

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

Default Constructor.

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

Copy Constructor.


Member Function Documentation

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

Definition at line 121 of file BonBranchingTQP.cpp.

References index_style_, m_, n_, nnz_h_lag_, and nnz_jac_g_.

bool Bonmin::BranchingTQP::get_bounds_info ( Index  n,
Number *  x_l,
Number *  x_u,
Index  m,
Number *  g_l,
Number *  g_u 
) [virtual]

Definition at line 133 of file BonBranchingTQP.cpp.

References g_vals_, m_, n_, tminlp2tnlp_, and x_sol_copy_.

bool Bonmin::BranchingTQP::get_constraints_linearity ( 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.

Definition at line 181 of file BonBranchingTQP.cpp.

References LINEAR.

bool Bonmin::BranchingTQP::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 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.

Definition at line 152 of file BonBranchingTQP.cpp.

References duals_sol_copy_, m_, and n_.

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

Returns the value of the objective function in x.

Definition at line 189 of file BonBranchingTQP.cpp.

References irow, n_, nnz_h_lag_, obj_grad_, obj_hess_, obj_hess_irow_, and obj_hess_jcol_.

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

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

x

Definition at line 209 of file BonBranchingTQP.cpp.

References irow, n_, nnz_h_lag_, obj_grad_, obj_hess_, obj_hess_irow_, and obj_hess_jcol_.

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

Returns the vector of constraint values in x.

Definition at line 227 of file BonBranchingTQP.cpp.

References g_jac_, g_jac_irow_, g_jac_jcol_, irow, m_, n_, and nnz_jac_g_.

bool Bonmin::BranchingTQP::eval_jac_g ( Index  n,
const Number *  x,
bool  new_x,
Index  m,
Index  nele_jac,
Index *  iRow,
Index *  jCol,
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.

Definition at line 243 of file BonBranchingTQP.cpp.

References g_jac_, g_jac_irow_, g_jac_jcol_, index_style_, and nnz_jac_g_.

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

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

Definition at line 270 of file BonBranchingTQP.cpp.

References index_style_, nnz_h_lag_, obj_hess_, obj_hess_irow_, and obj_hess_jcol_.

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

Definition at line 309 of file BonBranchingTQP.cpp.

References obj_val_, tminlp2tnlp_, and x_sol_copy_.

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

Accessor Methods for QP data.

Definition at line 102 of file BonBranchingTQP.hpp.

References obj_val_.

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

Accessor Methods for QP data.

Definition at line 106 of file BonBranchingTQP.hpp.

References obj_grad_.

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

Accessor Methods for QP data.

Definition at line 110 of file BonBranchingTQP.hpp.

References obj_hess_.

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

Accessor Methods for QP data.

Definition at line 114 of file BonBranchingTQP.hpp.

References obj_hess_irow_.

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

Accessor Methods for QP data.

Definition at line 118 of file BonBranchingTQP.hpp.

References obj_hess_jcol_.

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

Accessor Methods for QP data.

Definition at line 122 of file BonBranchingTQP.hpp.

References g_vals_.

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

Accessor Methods for QP data.

Definition at line 126 of file BonBranchingTQP.hpp.

References g_jac_.

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

Accessor Methods for QP data.

Definition at line 130 of file BonBranchingTQP.hpp.

References g_jac_irow_.

const 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

Number Bonmin::BranchingTQP::obj_val_ [private]

Definition at line 162 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), finalize_solution(), and ObjVal().

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

Definition at line 163 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), eval_f(), eval_grad_f(), ObjGrad(), and ~BranchingTQP().

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

Definition at line 164 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), eval_f(), eval_grad_f(), eval_h(), ObjHessVals(), and ~BranchingTQP().

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

Definition at line 165 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), eval_f(), eval_grad_f(), eval_h(), ObjHessIRow(), and ~BranchingTQP().

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

Definition at line 166 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), eval_f(), eval_grad_f(), eval_h(), ObjHessJCol(), and ~BranchingTQP().

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

Definition at line 167 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), ConstrRhs(), get_bounds_info(), and ~BranchingTQP().

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

Definition at line 168 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), ConstrJacVals(), eval_g(), eval_jac_g(), and ~BranchingTQP().

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

Definition at line 169 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), ConstrJacIRow(), eval_g(), eval_jac_g(), and ~BranchingTQP().

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

Definition at line 170 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), ConstrJacJCol(), eval_g(), eval_jac_g(), and ~BranchingTQP().

Index Bonmin::BranchingTQP::n_ [private]

Definition at line 175 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), eval_f(), eval_g(), eval_grad_f(), get_bounds_info(), get_nlp_info(), and get_starting_point().

Index Bonmin::BranchingTQP::m_ [private]

Definition at line 176 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), eval_g(), get_bounds_info(), get_nlp_info(), and get_starting_point().

Index Bonmin::BranchingTQP::nnz_jac_g_ [private]

Definition at line 177 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), eval_g(), eval_jac_g(), and get_nlp_info().

Index Bonmin::BranchingTQP::nnz_h_lag_ [private]

Definition at line 178 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), eval_f(), eval_grad_f(), eval_h(), and get_nlp_info().

IndexStyleEnum Bonmin::BranchingTQP::index_style_ [private]

Definition at line 179 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), eval_h(), eval_jac_g(), and get_nlp_info().

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.

Referenced by BranchingTQP(), finalize_solution(), get_bounds_info(), and ~BranchingTQP().

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.

Referenced by BranchingTQP(), get_starting_point(), and ~BranchingTQP().

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

Pointer to the TMINLP2TNLP model which stores the bounds information.

Definition at line 192 of file BonBranchingTQP.hpp.

Referenced by BranchingTQP(), finalize_solution(), and get_bounds_info().


The documentation for this class was generated from the following files:
Generated on Thu Oct 8 03:08:52 2009 by  doxygen 1.4.7