- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
38 class BlisBranchObjectBilevel : public BcpsBranchObject {
39
40 protected:
41
43 std::deque<int> *branchingSet_;
44
45 public:
46
48 BlisBranchObjectBilevel() : BcpsBranchObject()
49 {
50 type_ = BlisBranchingObjectTypeBilevel;
51 branchingSet_ = new std::deque<int>();
52 }
53
55 BlisBranchObjectBilevel(BcpsModel * model)
56 : BcpsBranchObject(model) {
57 type_ = BlisBranchingObjectTypeBilevel;
58 branchingSet_ = new std::deque<int>();
59 }
60
62 BlisBranchObjectBilevel(const BlisBranchObjectBilevel &rhs)
63 :
64 BcpsBranchObject(rhs), branchingSet_(rhs.branchingSet_) {}
65
67 BlisBranchObjectBilevel & operator = (const BlisBranchObjectBilevel& rhs);
68
70 virtual BcpsBranchObject * clone() const {
71 return (new BlisBranchObjectBilevel(*this));
72 }
73
75 virtual ~BlisBranchObjectBilevel() { delete branchingSet_; }
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
94 AlpsReturnStatus encodeBlis(AlpsEncoded *encoded) const {
95 assert(encoded);
96 AlpsReturnStatus status = AlpsReturnStatusOk;
97 return status;
98 }
99
101 AlpsReturnStatus decodeBlis(AlpsEncoded &encoded) {
102 AlpsReturnStatus status = AlpsReturnStatusOk;
103 return status;
104 }
105
106 public:
107
109 virtual AlpsReturnStatus encode(AlpsEncoded *encoded) const {
110 AlpsReturnStatus status = AlpsReturnStatusOk;
111
112 status = encodeBcps(encoded);
113 status = encodeBlis(encoded);
114
115 return status;
116 }
117
119 virtual AlpsReturnStatus decode(AlpsEncoded &encoded) {
120
121 AlpsReturnStatus status = AlpsReturnStatusOk;
122
123 status = decodeBcps(encoded);
124 status = decodeBlis(encoded);
125
126 return status;
127 }
128
129 };
130
BlisBranchObjectBilevel::decodeBlis
AlpsReturnStatus decodeBlis(AlpsEncoded &encoded)
Unpack Blis portion from an encoded object.
Definition: BlisBranchObjectBilevel.h:101
BlisBranchObjectBilevel::BlisBranchObjectBilevel
BlisBranchObjectBilevel(BcpsModel *model)
Another useful constructor.
Definition: BlisBranchObjectBilevel.h:55
AlpsReturnStatus
AlpsReturnStatus
Definition: Alps.h:118
BlisBranchObjectBilevel::addToBranchingSet
void addToBranchingSet(int item)
Get a pointer to the branching set.
Definition: BlisBranchObjectBilevel.h:81
BlisBranchObjectBilevel::decode
virtual AlpsReturnStatus decode(AlpsEncoded &encoded)
Unpack a branching object from an encoded object.
Definition: BlisBranchObjectBilevel.h:119
BlisBranchObjectBilevel::clone
virtual BcpsBranchObject * clone() const
Clone.
Definition: BlisBranchObjectBilevel.h:70
BlisBranchingObjectTypeBilevel
Definition: Blis.h:127
BlisBranchObjectBilevel::getBranchingSet
std::deque< int > * getBranchingSet() const
Get a pointer to the branching set.
Definition: BlisBranchObjectBilevel.h:78
BcpsBranchObject
BcpsBranchObject contains the member data required when choosing branching entities and excuting actu...
Definition: BcpsBranchObject.h:47
BcpsBranchObject::model
BcpsModel * model() const
Return model.
Definition: BcpsBranchObject.h:213
AlpsEncoded
This data structure is to contain the packed form of an encodable knowledge.
Definition: AlpsEncoded.h:25
AlpsReturnStatusOk
Definition: Alps.h:119
BlisBranchObjectBilevel::operator=
BlisBranchObjectBilevel & operator=(const BlisBranchObjectBilevel &rhs)
Assignment operator.
BcpsBranchObject::decodeBcps
AlpsReturnStatus decodeBcps(AlpsEncoded &encoded)
Unpack Bcps portion from an encoded object.
Definition: BcpsBranchObject.h:232
BcpsModel
Definition: BcpsModel.h:40
BlisBranchObjectBilevel::~BlisBranchObjectBilevel
virtual ~BlisBranchObjectBilevel()
Destructor.
Definition: BlisBranchObjectBilevel.h:75
BlisModel.h
BcpsBranchObject::encodeBcps
AlpsReturnStatus encodeBcps(AlpsEncoded *encoded) const
Pack Bcps portion to an encoded object.
Definition: BcpsBranchObject.h:218
BlisBranchObjectBilevel::BlisBranchObjectBilevel
BlisBranchObjectBilevel()
Default constructor.
Definition: BlisBranchObjectBilevel.h:48
BlisBranchObjectBilevel::BlisBranchObjectBilevel
BlisBranchObjectBilevel(const BlisBranchObjectBilevel &rhs)
Copy constructor.
Definition: BlisBranchObjectBilevel.h:62
BlisBranchObjectBilevel::branch
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...
BlisBranchObjectBilevel
Definition: BlisBranchObjectBilevel.h:38
BlisBranchObjectBilevel::encode
virtual AlpsReturnStatus encode(AlpsEncoded *encoded) const
Pack to an encoded object.
Definition: BlisBranchObjectBilevel.h:109
BlisBranchObjectBilevel::encodeBlis
AlpsReturnStatus encodeBlis(AlpsEncoded *encoded) const
Pack Blis portion to an encoded object.
Definition: BlisBranchObjectBilevel.h:94
BcpsBranchObject.h
BlisBranchObjectBilevel::branchingSet_
std::deque< int > * branchingSet_
The indices of variables in the branching set.
Definition: BlisBranchObjectBilevel.h:43
BlisBranchObjectBilevel::print
virtual void print(bool normalBranch)
Print something about branch - only if log level high.
BcpsBranchObject::type_
int type_
Type of branching.
Definition: BcpsBranchObject.h:52