Dip  0.92.4
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 // 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 DecompAlgoC_h_
18 #define DecompAlgoC_h_
19 
20 //===========================================================================//
26 //===========================================================================//
27 
28 //===========================================================================//
29 #include "Decomp.h"
30 #include "DecompAlgo.h"
31 
32 //===========================================================================//
33 class DecompAlgoC : public DecompAlgo {
34 private:
35 
36  //----------------------------------------------------------------------//
41  //----------------------------------------------------------------------//
45  std::string m_classTag;
50  //-----------------------------------------------------------------------//
55  //-----------------------------------------------------------------------//
59  void createMasterProblem(DecompVarList& initVars);
60 
66  void recomposeSolution(const double* solution,
67  double* rsolution);
68 
73  //-----------------------------------------------------------------------//
78  //-----------------------------------------------------------------------//
79 
84  bool updateObjBound(const double mostNegRC = -DecompBigNum);
85 
86  void phaseInit(DecompPhase& phase) {
87  if (getNodeIndex() == 0) {
88  phase = PHASE_CUT;
89  }
90  }
91  void phaseDone();//chance to run DC
92 
96  void phaseUpdate(DecompPhase& phase,
97  DecompStatus& status);
103  return 0;
104  }
105 
106  void setMasterBounds(const double* lbs,
107  const double* ubs);
108  void setSubProbBounds(const double* lbs,
109  const double* ubs) {};
110 
111 public:
112  virtual DecompSolverResult*
113  solveDirect(const DecompSolution* startSol = NULL);
114 
115 
121  //-----------------------------------------------------------------------//
126  //-----------------------------------------------------------------------//
127 private:
131  DecompAlgoC(const DecompAlgoC&);
133 
134 public:
139  UtilParameters& utilParam):
140  DecompAlgo(CUT, app, utilParam, false),
141  m_classTag("D-ALGOC")
142  {
143  initSetup();
144  }
145 
153 };
154 
155 #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:752
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:102
DecompStatus
Definition: Decomp.h:184
virtual DecompSolverResult * solveDirect(const DecompSolution *startSol=NULL)
Calculate the current objective LB, update the best, and store in history.
void phaseDone()
Calculate the current objective LB, update the best, and store in history.
DecompAlgoC(const DecompAlgoC &)
Disable copy constructors.
void recomposeSolution(const double *solution, double *rsolution)
Compose solution in x-space from current space.
Class for DECOMP algorithm Cutting Plane Method.
Definition: DecompAlgoC.h:33
~DecompAlgoC()
Destructor.
Definition: DecompAlgoC.h:149
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:86
std::string m_classTag
Store the name of the class (for logging/debugging) - "who am I?".
Definition: DecompAlgoC.h:45
Storage of solver result.
Base class for DECOMP algorithms.
Definition: DecompAlgo.h:62
void setSubProbBounds(const double *lbs, const double *ubs)
Calculate the current objective LB, update the best, and store in history.
Definition: DecompAlgoC.h:108
std::list< DecompVar * > DecompVarList
Definition: Decomp.h:91
DecompPhase
Definition: Decomp.h:165
DecompAlgoC(DecompApp *app, UtilParameters &utilParam)
Default constructors.
Definition: DecompAlgoC.h:138
const double DecompBigNum
Definition: Decomp.h:99
The main application class.
Definition: DecompApp.h:48
Definition: Decomp.h:124
void initSetup()
Initial setup of algorithm structures and solver interfaces.