Blis 0.94
BlisTreeNode.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#ifndef BlisTreeNode_h_
25#define BlisTreeNode_h_
26
27//#############################################################################
28
29#include "AlpsNodeDesc.h"
30
31#include "BcpsObjectPool.h"
32#include "BcpsTreeNode.h"
33
34#include "BcpsNodeDesc.h"
35#include "BlisNodeDesc.h"
36
37class BcpsModel;
38class BlisModel;
39
40
41//#############################################################################
45//#############################################################################
46
47
48class BlisTreeNode : public BcpsTreeNode {
49private:
50
53
54 BlisTreeNode& operator=(const BlisTreeNode&);
55
57 //BcpsConstraintPool *constraintPool_;
58
60 //BcpsVariablePool *variablePool_;
61
63 //void saveExplicit();
64
66 bool parallel(BlisModel *model,
67 BcpsConstraintPool &conPool,
68 int lastNew,
69 BlisConstraint *aCon);
70
72 double estimateSolution(BlisModel *model,
73 const double *lpSolution,
74 double lpObjValue) const;
75
76public:
77
80 :
82 { init(); }
83
86 init();
87 desc_ = new BlisNodeDesc(m);
88 }
89
92 init();
93 desc_ = desc;
94 desc = NULL;
95 }
96
98 virtual ~BlisTreeNode() {
99 //std::cout << "------ Delete blis part of node" << std::endl;
100 }
101
103 void init() {
104 //constraintPool_ = new BcpsConstraintPool;
105 //variablePool_ = new BcpsVariablePool;
106 }
107
110
113 virtual void convertToExplicit();
114 virtual void convertToRelative();
116
118 virtual int installSubProblem(BcpsModel *mode);
119
121 virtual int process(bool isRoot = false, bool rampUp = false);
122
124 virtual int bound(BcpsModel *model);
125
130 virtual std::vector< CoinTriple<AlpsNodeDesc*, AlpsNodeStatus, double> >
132
135 bool& foundSol,
136 int numPassesLeft);
137
140
141 // Why need below?
142 //using BcpsTreeNode::generateConstraints ;
143
146
151 int callHeuristics(BlisModel *model, bool onlyBeforeRoot=false);
152
155 const double *currLpSolution,
156 BcpsConstraintPool & conPool);
157
160 const double *solution,
161 BcpsConstraintPool & conPool);
162
165
167 //BcpsConstraintPool * constraintPool() { return constraintPool_; }
168
170 //BcpsVariablePool * variablePool() { return variablePool_; }
171
174 virtual AlpsEncoded* encode() const;
175
178};
179
180#endif
AlpsReturnStatusOk
BlisReturnStatus
Definition: Blis.h:48
virtual AlpsEncoded * encode() const
AlpsNodeDesc * desc_
This is the class in which we are finally able to concretely define the bounding procedure.
Definition: BlisSubTree.h:33
virtual void convertToRelative()
virtual int bound(BcpsModel *model)
Bounding procedure.
int generateConstraints(BlisModel *model, BcpsConstraintPool &conPool)
Generate constraints.
AlpsTreeNode * createNewTreeNode(AlpsNodeDesc *&desc) const
Create a new node based on given desc.
int selectBranchObject(BlisModel *model, bool &foundSol, int numPassesLeft)
Select a branching object based on give branching strategy.
BlisTreeNode(AlpsNodeDesc *&desc)
Useful constructor.
Definition: BlisTreeNode.h:91
virtual int process(bool isRoot=false, bool rampUp=false)
Performing the bounding operation.
virtual int installSubProblem(BcpsModel *mode)
intall subproblem
virtual int chooseBranchingObject(BcpsModel *)
To be defined.
Definition: BlisTreeNode.h:139
BlisReturnStatus reducedCostFix(BlisModel *model)
Fix and tighten varaibles based optimality conditions.
virtual ~BlisTreeNode()
Destructor.
Definition: BlisTreeNode.h:98
virtual AlpsKnowledge * decode(AlpsEncoded &) const
Decode a node from an encoded object.
void getViolatedConstraints(BlisModel *model, const double *currLpSolution, BcpsConstraintPool &conPool)
Get violated constraints.
BlisTreeNode()
Default constructor.
Definition: BlisTreeNode.h:79
BlisTreeNode(BlisModel *m)
Useful constructor.
Definition: BlisTreeNode.h:85
BlisReturnStatus applyConstraints(BlisModel *model, const double *solution, BcpsConstraintPool &conPool)
Select and apply constraints.
virtual std::vector< CoinTriple< AlpsNodeDesc *, AlpsNodeStatus, double > > branch()
Takes the explicit description of the current active node and creates the children's descriptions,...
void init()
Initilize member data when constructing a node.
Definition: BlisTreeNode.h:103
virtual void convertToExplicit()
Convert explicit description to difference, and vise-vesa.
int callHeuristics(BlisModel *model, bool onlyBeforeRoot=false)
Call heuristic to search solutions.
virtual AlpsEncoded * encode() const
Encode this node for message passing.