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 #ifndef DECOMP_CONSTRAINTSET_INCLUDED 00014 #define DECOMP_CONSTRAINTSET_INCLUDED 00015 00016 #include "UtilMacros.h" 00017 #include "DecompPortable.h" 00018 00019 // --------------------------------------------------------------------- // 00020 class DecompConstraintSet { 00021 private: 00022 //need these if vector? 00023 //DecompConstraintSet(const DecompConstraintSet &); 00024 //DecompConstraintSet & operator=(const DecompConstraintSet &); 00025 00026 //THINK - better overall to store as sense! 00027 public: 00028 //do we want this dependence on CoinPackedMatrix? 00029 //do we want all this depenence on STL vectors? 00030 00031 //how does this all work for removing cuts?? if using vector!? 00032 00033 //must flip to row ordered? 00034 CoinPackedMatrix* M; 00035 int nBaseRowsOrig; 00036 int nBaseRows; 00037 vector<string> rowHash; 00038 vector<char> rowSense; 00039 vector<double> rowRhs; //ugh... have to carry around 00040 //ranges? 00041 00042 vector<double> rowLB; //vector or double *? 00043 vector<double> rowUB; 00044 vector<double> colLB; 00045 vector<double> colUB; 00046 vector<int> integerVars; 00047 //TODO: why not vector if rest are... nice if consistent 00048 //double * objCoeff; //only used for modelCore? 00049 00050 //TODO: colNames, rowNames 00051 00052 00053 public: 00054 inline const int getNumRows() const { 00055 return M->getNumRows(); 00056 } 00057 inline const int getNumCols() const { 00058 return M->getNumCols(); 00059 } 00060 00061 public: 00062 void createRowHash(); 00063 void checkSenseAndBound(); 00064 void sensesToBounds(); 00065 void boundsToSenses(); 00066 00067 public: 00068 DecompConstraintSet() : 00069 M(0), 00070 nBaseRowsOrig(0), 00071 nBaseRows(0), 00072 rowSense(), 00073 rowRhs(), 00074 rowLB(), 00075 rowUB(), 00076 colLB(), 00077 colUB(), 00078 integerVars() 00079 //objCoeff(0) 00080 {}; 00081 00082 ~DecompConstraintSet() { 00083 UTIL_DELPTR(M); 00084 }; 00085 }; 00086 00087 #endif