Blis 0.94
Loading...
Searching...
No Matches
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-2019, 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
53
60
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
120
122
123 status = decodeBcps(encoded);
124 status = decodeBlis(encoded);
125
126 return status;
127 }
128
129};
130
AlpsReturnStatus
AlpsReturnStatusOk
@ BlisBranchingObjectTypeBilevel
Definition Blis.h:127
BcpsModel * model() const
AlpsReturnStatus decodeBcps(AlpsEncoded &encoded)
AlpsReturnStatus encodeBcps(AlpsEncoded *encoded) const
BlisBranchObjectBilevel()
Default constructor.
virtual AlpsReturnStatus decode(AlpsEncoded &encoded)
Unpack a branching object from an encoded object.
BlisBranchObjectBilevel & operator=(const BlisBranchObjectBilevel &rhs)
Assignment operator.
virtual BcpsBranchObject * clone() const
Clone.
std::deque< int > * getBranchingSet() const
Get a pointer to the branching set.
virtual ~BlisBranchObjectBilevel()
Destructor.
BlisBranchObjectBilevel(const BlisBranchObjectBilevel &rhs)
Copy constructor.
virtual void print(bool normalBranch)
Print something about branch - only if log level high.
void addToBranchingSet(int item)
Get a pointer to the branching set.
AlpsReturnStatus encodeBlis(AlpsEncoded *encoded) const
Pack Blis portion to an encoded object.
AlpsReturnStatus decodeBlis(AlpsEncoded &encoded)
Unpack Blis portion from an encoded object.
std::deque< int > * branchingSet_
The indices of variables in the branching set.
BlisBranchObjectBilevel(BcpsModel *model)
Another useful 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.