Bonmin::TMINLP2TNLPQuadCuts Class Reference

This is a derived class fro TMINLP2TNLP to handle adding quadratic cuts. More...

#include <BonTMINLP2Quad.hpp>

Inheritance diagram for Bonmin::TMINLP2TNLPQuadCuts:

Inheritance graph
[legend]
Collaboration diagram for Bonmin::TMINLP2TNLPQuadCuts:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void set_linear_objective (int n_var, const double *obj, double c_0)
 Change objective to a linear one whith given objective function.
void reset_objective ()
 Reset objective to original one.
Constructors/Destructors
 TMINLP2TNLPQuadCuts (const SmartPtr< Bonmin::TMINLP > tminlp)
 TMINLP2TNLPQuadCuts (const TMINLP2TNLPQuadCuts &)
 Copy Constructor.
virtual Bonmin::TMINLP2TNLPclone () const
 Virtual copy.
virtual ~TMINLP2TNLPQuadCuts ()
 Destructor.
methods to gather information about the NLP
virtual bool get_nlp_info (Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, TNLP::IndexStyleEnum &index_style)
 This call is just passed onto parent class and add number of quadratic cuts.
virtual bool get_bounds_info (Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u)
 This call is just passed onto parent class and add bounds of quadratic cuts.
virtual bool get_constraints_linearity (Index m, Ipopt::TNLP::LinearityType *const_types)
 This call is just passed onto parent class and add number of quadratic cuts.
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)
 This call is just passed onto parent class and add lambda for quadratic cuts.
virtual bool get_scaling_parameters (Number &obj_scaling, bool &use_x_scaling, Index n, Number *x_scaling, bool &use_g_scaling, Index m, Number *g_scaling)
 Method that returns scaling parameters (passed to parent all quadratic not scaled).
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 (appends constraint values for quadratics).
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_gi (Index n, const Number *x, bool new_x, Index i, Number &gi)
 compute the value of a single constraint
virtual bool eval_grad_gi (Index n, const Number *x, bool new_x, Index i, Index &nele_grad_gi, Index *jCol, Number *values)
 compute the structure or values of the gradient for one constraint
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.
Cuts management.
void addCuts (const Cuts &cuts, bool safe)
 Method to add quadratic cuts .
void addCuts (const OsiCuts &cuts)
 Method to add OsiCuts figuring out which is quadratic (slow!).
virtual void addCuts (unsigned int numberCuts, const OsiRowCut **cuts)
 Method to add array of OsiRowCut figuring out which is quadratic (slow!).
void removeCuts (unsigned int number, const int *toRemove)
 Method which removes a set of cuts.

Protected Member Functions

void addRowCuts (const OsiCuts &cuts, bool safe)
 Method to add OsiCuts eventualy figuring out which is quadratic.
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.

 TMINLP2TNLPQuadCuts ()
 Default Constructor.
TMINLP2TNLPQuadCutsoperator= (const TMINLP2TNLP &)
 Overloaded Equals Operator.

Private Member Functions

void printH ()
 print H_ for debug.

Private Attributes

vector< QuadRow * > quadRows_
 Some storage for quadratic cuts.
AdjustableMat H_
 Storage for the original hessian of the problem.
int curr_nnz_jac_
 Current umber of entries in the jacobian.
vector< double > obj_
 Store user passed linear objective.
double c_
 constant term in objective function.

Detailed Description

This is a derived class fro TMINLP2TNLP to handle adding quadratic cuts.

Definition at line 22 of file BonTMINLP2Quad.hpp.


Constructor & Destructor Documentation

Bonmin::TMINLP2TNLPQuadCuts::TMINLP2TNLPQuadCuts ( const SmartPtr< Bonmin::TMINLP tminlp  ) 

Definition at line 16 of file BonTMINLP2Quad.cpp.

References curr_nnz_jac_, Bonmin::TMINLP2TNLP::eval_h(), H_, nnz_h, Bonmin::TMINLP2TNLP::nnz_h_lag(), Bonmin::TMINLP2TNLP::nnz_jac_g(), Bonmin::TMINLP2TNLP::num_constraints(), Bonmin::TMINLP2TNLP::num_variables(), and obj_.

Bonmin::TMINLP2TNLPQuadCuts::TMINLP2TNLPQuadCuts ( const TMINLP2TNLPQuadCuts  ) 

Copy Constructor.

Warning:
source and copy point to the same tminlp_.

Definition at line 49 of file BonTMINLP2Quad.cpp.

References Bonmin::TMINLP2TNLP::eval_h(), H_, Bonmin::TMINLP2TNLP::index_style(), m, nnz_h, Bonmin::TMINLP2TNLP::nnz_h_lag(), Bonmin::TMINLP2TNLP::num_constraints(), Bonmin::TMINLP2TNLP::num_variables(), and quadRows_.

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

Destructor.

Definition at line 91 of file BonTMINLP2Quad.cpp.

References quadRows_.

Bonmin::TMINLP2TNLPQuadCuts::TMINLP2TNLPQuadCuts (  )  [protected]

Default Constructor.

Referenced by clone().


Member Function Documentation

virtual Bonmin::TMINLP2TNLP* Bonmin::TMINLP2TNLPQuadCuts::clone (  )  const [inline, virtual]

Virtual copy.

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 41 of file BonTMINLP2Quad.hpp.

References TMINLP2TNLPQuadCuts().

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

This call is just passed onto parent class and add number of quadratic cuts.

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 98 of file BonTMINLP2Quad.cpp.

References curr_nnz_jac_, Bonmin::TMINLP2TNLP::get_nlp_info(), and H_.

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

This call is just passed onto parent class and add bounds of quadratic cuts.

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 109 of file BonTMINLP2Quad.cpp.

References Bonmin::TMINLP2TNLP::get_bounds_info().

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

This call is just passed onto parent class and add number of quadratic cuts.

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

This call is just passed onto parent class and add lambda for quadratic cuts.

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 132 of file BonTMINLP2Quad.cpp.

References Bonmin::TMINLP2TNLP::get_starting_point().

bool Bonmin::TMINLP2TNLPQuadCuts::get_scaling_parameters ( Number &  obj_scaling,
bool &  use_x_scaling,
Index  n,
Number *  x_scaling,
bool &  use_g_scaling,
Index  m,
Number *  g_scaling 
) [virtual]

Method that returns scaling parameters (passed to parent all quadratic not scaled).

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 142 of file BonTMINLP2Quad.cpp.

References Bonmin::TMINLP2TNLP::num_constraints(), and quadRows_.

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

Returns the value of the objective function in x.

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 157 of file BonTMINLP2Quad.cpp.

References c_, Bonmin::TMINLP2TNLP::eval_f(), and obj_.

Referenced by eval_g().

bool Bonmin::TMINLP2TNLPQuadCuts::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

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 176 of file BonTMINLP2Quad.cpp.

References Bonmin::TMINLP2TNLP::eval_grad_f(), and obj_.

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

Returns the vector of constraint values in x (appends constraint values for quadratics).

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 203 of file BonTMINLP2Quad.cpp.

References eval_f(), Bonmin::TMINLP2TNLP::eval_g(), and quadRows_.

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

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 219 of file BonTMINLP2Quad.cpp.

References Bonmin::TMINLP2TNLP::eval_jac_g(), Bonmin::TMINLP2TNLP::index_style(), Bonmin::TMINLP2TNLP::nnz_jac_g(), and quadRows_.

bool Bonmin::TMINLP2TNLPQuadCuts::eval_gi ( Index  n,
const Number *  x,
bool  new_x,
Index  i,
Number &  gi 
) [virtual]

compute the value of a single constraint

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 189 of file BonTMINLP2Quad.cpp.

References Bonmin::TMINLP2TNLP::eval_gi(), Bonmin::TMINLP2TNLP::num_constraints(), and quadRows_.

bool Bonmin::TMINLP2TNLPQuadCuts::eval_grad_gi ( Index  n,
const Number *  x,
bool  new_x,
Index  i,
Index &  nele_grad_gi,
Index *  jCol,
Number *  values 
) [virtual]

compute the structure or values of the gradient for one constraint

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 255 of file BonTMINLP2Quad.cpp.

References Bonmin::TMINLP2TNLP::eval_grad_gi(), Bonmin::TMINLP2TNLP::index_style(), Bonmin::TMINLP2TNLP::num_constraints(), and quadRows_.

bool Bonmin::TMINLP2TNLPQuadCuts::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

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 283 of file BonTMINLP2Quad.cpp.

References Bonmin::TMINLP2TNLP::eval_h(), H_, Bonmin::TMINLP2TNLP::nnz_h_lag(), obj_, and quadRows_.

void Bonmin::TMINLP2TNLPQuadCuts::addCuts ( const Cuts cuts,
bool  safe 
)

Method to add quadratic cuts .

Definition at line 341 of file BonTMINLP2Quad.cpp.

References addRowCuts(), curr_nnz_jac_, Bonmin::TMINLP2TNLP::duals_init_, Bonmin::TMINLP2TNLP::duals_sol_, Bonmin::TMINLP2TNLP::g_l_, Bonmin::TMINLP2TNLP::g_u_, H_, Bonmin::TMINLP2TNLP::index_style(), n, Bonmin::Cuts::quadCut(), quadRows_, Bonmin::Cuts::sizeQuadCuts(), Bonmin::TMINLP2TNLP::x_init_, and Bonmin::TMINLP2TNLP::x_l_.

Referenced by addCuts().

void Bonmin::TMINLP2TNLPQuadCuts::addCuts ( const OsiCuts &  cuts  )  [virtual]

Method to add OsiCuts figuring out which is quadratic (slow!).

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 394 of file BonTMINLP2Quad.cpp.

References addCuts(), and addRowCuts().

void Bonmin::TMINLP2TNLPQuadCuts::addCuts ( unsigned int  numcuts,
const OsiRowCut **  cuts 
) [virtual]

Method to add array of OsiRowCut figuring out which is quadratic (slow!).

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 367 of file BonTMINLP2Quad.cpp.

References curr_nnz_jac_, Bonmin::TMINLP2TNLP::duals_init_, Bonmin::TMINLP2TNLP::duals_sol_, Bonmin::TMINLP2TNLP::g_l_, Bonmin::TMINLP2TNLP::g_u_, H_, Bonmin::TMINLP2TNLP::index_style(), quadRows_, Bonmin::TMINLP2TNLP::x_init_, and Bonmin::TMINLP2TNLP::x_l_.

void Bonmin::TMINLP2TNLPQuadCuts::removeCuts ( unsigned int  number,
const int *  toRemove 
) [virtual]

Method which removes a set of cuts.

Reimplemented from Bonmin::TMINLP2TNLP.

Definition at line 441 of file BonTMINLP2Quad.cpp.

References curr_nnz_jac_, Bonmin::TMINLP2TNLP::g_l(), Bonmin::TMINLP2TNLP::g_l_, Bonmin::TMINLP2TNLP::g_u(), Bonmin::TMINLP2TNLP::g_u_, H_, k, Bonmin::TMINLP2TNLP::num_constraints(), and quadRows_.

void Bonmin::TMINLP2TNLPQuadCuts::set_linear_objective ( int  n_var,
const double *  obj,
double  c_0 
)

Change objective to a linear one whith given objective function.

Definition at line 490 of file BonTMINLP2Quad.cpp.

References c_, Bonmin::TMINLP2TNLP::num_variables(), and obj_.

void Bonmin::TMINLP2TNLPQuadCuts::reset_objective (  )  [inline]

Reset objective to original one.

Definition at line 148 of file BonTMINLP2Quad.hpp.

References obj_.

void Bonmin::TMINLP2TNLPQuadCuts::addRowCuts ( const OsiCuts &  cuts,
bool  safe 
) [protected]

Method to add OsiCuts eventualy figuring out which is quadratic.

Definition at line 408 of file BonTMINLP2Quad.cpp.

References curr_nnz_jac_, Bonmin::TMINLP2TNLP::duals_init_, Bonmin::TMINLP2TNLP::duals_sol_, Bonmin::TMINLP2TNLP::g_l_, Bonmin::TMINLP2TNLP::g_u_, H_, Bonmin::TMINLP2TNLP::index_style(), n, quadRows_, Bonmin::TMINLP2TNLP::x_init_, and Bonmin::TMINLP2TNLP::x_l_.

Referenced by addCuts().

TMINLP2TNLPQuadCuts& Bonmin::TMINLP2TNLPQuadCuts::operator= ( const TMINLP2TNLP  )  [protected]

Overloaded Equals Operator.

Reimplemented from Bonmin::TMINLP2TNLP.

void Bonmin::TMINLP2TNLPQuadCuts::printH (  )  [private]

print H_ for debug.

Definition at line 479 of file BonTMINLP2Quad.cpp.

References H_.


Member Data Documentation

vector<QuadRow *> Bonmin::TMINLP2TNLPQuadCuts::quadRows_ [private]

Some storage for quadratic cuts.

Definition at line 172 of file BonTMINLP2Quad.hpp.

Referenced by addCuts(), addRowCuts(), eval_g(), eval_gi(), eval_grad_gi(), eval_h(), eval_jac_g(), get_scaling_parameters(), removeCuts(), TMINLP2TNLPQuadCuts(), and ~TMINLP2TNLPQuadCuts().

AdjustableMat Bonmin::TMINLP2TNLPQuadCuts::H_ [private]

Storage for the original hessian of the problem.

Definition at line 175 of file BonTMINLP2Quad.hpp.

Referenced by addCuts(), addRowCuts(), eval_h(), get_nlp_info(), printH(), removeCuts(), and TMINLP2TNLPQuadCuts().

int Bonmin::TMINLP2TNLPQuadCuts::curr_nnz_jac_ [private]

Current umber of entries in the jacobian.

Definition at line 180 of file BonTMINLP2Quad.hpp.

Referenced by addCuts(), addRowCuts(), get_nlp_info(), removeCuts(), and TMINLP2TNLPQuadCuts().

vector<double> Bonmin::TMINLP2TNLPQuadCuts::obj_ [private]

Store user passed linear objective.

Definition at line 183 of file BonTMINLP2Quad.hpp.

Referenced by eval_f(), eval_grad_f(), eval_h(), reset_objective(), set_linear_objective(), and TMINLP2TNLPQuadCuts().

double Bonmin::TMINLP2TNLPQuadCuts::c_ [private]

constant term in objective function.

Definition at line 185 of file BonTMINLP2Quad.hpp.

Referenced by eval_f(), and set_linear_objective().


The documentation for this class was generated from the following files:
Generated on Thu Aug 5 03:12:22 2010 by  doxygen 1.4.7