Dip  0.95.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 // 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);
102  int generateInitVars(DecompVarList& initVars) {
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&);
132  DecompAlgoC& operator=(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
DecompStatus
Definition: Decomp.h:184
@ CUT
Definition: Decomp.h:124
std::list< DecompVar * > DecompVarList
Definition: Decomp.h:91
DecompPhase
Definition: Decomp.h:165
@ PHASE_CUT
Definition: Decomp.h:168
const double DecompBigNum
Definition: Decomp.h:99
Class for DECOMP algorithm Cutting Plane Method.
Definition: DecompAlgoC.h:33
DecompAlgoC(DecompApp *app, UtilParameters &utilParam)
Default constructors.
Definition: DecompAlgoC.h:138
~DecompAlgoC()
Destructor.
Definition: DecompAlgoC.h:149
virtual DecompSolverResult * solveDirect(const DecompSolution *startSol=NULL)
Base class for DECOMP algorithms.
Definition: DecompAlgo.h:62
const int getNodeIndex() const
Definition: DecompAlgo.h:752
void initSetup()
Initial setup of algorithm structures and solver interfaces.
The main application class.
Definition: DecompApp.h:48
Storage of solver result.