Dip-All  0.91.0
DecompAlgoC.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 // Author: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8 // //
9 // Conceptual Design: Matthew Galati, SAS Institute Inc. //
10 // Ted Ralphs, Lehigh University //
11 // //
12 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, Ted Ralphs //
13 // All Rights Reserved. //
14 //===========================================================================//
15 
16 
17 //===========================================================================//
18 #ifndef DecompAlgoC_h_
19 #define DecompAlgoC_h_
20 
21 //===========================================================================//
27 //===========================================================================//
28 
29 //===========================================================================//
30 #include "Decomp.h"
31 #include "DecompAlgo.h"
32 
33 //===========================================================================//
34 class DecompAlgoC : public DecompAlgo {
35 private:
36 
37  //----------------------------------------------------------------------//
42  //----------------------------------------------------------------------//
46  std::string m_classTag;
51  //-----------------------------------------------------------------------//
56  //-----------------------------------------------------------------------//
60  void createMasterProblem(DecompVarList& initVars);
61 
67  void recomposeSolution(const double* solution,
68  double* rsolution);
69 
74  //-----------------------------------------------------------------------//
79  //-----------------------------------------------------------------------//
80 
85  bool updateObjBound(const double mostNegRC = -DecompBigNum);
86 
87  void phaseInit(DecompPhase& phase) {
88  if (getNodeIndex() == 0) {
89  phase = PHASE_CUT;
90  }
91  }
92  void phaseDone();//chance to run DC
93 
97  void phaseUpdate(DecompPhase& phase,
98  DecompStatus& status);
104  return 0;
105  }
106 
107  void setMasterBounds(const double* lbs,
108  const double* ubs);
109  void setSubProbBounds(const double* lbs,
110  const double* ubs) {};
111 
112 public:
113  virtual DecompSolverResult*
114  solveDirect(const DecompSolution* startSol = NULL);
115 
116 
122  //-----------------------------------------------------------------------//
127  //-----------------------------------------------------------------------//
128 private:
132  DecompAlgoC(const DecompAlgoC&);
134 
135 public:
140  UtilParameters* utilParam):
141  DecompAlgo(CUT, app, utilParam),
142  m_classTag("D-ALGOC") {
143  std::string paramSection = DecompAlgoStr[CUT];
144  initSetup(utilParam, paramSection);
145  }
146 
148  UtilParameters* utilParam,
149  std::string& paramSection):
150  DecompAlgo(CUT, app, utilParam),
151  m_classTag("D-ALGOC") {
152  initSetup(utilParam, paramSection);
153  }
154 
155 
163 };
164 
165 #endif
bool updateObjBound(const double mostNegRC=-DecompBigNum)
Calculate the current objective LB, update the best, and store in history.
void phaseUpdate(DecompPhase &phase, DecompStatus &status)
Update of the phase for process loop.
const int getNodeIndex() const
Get a ptr to the current solution (in x-space).
Definition: DecompAlgo.h:750
DecompAlgoC & operator=(const DecompAlgoC &)
Disable copy constructors.
void createMasterProblem(DecompVarList &initVars)
Create the master problem (all algorithms must define this function).
int generateInitVars(DecompVarList &initVars)
Generate initial variables for master problem (PC/DC/RC).
Definition: DecompAlgoC.h:103
DecompStatus
Definition: Decomp.h:146
virtual DecompSolverResult * solveDirect(const DecompSolution *startSol=NULL)
Calculate the current objective LB, update the best, and store in history.
const std::string DecompAlgoStr[5]
Definition: Decomp.h:92
void phaseDone()
Calculate the current objective LB, update the best, and store in history.
DecompAlgoC(const DecompAlgoC &)
Disable copy constructors.
void initSetup(UtilParameters *utilParam, std::string &sectionParam)
Initial setup of algorithm structures and solver interfaces.
void recomposeSolution(const double *solution, double *rsolution)
Compose solution in x-space from current space.
DecompAlgoC(DecompApp *app, UtilParameters *utilParam)
Default constructors.
Definition: DecompAlgoC.h:139
Class for DECOMP algorithm Cutting Plane Method.
Definition: DecompAlgoC.h:34
~DecompAlgoC()
Destructor.
Definition: DecompAlgoC.h:159
DecompAlgoC(DecompApp *app, UtilParameters *utilParam, std::string &paramSection)
Disable copy constructors.
Definition: DecompAlgoC.h:147
void setMasterBounds(const double *lbs, const double *ubs)
Calculate the current objective LB, update the best, and store in history.
void phaseInit(DecompPhase &phase)
Calculate the current objective LB, update the best, and store in history.
Definition: DecompAlgoC.h:87
std::string m_classTag
Store the name of the class (for logging/debugging) - "who am I?".
Definition: DecompAlgoC.h:46
Storage of solver result.
Base class for DECOMP algorithms.
Definition: DecompAlgo.h:63
void setSubProbBounds(const double *lbs, const double *ubs)
Calculate the current objective LB, update the best, and store in history.
Definition: DecompAlgoC.h:109
std::list< DecompVar * > DecompVarList
Definition: Decomp.h:53
DecompPhase
Definition: Decomp.h:127
const double DecompBigNum
Definition: Decomp.h:61
The main application class.
Definition: DecompApp.h:50
Definition: Decomp.h:86