Cbc  2.9.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CbcBranchLink.hpp
Go to the documentation of this file.
1 // $Id: CbcBranchLink.hpp 1900 2013-04-10 13:30:07Z forrest $
2 // Copyright (C) 2005, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 #ifndef CbcBranchLink_H
7 #define CbcBranchLink_H
8 
9 #include "CbcBranchBase.hpp"
10 
16 class CbcLink : public CbcObject {
17 
18 public:
19 
20  // Default Constructor
21  CbcLink ();
22 
30  int numberLinks, int first,
31  const double * weights, int setNumber);
38  CbcLink (CbcModel * model, int numberMembers,
39  int numberLinks, int typeSOS, const int * which,
40  const double * weights, int setNumber);
41 
42  // Copy constructor
43  CbcLink ( const CbcLink &);
44 
46  virtual CbcObject * clone() const;
47 
48  // Assignment operator
49  CbcLink & operator=( const CbcLink& rhs);
50 
51  // Destructor
52  ~CbcLink ();
53 
55  virtual double infeasibility(int & preferredWay) const;
56 
58  virtual void feasibleRegion();
60  virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
61 
63  inline int numberMembers() const
64  {return numberMembers_;}
65 
67  inline int numberLinks() const
68  {return numberLinks_;}
69 
71  inline const int * which() const
72  {return which_;}
73 
75  inline const double * weights() const
76  { return weights_;}
77 
78 private:
80 
82  double * weights_;
83 
89  int * which_;
91  int sosType_;
92 };
99 
100 public:
101 
102  // Default Constructor
104 
105  // Useful constructor
107  int way,
108  double separator);
109 
110  // Copy constructor
112 
113  // Assignment operator
115 
117  virtual CbcBranchingObject * clone() const;
118 
119  // Destructor
120  virtual ~CbcLinkBranchingObject ();
121 
123  virtual double branch();
124 
127  virtual void print();
129  virtual CbcBranchObjType type() const
130  { return CbcBranchObjType(0);} /*FIXME what type() should be returned here? */
131 
141  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
142 private:
144  const CbcLink * set_;
146  double separator_;
147 };
148 #endif
const CbcLink * set_
data
virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
Compare the this with brObj.
CbcRangeCompare
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
int preferredWay() const
If -1 down always chosen first, +1 up always, 0 normal.
Definition: CbcObject.hpp:245
Abstract Base Class for describing an interface to a solver.
virtual CbcBranchingObject * clone() const
Clone.
double infeasibility() const
Return infeasibility.
CbcModel * model() const
Return model.
Definition: CbcObject.hpp:240
virtual ~CbcLinkBranchingObject()
int way() const
Get the state of the branching object.
virtual void print()
Print something about branch - only if log level high.
Abstract branching object base class Now just difference with OsiBranchingObject. ...
CbcBranchObjType
CbcModel * model() const
Return model.
Branching object for Special ordered sets.
double separator_
separator
CbcLinkBranchingObject & operator=(const CbcLinkBranchingObject &rhs)
virtual double branch()
Does next branch and updates state.
Simple Branch and bound class.
Definition: CbcModel.hpp:101