Couenne  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CouenneBranchingObject.hpp
Go to the documentation of this file.
1 /* $Id: CouenneBranchingObject.hpp 925 2012-11-27 19:11:04Z stefan $
2  *
3  * Name: CouenneBranchingObject.hpp
4  * Authors: Pierre Bonami, IBM Corp.
5  * Pietro Belotti, Carnegie Mellon University
6  * Purpose: Branching object for auxiliary variables
7  *
8  * (C) Carnegie-Mellon University, 2006-10.
9  * This file is licensed under the Eclipse Public License (EPL)
10  */
11 
12 #ifndef COUENNEBRANCHINGOBJECT_HPP
13 #define COUENNEBRANCHINGOBJECT_HPP
14 
15 #include "stdio.h"
16 #include "CouenneExprAux.hpp"
17 #include "CouenneJournalist.hpp"
18 #include "OsiBranchingObject.hpp"
19 
20 namespace Couenne {
21 
22 class CouenneCutGenerator;
23 class CouenneProblem;
24 
25 #define COUENNE_CROP 1
26 #define COUENNE_LCROP (1e2*COUENNE_CROP)
27 
28 #define COUENNE_LARGE_INTERVAL 1e4
29 #define COUENNE_NEAR_BOUND 1e-2
30 
31 
37 class CouenneBranchingObject: public OsiTwoWayBranchingObject {
38 
39 public:
40 
42  CouenneBranchingObject (OsiSolverInterface *solver,
43  const OsiObject *originalObject,
44  JnlstPtr jnlst,
46  CouenneProblem *p,
47  expression *var,
48  int way,
49  CouNumber brpoint,
50  bool doFBBT,
51  bool doConvCuts);
52 
55 
56  OsiTwoWayBranchingObject (src),
57  cutGen_ (src.cutGen_),
58  problem_ (src.problem_),
59  variable_ (src.variable_),
60  jnlst_ (src.jnlst_),
61  doFBBT_ (src.doFBBT_),
65  simulate_ (src.simulate_) {}
66 
68  virtual OsiBranchingObject * clone () const
69  {return new CouenneBranchingObject (*this);}
70 
76  virtual double branch (OsiSolverInterface * solver = NULL);
77 
79  virtual bool boundBranch () const
80  {return !doConvCuts_;} // iff it does not add convexification cuts
81 
83  void setSimulate (bool s)
84  {simulate_ = s;}
85 
88  {return variable_;}
89 
91  void branchCore (OsiSolverInterface *, int, int, bool, double, t_chg_bounds *&);
92 
93  // FIXME: horrible global variables. Brrr.
94  static int nOrbBr;
95  static int maxDepthOrbBranch;
96  static int nSGcomputations;
97 
98 protected:
99 
103 
106 
112 
115 
117  bool doFBBT_;
118 
121 
124 
126  double upEstimate_;
127 
129  bool simulate_;
130 };
131 
132 }
133 
134 #endif
Cut Generator for linear convexifications.
CouenneProblem * problem_
Pointer to CouenneProblem (necessary to allow FBBT)
CouenneBranchingObject(const CouenneBranchingObject &src)
Copy constructor.
CouenneCutGenerator * cutGen_
Pointer to CouenneCutGenerator (if any); if not NULL, allows to do extra cut generation during branch...
JnlstPtr jnlst_
SmartPointer to the Journalist.
status of lower/upper bound of a variable, to be checked/modified in bound tightening ...
double downEstimate_
down branch estimate (done at selectBranch with reduced costs)
"Spatial" branching object.
virtual OsiBranchingObject * clone() const
cloning method
expression * variable()
return branching variable
virtual bool boundBranch() const
does this branching object only change variable bounds?
bool doFBBT_
shall we do Feasibility based Bound Tightening (FBBT) at branching?
CouenneBranchingObject(OsiSolverInterface *solver, const OsiObject *originalObject, JnlstPtr jnlst, CouenneCutGenerator *c, CouenneProblem *p, expression *var, int way, CouNumber brpoint, bool doFBBT, bool doConvCuts)
Constructor.
Class for MINLP problems with symbolic information.
void branchCore(OsiSolverInterface *, int, int, bool, double, t_chg_bounds *&)
Perform branching step.
virtual double branch(OsiSolverInterface *solver=NULL)
Execute the actions required to branch, as specified by the current state of the branching object...
double CouNumber
main number type in Couenne
bool simulate_
are we currently in strong branching?
expression * variable_
The index of the variable this branching object refers to.
Expression base class.
bool doConvCuts_
shall we add convexification cuts at branching?
void setSimulate(bool s)
set simulate_ field below