00001 //===========================================================================// 00002 // This file is part of the Decomp Solver Framework. // 00003 // // 00004 // Decomp is distributed under the Common Public License as part of the // 00005 // COIN-OR repository (http://www.coin-or.org). // 00006 // // 00007 // Author: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) // 00008 // // 00009 // Copyright (C) 2002-2007, Lehigh University, Matthew Galati, and Ted Ralphs// 00010 // All Rights Reserved. // 00011 //===========================================================================// 00012 00013 //copyright 00014 00015 //===========================================================================// 00016 #ifndef BcpsDecompModel_h_ 00017 #define BcpsDecompModel_h_ 00018 00019 //===========================================================================// 00020 #include "DecompAlgo.h" 00021 #include "BcpsModel.h" 00022 00023 00024 //===========================================================================// 00025 //--- 00026 //--- BcpsDecompModel is derived from BcpsModel 00027 //--- BcpsModel has no virtual functions 00028 //--- BcpsModel is derived from AlpsModel 00029 //--- AlpsModel virtual methods that must be derived: 00030 //--- (1) readInstance ?? why ?? 00031 //--- (2) createRoot 00032 //--- 00033 00034 //===========================================================================// 00035 class AlpsTreeNode; 00036 //class BcpsModel; 00037 //class DecompAlgo; 00038 00039 //===========================================================================// 00040 class BcpsDecompModel : public BcpsModel { 00041 00042 private: 00044 static const char * m_classTag; 00045 00047 DecompAlgo * decompAlgo_; 00048 00050 AlpsTreeNode * activeNode_; 00051 00053 int numNodes_; 00054 00055 private: 00056 //--- 00057 //--- disable default copy constructor 00058 //--- 00059 BcpsDecompModel(const BcpsDecompModel&); 00060 BcpsDecompModel& operator=(const BcpsDecompModel&); 00061 00062 public: 00064 BcpsDecompModel() 00065 : BcpsModel() 00066 { 00067 init(); 00068 } 00069 00071 BcpsDecompModel(DecompAlgo * decompAlgo) : 00072 BcpsModel(), 00073 decompAlgo_(decompAlgo) 00074 { 00075 init(); 00076 } 00077 00079 virtual ~BcpsDecompModel(){ 00080 } 00081 00082 //--- 00083 //--- pure virtual functions from BcpsModel or AlpsModel 00084 //--- 00085 00086 //TODO: this will be decomp's read-in? 00088 void readInstance(const char* dataFile); 00089 00091 AlpsTreeNode * createRoot(); 00092 00093 //--- 00094 //--- functions for setup or access 00095 //--- 00097 void init(); 00098 00100 inline DecompAlgo * getDecompAlgo() const { return decompAlgo_; } 00101 00102 //TODO: should this be at Bcps layer? 00104 inline void setActiveNode(AlpsTreeNode * node) { activeNode_ = node; } 00105 00107 inline void addNumNodes(int newNodes = 1) { numNodes_ += newNodes; } 00108 00109 inline int getNumRows(){ 00110 return decompAlgo_->m_modelCore->getNumRows(); 00111 } 00112 00113 inline int getNumCols(){ 00114 return decompAlgo_->m_modelCore->getNumCols(); 00115 } 00116 00117 }; 00118 00119 #endif