Dip-All  0.91.0
AlpsDecompModel.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 #ifndef AlpsDecompModel_h_
18 #define AlpsDecompModel_h_
19 
20 //===========================================================================//
21 #include "Alps.h"
22 #include "AlpsModel.h"
23 #include "AlpsDecompParam.h"
24 
25 
26 //===========================================================================//
27 #include "DecompAlgo.h"
28 #include "DecompConstraintSet.h"
29 
30 //===========================================================================//
31 #include <string>
32 
33 //===========================================================================//
34 class AlpsTreeNode;
35 
36 //===========================================================================//
62 //===========================================================================//
63 
64 //===========================================================================//
65 class AlpsDecompModel : public AlpsModel {
66 
67 
68 private:
69 
70  //----------------------------------------------------------------------//
75  //----------------------------------------------------------------------//
79  std::string m_classTag;
80 
85 
90 
94  double m_bestLB;
95  double m_bestUB;
98 
103  //-----------------------------------------------------------------------//
108  //-----------------------------------------------------------------------//
109 public:
114  AlpsModel (),
115  m_classTag ("ALPSM"),
116  m_param (),
117  m_decompAlgo (NULL) {
118  }
119 
121  DecompAlgo* decompAlgo) :
122  AlpsModel (),
123  m_classTag ("ALPSM"),
124  m_param (utilParam),
125  m_decompAlgo(decompAlgo) {
126  if (decompAlgo == NULL)
127  throw UtilException("No DecompAlgo algorithm has been set.",
128  "AlpsDecompModel", "AlpsDecompModel");
129 
130  setAlpsSettings();
131  }
132 
136  virtual ~AlpsDecompModel() {}
142  //-----------------------------------------------------------------------//
147  //-----------------------------------------------------------------------//
151  virtual AlpsTreeNode* createRoot();
152 
154  virtual bool fathomAllNodes();
159  //-----------------------------------------------------------------------//
164  //-----------------------------------------------------------------------//
169 
173  void setAlpsSettings();
174 
178  inline void setDecompAlgo(DecompAlgo* decompAlgo) {
179  m_decompAlgo = decompAlgo;
180  }
185  //-----------------------------------------------------------------------//
190  //-----------------------------------------------------------------------//
194  //THINK: return ref?
196  return m_decompAlgo;
197  }
198 
200  return m_param;
201  }
202 
203 
207  inline const int getNumCoreRows() const {
209  }
210 
214  inline const int getNumCoreCols() const {
216  }
217 
221  inline const std::vector<std::string>& getColNames() const {
223  }
224 
228  inline const std::vector<std::string>& getRowNames() const {
230  }
231 
235  inline const DecompSolution* getBestSolution() const {
236  return m_decompAlgo->getXhatIPBest();
237  }
238 
239  const double getGlobalLB() const {
240  return m_bestLB;
241  }
242  const double getGlobalUB() const {
243  return m_bestUB;
244  }
245  const int getSolStatus() const {
246  return m_alpsStatus;
247  }
248  const int getNumNodesProcessed() const {
249  return m_nodesProcessed;
250  }
251 
255 };
256 
257 #endif
virtual AlpsTreeNode * createRoot()
Create the root node of the search tree.
DecompConstraintSet * getModel() const
Definition: DecompModel.h:38
AlpsDecompModel(UtilParameters &utilParam, DecompAlgo *decompAlgo)
Default constructors.
double m_bestUB
Store the name of the class (for logging/debugging) - &quot;who am I?&quot;.
virtual bool fathomAllNodes()
Return true, if all nodes can be fathomed.
DecompAlgo * m_decompAlgo
Pointer to decomp algorithm used for bounding.
const DecompSolution * getXhatIPBest() const
Get a ptr to the current solution (in x-space).
Definition: DecompAlgo.h:723
const int getNumCoreRows() const
Get number of rows in core decomp model.
Parameters passed through to Alps.
const DecompAlgoModel & getModelCore() const
Get a ptr to the current solution (in x-space).
Definition: DecompAlgo.h:682
std::string m_classTag
Store the name of the class (for logging/debugging) - &quot;who am I?&quot;.
const int getNumRows() const
Derivation of AlpsModel for DECOMP.
void setDecompAlgo(DecompAlgo *decompAlgo)
Solve with ALPS and DECOMP.
const int getSolStatus() const
Get a ptr to the decomp algorithm vector.
This class holds one node of the search tree.
Definition: AlpsTreeNode.h:50
const std::vector< std::string > & getRowNames() const
Get the row names in core decomp model.
AlpsExitStatus solve()
Solve with ALPS and DECOMP.
virtual ~AlpsDecompModel()
Destructor.
double m_bestLB
Objective of best solution found.
AlpsExitStatus
Definition: Alps.h:101
const int getNumCoreCols() const
Get number of cols in core decomp model.
const std::vector< std::string > & getColNames() const
Get the column names in core decomp model.
const std::vector< std::string > & getRowNames() const
int m_alpsStatus
Store the name of the class (for logging/debugging) - &quot;who am I?&quot;.
const std::vector< std::string > & getColNames() const
const double getGlobalLB() const
Get a ptr to the decomp algorithm vector.
const double getGlobalUB() const
Get a ptr to the decomp algorithm vector.
const int getNumNodesProcessed() const
Get a ptr to the decomp algorithm vector.
AlpsDecompModel()
Default constructors.
const int getNumCols() const
#define UtilException(msg, methodN, classN)
AlpsDecompParam m_param
Parameters for Alps.
int m_nodesProcessed
Store the name of the class (for logging/debugging) - &quot;who am I?&quot;.
Base class for DECOMP algorithms.
Definition: DecompAlgo.h:63
const DecompSolution * getBestSolution() const
Get the best solution found.
void setAlpsSettings()
Set the ALPS parameters.
AlpsDecompParam & getParam()
Get a ptr to the decomp algorithm vector.
DecompAlgo * getDecompAlgo()
Get a ptr to the decomp algorithm vector.