Dip 0.95.0
Loading...
Searching...
No Matches
DecompAlgoD.h
Go to the documentation of this file.
1//===========================================================================//
2// This file is part of the DIP Solver Framework. //
3// //
4// DIP is distributed under the Eclipse Public License as part of the //
5// COIN-OR repository (http://www.coin-or.org). //
6// //
7// Authors: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8// Ted Ralphs, Lehigh University (ted@lehigh.edu) //
9// Jiadong Wang, Lehigh University (jiw408@lehigh.edu) //
10// //
11// Copyright (C) 2002-2019, Lehigh University, Matthew Galati, Ted Ralphs //
12// All Rights Reserved. //
13//===========================================================================//
14
15
16//===========================================================================//
17#ifndef DecompAlgoD_h_
18#define DecompAlgoD_h_
19
20//===========================================================================//
26//===========================================================================//
27//THINK: derive from DecompAlgo or DecompAlgoPC?? THINK
28//THINK: how can we reuse this object since call many times?
29// if init phase is feasible, we are done....
30
31
32//===========================================================================//
33#include "DecompAlgoPC.h"
34
35//===========================================================================//
36class DecompAlgoD : public DecompAlgoPC {
37private:
38
39 //----------------------------------------------------------------------//
44 //----------------------------------------------------------------------//
48 std::string m_classTag;
49
50 //TODO
51 double* m_xhatD;
52 //TODO
53 DecompCutList* m_newCuts;
54 //TODO
55 int m_numOrigCols;
56
57
58
59
64 //-----------------------------------------------------------------------//
69 //-----------------------------------------------------------------------//
73 virtual void createMasterProblem(DecompVarList& initVars);
74 virtual void masterMatrixAddArtCols(CoinPackedMatrix* masterM,
75 double* colLB,
76 double* colUB,
77 double* objCoeff,
78 std::vector<std::string>& colNames,
79 int startRow,
80 int endRow,
81 char origOrBranch);
82 virtual void phaseUpdate(DecompPhase& phase,
83 DecompStatus& status);
84 virtual void phaseDone();
85
89 virtual inline void setObjBoundIP(const double thisBound) {
90 UtilPrintFuncBegin(m_osLog, m_classTag,
91 "setObjBoundIP()", m_param.LogDebugLevel, 2);
92
93 if (thisBound < m_nodeStats.objBest.second) {
95 (*m_osLog) << "New Global UB = "
96 << UtilDblToStr(thisBound) << std::endl;);
97 //For DECOMP, don't update this object's global UB
98 // otherwise, we might stop to early, since it will
99 // compare to this object's lower bound.
100 //m_nodeStats.objBest.second = thisBound;
101 }
102
103 UtilPrintFuncEnd(m_osLog, m_classTag,
104 "setObjBoundIP()", m_param.LogDebugLevel, 2);
105 }
106
107
108
109public:
110 void solveD(DecompCutList* newCuts) {
111 m_newCuts = newCuts;
112 //need to change parameters to price, no cut
119 }
120
121
122public:
123
124 //-----------------------------------------------------------------------//
129 //-----------------------------------------------------------------------//
130private:
134 DecompAlgoD(const DecompAlgoD&);
135 DecompAlgoD& operator=(const DecompAlgoD&);
136
137public:
138
143 UtilParameters& utilParam,
144 double* xhat,
145 int numOrigCols) //need to pass this? :
146 :
147 DecompAlgoPC(app, utilParam, false, DECOMP),
148 m_classTag ("D-ALGOD"),
149 m_xhatD (xhat),
150 m_newCuts (0),
151 m_numOrigCols(numOrigCols)
152 {
154 }
155
163};
164
165#endif
DecompStatus
Definition Decomp.h:184
@ DECOMP
Definition Decomp.h:128
std::list< DecompVar * > DecompVarList
Definition Decomp.h:92
DecompPhase
Definition Decomp.h:165
std::list< DecompCut * > DecompCutList
Definition Decomp.h:93
void UtilPrintFuncEnd(std::ostream *os, const std::string &classTag, const std::string &funcName, const int logLevel, const int logLimit)
void UtilPrintFuncBegin(std::ostream *os, const std::string &classTag, const std::string &funcName, const int logLevel, const int logLimit)
#define UTIL_MSG(param, level, x)
Definition UtilMacros.h:79
std::string UtilDblToStr(const double x, const int precision=-1, const double tooBig=UtilSmallerThanTooBig)
Definition UtilMacros.h:563
Class for DECOMP algorithm Decomp.
Definition DecompAlgoD.h:36
DecompAlgoD(DecompApp *app, UtilParameters &utilParam, double *xhat, int numOrigCols)
Default constructors.
~DecompAlgoD()
Destructor.
void solveD(DecompCutList *newCuts)
Class for DECOMP algorithm Price and Cut.
virtual DecompStatus processNode(const AlpsDecompTreeNode *node, const double globalLB, const double globalUB)
The main DECOMP process loop for a node.
std::ostream * m_osLog
Stream for log file (default to stdout).
Definition DecompAlgo.h:124
double m_infinity
The value of "infinity".
Definition DecompAlgo.h:96
DecompParam m_param
Parameters.
Definition DecompAlgo.h:80
DecompNodeStats m_nodeStats
Definition DecompAlgo.h:114
DecompApp * m_app
Pointer to current active DECOMP application.
Definition DecompAlgo.h:108
The main application class.
Definition DecompApp.h:48
DecompParam m_param
Parameters.
Definition DecompApp.h:79
std::pair< double, double > objBest
The global lower (.first) and upper (.second) bound.
int TotalPriceItersLimit
Definition DecompParam.h:63
int SolveMasterAsMip
int RoundPriceItersLimit
Definition DecompParam.h:65
int RoundCutItersLimit
Definition DecompParam.h:64
int TotalCutItersLimit
Definition DecompParam.h:62
int LogDebugLevel
Definition DecompParam.h:39