DecompAlgoPC.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef DecompAlgoPC_h_
00018 #define DecompAlgoPC_h_
00019
00020
00026
00027
00028
00029 #include "DecompAlgo.h"
00030
00031
00032 class DecompAlgoPC : public DecompAlgo {
00033
00034 private:
00035
00036
00041
00045 std::string m_classTag;
00046
00054 std::vector<double> m_dual;
00055
00061 std::vector<double> m_dualRM;
00062
00068 std::vector<double> m_dualST;
00069
00074
00079
00083 virtual void createMasterProblem(DecompVarList& initVars) {
00084 DecompAlgo::createMasterProblem(initVars);
00085 }
00086 virtual int generateVarsFea(DecompVarList& newVars,
00087 double& mostNegReducedCost) {
00088 return DecompAlgo::generateVarsFea(newVars, mostNegReducedCost);
00089 }
00090 virtual void phaseInit(DecompPhase& phase);
00091
00092
00093
00102 virtual const double* getMasterDualSolution() const {
00103
00104
00105
00106 if (m_param.DualStab) {
00107 return &m_dualST[0];
00108 } else {
00109 return &m_dualSolution[0];
00110 }
00111 }
00112
00118 virtual void adjustMasterDualSolution();
00119
00120
00121
00125 virtual void setObjBound(const double thisBound,
00126 const double thisBoundUB) {
00127 UtilPrintFuncBegin(m_osLog, m_classTag,
00128 "setObjBound()", m_param.LogDebugLevel, 2);
00129
00130 if (m_param.DualStab) {
00131 if (thisBound > (m_nodeStats.objBest.first + DecompEpsilon)) {
00132
00133
00134 copy(m_dualST.begin(), m_dualST.end(), m_dual.begin());
00135 }
00136 }
00137
00138 DecompAlgo::setObjBound(thisBound, thisBoundUB);
00139 UtilPrintFuncEnd(m_osLog, m_classTag,
00140 "setObjBound()", m_param.LogDebugLevel, 2);
00141 }
00142
00146 virtual inline void setObjBoundIP(const double thisBound) {
00147 DecompAlgo::setObjBoundIP(thisBound);
00148 }
00149
00154
00159
00160
00161 void addCutsToPool(const double* x,
00162 DecompCutList& newCuts,
00163 int& n_newCuts);
00164
00165
00166 void phaseDone();
00167 int addCutsFromPool();
00168 void solutionUpdateAsIP();
00169 int adjustColumnsEffCnt();
00170 int compressColumns ();
00171
00172
00173
00179
00184
00185 public:
00186
00187 std::vector<double>& getDualBest() {
00188 return m_dual;
00189 }
00190 std::vector<double>& getDualRMP() {
00191 return m_dualRM;
00192 }
00193
00194
00198 DecompAlgoPC(DecompApp* app,
00199 UtilParameters* utilParam,
00200 bool doSetup = true) :
00201 DecompAlgo(PRICE_AND_CUT, app, utilParam),
00202 m_classTag("D-ALGOPC") {
00203
00204
00205
00206
00207 m_param.CutCglGomory = 0;
00208
00209
00210
00211
00212 if (doSetup) {
00213 std::string paramSection = DecompAlgoStr[PRICE_AND_CUT];
00214 initSetup(utilParam, paramSection);
00215 }
00216 }
00217
00218 DecompAlgoPC(DecompApp* app,
00219 UtilParameters* utilParam,
00220 std::string& paramSection,
00221 bool doSetup = true) :
00222
00223 DecompAlgo(PRICE_AND_CUT, app, utilParam),
00224 m_classTag("D-ALGOPC") {
00225
00226
00227
00228
00229 m_param.CutCglGomory = 0;
00230
00231
00232
00233
00234 if (doSetup) {
00235 initSetup(utilParam, paramSection);
00236 }
00237 }
00238
00239
00243 ~DecompAlgoPC() {}
00247 };
00248
00249 #endif