Dip 0.95.0
Loading...
Searching...
No Matches
DecompAlgoRC.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#ifndef DecompAlgoRC_h_
17#define DecompAlgoRC_h_
18
20//===========================================================================//
21#include "DecompAlgo.h"
22
23//===========================================================================//
24class DecompAlgoRC : public DecompAlgo {
25
26 //----------------------------------------------------------------------//
31 //----------------------------------------------------------------------//
32private:
36 const std::string m_classTag;
37
38private:
39 std::vector<double> m_u; //dual vector
40 double* m_rc; //reduced cost
41
42 double m_UB;
43 double m_LB;
44
45 int m_cntSameLB;
46 int m_iter;
47 double m_step;
48 bool m_zeroSub;
49
50 DecompVar m_shatVar;
55 //-----------------------------------------------------------------------//
60 //-----------------------------------------------------------------------//
64 void createMasterProblem(DecompVarList& initVars);
65
71 //not pure
72 void recomposeSolution(const double* solution,
73 double* rsolution);
74
75
82 //-----------------------------------------------------------------------//
87 //-----------------------------------------------------------------------//
88 DecompStatus solutionUpdate(const DecompPhase phase,
89 const int maxInnerIter,
90 const int maxOuterIter);
91 int addCutsFromPool();
92 int generateVars(DecompVarList& newVars,
93 double& mostNegReducedCost);
94 bool updateObjBound(const double mostNegRC = -DecompBigNum);
95
99 DecompPhase phaseInit();
103 void phaseDone();
104
105
110 //-----------------------------------------------------------------------//
115 //-----------------------------------------------------------------------//
116private:
121 DecompAlgoRC& operator=(const DecompAlgoRC&);
122
123public:
128 UtilParameters& utilParam):
129 DecompAlgo(RELAX_AND_CUT, app, utilParam),
130 m_classTag("D-ALGORC"),
131 m_u (),
132 m_rc (NULL),
133 m_UB (m_infinity),
134 m_LB (-m_infinity),
135 m_cntSameLB(0),
136 m_iter (0),
137 m_step (2.0), //(0, 2] param?
138 m_zeroSub (false),
139 m_shatVar ()
140 {
141 }
142
147 UTIL_DELARR(m_rc);
148 }
157public:
158 bool isDone();
159 //name - change to getDual?
160 const double* getRowPrice() {
161 return &m_u[0];
162 }
163 //user needs to do?
164 //STOP
165 void setInitObjUB(const double objUB) {
166 m_UB = objUB;
167 }
168
169
170};
171#endif
DecompStatus
Definition: Decomp.h:184
@ RELAX_AND_CUT
Definition: Decomp.h:126
std::list< DecompVar * > DecompVarList
Definition: Decomp.h:92
DecompPhase
Definition: Decomp.h:165
const double DecompBigNum
Definition: Decomp.h:99
#define UTIL_DELARR(x)
Definition: UtilMacros.h:65
const double * getRowPrice()
Definition: DecompAlgoRC.h:160
DecompAlgoRC(DecompApp *app, UtilParameters &utilParam)
Default constructors.
Definition: DecompAlgoRC.h:127
~DecompAlgoRC()
Destructor.
Definition: DecompAlgoRC.h:146
void setInitObjUB(const double objUB)
Definition: DecompAlgoRC.h:165
Base class for DECOMP algorithms.
Definition: DecompAlgo.h:62
double m_infinity
The value of "infinity".
Definition: DecompAlgo.h:96
The main application class.
Definition: DecompApp.h:48