Cbc  2.10.5
 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 2469 2019-01-06 23:17:46Z unxusr $
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);
36  CbcLink(CbcModel *model, int numberMembers,
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
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:258
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:252
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:100