Dip  0.95.0
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 //===========================================================================//
36 class DecompAlgoD : public DecompAlgoPC {
37 private:
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 
109 public:
110  void solveD(DecompCutList* newCuts) {
111  m_newCuts = newCuts;
112  //need to change parameters to price, no cut
119  }
120 
121 
122 public:
123 
124  //-----------------------------------------------------------------------//
129  //-----------------------------------------------------------------------//
130 private:
134  DecompAlgoD(const DecompAlgoD&);
135  DecompAlgoD& operator=(const DecompAlgoD&);
136 
137 public:
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  {
153  m_param.CutCglGomory = 0;
154  }
155 
163 };
164 
165 #endif
DecompCutList
std::list< DecompCut * > DecompCutList
Definition: Decomp.h:93
DecompAlgo::m_param
DecompParam m_param
Parameters.
Definition: DecompAlgo.h:80
DecompAlgo::m_nodeStats
DecompNodeStats m_nodeStats
Definition: DecompAlgo.h:114
DecompAlgoD::DecompAlgoD
DecompAlgoD(DecompApp *app, UtilParameters &utilParam, double *xhat, int numOrigCols)
Default constructors.
Definition: DecompAlgoD.h:142
UtilParameters
Definition: UtilParameters.h:26
DecompParam::RoundPriceItersLimit
int RoundPriceItersLimit
Definition: DecompParam.h:65
DecompAlgoPC.h
DecompNodeStats::objBest
std::pair< double, double > objBest
The global lower (.first) and upper (.second) bound.
Definition: DecompStats.h:119
DecompStatus
DecompStatus
Definition: Decomp.h:184
DecompAlgo::m_infinity
double m_infinity
The value of "infinity".
Definition: DecompAlgo.h:96
DecompAlgo::processNode
virtual DecompStatus processNode(const AlpsDecompTreeNode *node, const double globalLB, const double globalUB)
The main DECOMP process loop for a node.
DecompAlgo::m_app
DecompApp * m_app
Pointer to current active DECOMP application.
Definition: DecompAlgo.h:108
DecompAlgoD
Class for DECOMP algorithm Decomp.
Definition: DecompAlgoD.h:36
DecompAlgoPC
Class for DECOMP algorithm Price and Cut.
Definition: DecompAlgoPC.h:31
DecompParam::TotalPriceItersLimit
int TotalPriceItersLimit
Definition: DecompParam.h:63
UtilDblToStr
std::string UtilDblToStr(const double x, const int precision=-1, const double tooBig=UtilSmallerThanTooBig)
Definition: UtilMacros.h:563
UtilPrintFuncBegin
void UtilPrintFuncBegin(std::ostream *os, const std::string &classTag, const std::string &funcName, const int logLevel, const int logLimit)
Definition: UtilMacrosDecomp.h:50
DecompApp::m_param
DecompParam m_param
Parameters.
Definition: DecompApp.h:79
UTIL_MSG
#define UTIL_MSG(param, level, x)
Definition: UtilMacros.h:79
DecompParam::RoundCutItersLimit
int RoundCutItersLimit
Definition: DecompParam.h:64
DecompParam::LogDebugLevel
int LogDebugLevel
Definition: DecompParam.h:39
CoinPackedMatrix
DecompParam::CutCglGomory
int CutCglGomory
Definition: DecompParam.h:106
DecompAlgoD::solveD
void solveD(DecompCutList *newCuts)
Definition: DecompAlgoD.h:110
DecompAlgoD::~DecompAlgoD
~DecompAlgoD()
Destructor.
Definition: DecompAlgoD.h:159
DECOMP
@ DECOMP
Definition: Decomp.h:128
DecompAlgo::m_osLog
std::ostream * m_osLog
Stream for log file (default to stdout).
Definition: DecompAlgo.h:124
UtilPrintFuncEnd
void UtilPrintFuncEnd(std::ostream *os, const std::string &classTag, const std::string &funcName, const int logLevel, const int logLimit)
Definition: UtilMacrosDecomp.h:77
DecompVarList
std::list< DecompVar * > DecompVarList
Definition: Decomp.h:91
DecompPhase
DecompPhase
Definition: Decomp.h:165
DecompParam::TotalCutItersLimit
int TotalCutItersLimit
Definition: DecompParam.h:62
DecompParam::SolveMasterAsMip
int SolveMasterAsMip
Definition: DecompParam.h:147
DecompApp
The main application class.
Definition: DecompApp.h:48