BlisBranchObjectBilevel.h
Go to the documentation of this file.
1 /*===========================================================================*
2  * This file is part of the BiCePS Linear Integer Solver (BLIS). *
3  * *
4  * BLIS is distributed under the Eclipse Public License as part of the *
5  * COIN-OR repository (http://www.coin-or.org). *
6  * *
7  * Authors: *
8  * *
9  * Yan Xu, Lehigh University *
10  * Ted Ralphs, Lehigh University *
11  * *
12  * Conceptual Design: *
13  * *
14  * Yan Xu, Lehigh University *
15  * Ted Ralphs, Lehigh University *
16  * Laszlo Ladanyi, IBM T.J. Watson Research Center *
17  * Matthew Saltzman, Clemson University *
18  * *
19  * *
20  * Copyright (C) 2001-2013, Lehigh University, Yan Xu, and Ted Ralphs. *
21  * All Rights Reserved. *
22  *===========================================================================*/
23 
24 
25 //#############################################################################
26 // Borrow ideas from COIN/Cbc
27 //#############################################################################
28 
29 
30 #include "BcpsBranchObject.h"
31 
32 #include "BlisModel.h"
33 
34 
35 //#############################################################################
36 
37 
39 
40  protected:
41 
43  std::deque<int> *branchingSet_;
44 
45  public:
46 
49  {
51  branchingSet_ = new std::deque<int>();
52  }
53 
56  : BcpsBranchObject(model) {
58  branchingSet_ = new std::deque<int>();
59  }
60 
63  :
65 
68 
70  virtual BcpsBranchObject * clone() const {
71  return (new BlisBranchObjectBilevel(*this));
72  }
73 
76 
78  std::deque<int> *getBranchingSet() const {return branchingSet_;}
79 
81  void addToBranchingSet(int item) {branchingSet_->push_back(item);}
82 
86  virtual double branch(bool normalBranch = false);
87 
89  virtual void print(bool normalBranch);
90 
91  protected:
92 
95  assert(encoded);
97  return status;
98  }
99 
103  return status;
104  }
105 
106  public:
107 
109  virtual AlpsReturnStatus encode(AlpsEncoded *encoded) const {
111 
112  status = encodeBcps(encoded);
113  status = encodeBlis(encoded);
114 
115  return status;
116  }
117 
119  virtual AlpsReturnStatus decode(AlpsEncoded &encoded) {
120 
122 
123  status = decodeBcps(encoded);
124  status = decodeBlis(encoded);
125 
126  return status;
127  }
128 
129 };
130 
AlpsReturnStatus decodeBlis(AlpsEncoded &encoded)
Unpack Blis portion from an encoded object.
BlisBranchObjectBilevel(BcpsModel *model)
Another useful constructor.
AlpsReturnStatus
Definition: Alps.h:118
void addToBranchingSet(int item)
Get a pointer to the branching set.
virtual AlpsReturnStatus decode(AlpsEncoded &encoded)
Unpack a branching object from an encoded object.
virtual BcpsBranchObject * clone() const
Clone.
std::deque< int > * getBranchingSet() const
Get a pointer to the branching set.
BcpsBranchObject contains the member data required when choosing branching entities and excuting actu...
BcpsModel * model() const
Return model.
This data structure is to contain the packed form of an encodable knowledge.
Definition: AlpsEncoded.h:25
BlisBranchObjectBilevel & operator=(const BlisBranchObjectBilevel &rhs)
Assignment operator.
AlpsReturnStatus decodeBcps(AlpsEncoded &encoded)
Unpack Bcps portion from an encoded object.
virtual ~BlisBranchObjectBilevel()
Destructor.
AlpsReturnStatus encodeBcps(AlpsEncoded *encoded) const
Pack Bcps portion to an encoded object.
BlisBranchObjectBilevel()
Default constructor.
BlisBranchObjectBilevel(const BlisBranchObjectBilevel &rhs)
Copy constructor.
virtual double branch(bool normalBranch=false)
Set the bounds for the variable according to the current arm of the branch and advances the object st...
virtual AlpsReturnStatus encode(AlpsEncoded *encoded) const
Pack to an encoded object.
AlpsReturnStatus encodeBlis(AlpsEncoded *encoded) const
Pack Blis portion to an encoded object.
std::deque< int > * branchingSet_
The indices of variables in the branching set.
virtual void print(bool normalBranch)
Print something about branch - only if log level high.
int type_
Type of branching.