Blis 0.95.0
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-2023, 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 "BlisConfig.h"
33#include "BlisModel.h"
34
35//#############################################################################
36
37class BLISLIB_EXPORT BlisBranchObjectBilevel : public BcpsBranchObject {
38
39 protected:
40
42 std::deque<int> *branchingSet_;
43
44 public:
45
47 BlisBranchObjectBilevel() : BcpsBranchObject()
48 {
50 branchingSet_ = new std::deque<int>();
51 }
52
54 BlisBranchObjectBilevel(BcpsModel * model)
55 : BcpsBranchObject(model) {
57 branchingSet_ = new std::deque<int>();
58 }
59
62 :
63 BcpsBranchObject(rhs), branchingSet_(rhs.branchingSet_) {}
64
67
69 virtual BcpsBranchObject * clone() const {
70 return (new BlisBranchObjectBilevel(*this));
71 }
72
75
77 std::deque<int> *getBranchingSet() const {return branchingSet_;}
78
80 void addToBranchingSet(int item) {branchingSet_->push_back(item);}
81
85 virtual double branch(bool normalBranch = false);
86
88 virtual void print(bool normalBranch);
89
90 protected:
91
93 AlpsReturnStatus encodeBlis(AlpsEncoded *encoded) const {
94 assert(encoded);
95 AlpsReturnStatus status = AlpsReturnStatusOk;
96 return status;
97 }
98
100 AlpsReturnStatus decodeBlis(AlpsEncoded &encoded) {
101 AlpsReturnStatus status = AlpsReturnStatusOk;
102 return status;
103 }
104
105 public:
106
108 virtual AlpsReturnStatus encode(AlpsEncoded *encoded) const {
109 AlpsReturnStatus status = AlpsReturnStatusOk;
110
111 status = encodeBcps(encoded);
112 status = encodeBlis(encoded);
113
114 return status;
115 }
116
118 virtual AlpsReturnStatus decode(AlpsEncoded &encoded) {
119
120 AlpsReturnStatus status = AlpsReturnStatusOk;
121
122 status = decodeBcps(encoded);
123 status = decodeBlis(encoded);
124
125 return status;
126 }
127
128};
129
@ BlisBranchingObjectTypeBilevel
Definition Blis.h:127
BlisBranchObjectBilevel()
Default constructor.
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.
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.
#define BLISLIB_EXPORT
Definition config.h:5