Dip  0.92.4
BcpsDecompModel.h
Go to the documentation of this file.
1 //===========================================================================//
2 // This file is part of the Decomp Solver Framework. //
3 // //
4 // Decomp is distributed under the Common 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 // Copyright (C) 2002-2007, Lehigh University, Matthew Galati, and Ted Ralphs//
10 // All Rights Reserved. //
11 //===========================================================================//
12 
13 //copyright
14 
15 //===========================================================================//
16 #ifndef BcpsDecompModel_h_
17 #define BcpsDecompModel_h_
18 
19 //===========================================================================//
20 #include "DecompAlgo.h"
21 #include "BcpsModel.h"
22 
23 
24 //===========================================================================//
25 //---
26 //--- BcpsDecompModel is derived from BcpsModel
27 //--- BcpsModel has no virtual functions
28 //--- BcpsModel is derived from AlpsModel
29 //--- AlpsModel virtual methods that must be derived:
30 //--- (1) readInstance ?? why ??
31 //--- (2) createRoot
32 //---
33 
34 //===========================================================================//
35 class AlpsTreeNode;
36 //class BcpsModel;
37 //class DecompAlgo;
38 
39 //===========================================================================//
40 class BcpsDecompModel : public BcpsModel {
41 
42  private:
44  static const char * m_classTag;
45 
48 
51 
53  int numNodes_;
54 
55  private:
56  //---
57  //--- disable default copy constructor
58  //---
61 
62  public:
65  : BcpsModel()
66  {
67  init();
68  }
69 
71  BcpsDecompModel(DecompAlgo * decompAlgo) :
72  BcpsModel(),
73  decompAlgo_(decompAlgo)
74  {
75  init();
76  }
77 
79  virtual ~BcpsDecompModel(){
80  }
81 
82  //---
83  //--- pure virtual functions from BcpsModel or AlpsModel
84  //---
85 
86  //TODO: this will be decomp's read-in?
88  void readInstance(const char* dataFile);
89 
92 
93  //---
94  //--- functions for setup or access
95  //---
97  void init();
98 
100  inline DecompAlgo * getDecompAlgo() const { return decompAlgo_; }
101 
102  //TODO: should this be at Bcps layer?
104  inline void setActiveNode(AlpsTreeNode * node) { activeNode_ = node; }
105 
107  inline void addNumNodes(int newNodes = 1) { numNodes_ += newNodes; }
108 
109  inline int getNumRows(){
110  return decompAlgo_->m_modelCore->getNumRows();
111  }
112 
113  inline int getNumCols(){
114  return decompAlgo_->m_modelCore->getNumCols();
115  }
116 
117 };
118 
119 #endif
void readInstance(const char *dataFile)
Read in the instance data.
BcpsDecompModel & operator=(const BcpsDecompModel &)
void init()
initialize the model data
AlpsTreeNode * createRoot()
create the root node
void setActiveNode(AlpsTreeNode *node)
set active node
DecompSubModel m_modelCore
Store the name of the class (for logging/debugging) - "who am I?".
Definition: DecompAlgo.h:161
BcpsDecompModel()
Default constructor.
This class holds one node of the search tree.
Definition: AlpsTreeNode.h:50
static const char * m_classTag
class tag for debugging
DecompAlgo * decompAlgo_
ptr to decomp algo
int numNodes_
number of processed nodes
void addNumNodes(int newNodes=1)
increment node count
DecompAlgo * getDecompAlgo() const
get a ptr to the decomp algo
BcpsDecompModel(DecompAlgo *decompAlgo)
Default constructor.
AlpsTreeNode * activeNode_
ptr to active node
virtual ~BcpsDecompModel()
Destructor.
Base class for DECOMP algorithms.
Definition: DecompAlgo.h:62