Dip  0.92.4
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 //===========================================================================//
24 class DecompAlgoRC : public DecompAlgo {
25 
26  //----------------------------------------------------------------------//
31  //----------------------------------------------------------------------//
32 private:
36  const std::string m_classTag;
37 
38 private:
39  std::vector<double> m_u; //dual vector
40  double* m_rc; //reduced cost
41 
42  double m_UB;
43  double m_LB;
44 
46  int m_iter;
47  double m_step;
48  bool m_zeroSub;
49 
55  //-----------------------------------------------------------------------//
60  //-----------------------------------------------------------------------//
64  void createMasterProblem(DecompVarList& initVars);
65 
71  //not pure
72  void recomposeSolution(const double* solution,
73  double* rsolution);
74 
75 
82  //-----------------------------------------------------------------------//
87  //-----------------------------------------------------------------------//
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 
103  void phaseDone();
104 
105 
110  //-----------------------------------------------------------------------//
115  //-----------------------------------------------------------------------//
116 private:
120  DecompAlgoRC(const DecompAlgoRC&);
122 
123 public:
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  }
157 public:
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
std::vector< double > m_u
Store the name of the class (for logging/debugging) - &quot;who am I?&quot;.
Definition: DecompAlgoRC.h:39
double m_UB
Store the name of the class (for logging/debugging) - &quot;who am I?&quot;.
Definition: DecompAlgoRC.h:42
bool updateObjBound(const double mostNegRC=-DecompBigNum)
Run the initial phase for processing node.
#define UTIL_DELARR(x)
Definition: UtilMacros.h:29
DecompVar m_shatVar
Store the name of the class (for logging/debugging) - &quot;who am I?&quot;.
Definition: DecompAlgoRC.h:50
~DecompAlgoRC()
Destructor.
Definition: DecompAlgoRC.h:146
DecompAlgoRC & operator=(const DecompAlgoRC &)
Disable copy constructors.
int addCutsFromPool()
Run the initial phase for processing node.
void setInitObjUB(const double objUB)
Definition: DecompAlgoRC.h:165
DecompAlgoRC(const DecompAlgoRC &)
Disable copy constructors.
const double * getRowPrice()
Definition: DecompAlgoRC.h:160
int generateVars(DecompVarList &newVars, double &mostNegReducedCost)
Run the initial phase for processing node.
double m_infinity
The value of &quot;infinity&quot;.
Definition: DecompAlgo.h:96
void phaseDone()
Run the done phase for processing node.
int m_iter
Store the name of the class (for logging/debugging) - &quot;who am I?&quot;.
Definition: DecompAlgoRC.h:46
void createMasterProblem(DecompVarList &initVars)
Create the master problem (all algorithms must define this function).
double * m_rc
Store the name of the class (for logging/debugging) - &quot;who am I?&quot;.
Definition: DecompAlgoRC.h:40
void recomposeSolution(const double *solution, double *rsolution)
Compose solution in x-space from current space.
DecompAlgoRC(DecompApp *app, UtilParameters &utilParam)
Default constructors.
Definition: DecompAlgoRC.h:127
DecompPhase phaseInit()
Run the initial phase for processing node.
double m_step
Store the name of the class (for logging/debugging) - &quot;who am I?&quot;.
Definition: DecompAlgoRC.h:47
DecompStatus solutionUpdate(const DecompPhase phase, const int maxInnerIter, const int maxOuterIter)
Run the initial phase for processing node.
Base class for DECOMP algorithms.
Definition: DecompAlgo.h:62
double m_LB
Store the name of the class (for logging/debugging) - &quot;who am I?&quot;.
Definition: DecompAlgoRC.h:43
bool m_zeroSub
Store the name of the class (for logging/debugging) - &quot;who am I?&quot;.
Definition: DecompAlgoRC.h:48
int m_cntSameLB
Store the name of the class (for logging/debugging) - &quot;who am I?&quot;.
Definition: DecompAlgoRC.h:45
const std::string m_classTag
Store the name of the class (for logging/debugging) - &quot;who am I?&quot;.
Definition: DecompAlgoRC.h:36
std::list< DecompVar * > DecompVarList
Definition: Decomp.h:91
DecompPhase
Definition: Decomp.h:165
const double DecompBigNum
Definition: Decomp.h:99
The main application class.
Definition: DecompApp.h:48