Cbc  2.10.10
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CbcBranchLink.hpp
Go to the documentation of this file.
1 // $Id$
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 
15 class CbcLink : public CbcObject {
16 
17 public:
18  // Default Constructor
19  CbcLink();
20 
28  int numberLinks, int first,
29  const double *weights, int setNumber);
37  int numberLinks, int typeSOS, const int *which,
38  const double *weights, int setNumber);
39 
40  // Copy constructor
41  CbcLink(const CbcLink &);
42 
44  virtual CbcObject *clone() const;
45 
46  // Assignment operator
47  CbcLink &operator=(const CbcLink &rhs);
48 
49  // Destructor
50  ~CbcLink();
51 
53  virtual double infeasibility(int &preferredWay) const;
54 
56  virtual void feasibleRegion();
58  virtual CbcBranchingObject *createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way);
59 
61  inline int numberMembers() const
62  {
63  return numberMembers_;
64  }
65 
67  inline int numberLinks() const
68  {
69  return numberLinks_;
70  }
71 
73  inline const int *which() const
74  {
75  return which_;
76  }
77 
79  inline const double *weights() const
80  {
81  return weights_;
82  }
83 
84 private:
86 
88  double *weights_;
89 
95  int *which_;
97  int sosType_;
98 };
105 
106 public:
107  // Default Constructor
109 
110  // Useful constructor
112  int way,
113  double separator);
114 
115  // Copy constructor
117 
118  // Assignment operator
120 
122  virtual CbcBranchingObject *clone() const;
123 
124  // Destructor
125  virtual ~CbcLinkBranchingObject();
126 
128  virtual double branch();
129 
132  virtual void print();
134  virtual CbcBranchObjType type() const
135  {
136  return CbcBranchObjType(0);
137  } /*FIXME what type() should be returned here? */
138 
147  virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap = false);
148 
149 private:
151  const CbcLink *set_;
153  double separator_;
154 };
155 #endif
CbcBranchingObject::way
int way() const
Get the state of the branching object.
Definition: CbcBranchingObject.hpp:157
CbcLinkBranchingObject::~CbcLinkBranchingObject
virtual ~CbcLinkBranchingObject()
CbcObject::preferredWay
int preferredWay() const
If -1 down always chosen first, +1 up always, 0 normal.
Definition: CbcObject.hpp:258
CbcLinkBranchingObject::separator_
double separator_
separator
Definition: CbcBranchLink.hpp:153
CbcLinkBranchingObject::branch
virtual double branch()
Does next branch and updates state.
CbcLinkBranchingObject::operator=
CbcLinkBranchingObject & operator=(const CbcLinkBranchingObject &rhs)
CbcModel
Simple Branch and bound class.
Definition: CbcModel.hpp:100
CbcLinkBranchingObject::type
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
Definition: CbcBranchLink.hpp:134
CbcLinkBranchingObject::clone
virtual CbcBranchingObject * clone() const
Clone.
CbcLinkBranchingObject::compareBranchingObject
virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
Compare the this with brObj.
CbcLinkBranchingObject::set_
const CbcLink * set_
data
Definition: CbcBranchLink.hpp:151
CbcBranchingObject
Abstract branching object base class Now just difference with OsiBranchingObject.
Definition: CbcBranchingObject.hpp:51
CbcObject
Definition: CbcObject.hpp:67
CbcBranchBase.hpp
CbcObject::model
CbcModel * model() const
Return model.
Definition: CbcObject.hpp:252
CbcRangeCompare
CbcRangeCompare
Definition: CbcBranchBase.hpp:13
CbcBranchObjType
CbcBranchObjType
Definition: CbcBranchingObject.hpp:17
CbcBranchingObject::model
CbcModel * model() const
Return model.
Definition: CbcBranchingObject.hpp:177
CbcLinkBranchingObject::print
virtual void print()
Print something about branch - only if log level high.
CbcLinkBranchingObject
Branching object for Special ordered sets.
Definition: CbcBranchLink.hpp:104
CbcLinkBranchingObject::CbcLinkBranchingObject
CbcLinkBranchingObject()