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, Lehigh University // 00008 // // 00009 // Copyright (C) 2002-2007, Lehigh University, Matthew Galati, and Ted Ralphs// 00010 // All Rights Reserved. // 00011 //===========================================================================// 00012 00013 #ifndef DECOMP_MEMPOOL_INCLUDED 00014 #define DECOMP_MEMPOOL_INCLUDED 00015 00016 #include "CoinError.hpp" 00017 00018 // --------------------------------------------------------------------- // 00019 class DecompMemPool { 00020 public: 00021 double* dblArrNCoreCols; 00022 double* dblArrNCoreRows; 00023 00024 public: 00025 void allocateMemory(const int nCoreCols, 00026 const int nCoreRows) throw(CoinError) { 00027 if (nCoreCols > 0) { 00028 dblArrNCoreCols = new double[nCoreCols]; 00029 CoinAssertHint(dblArrNCoreCols, "Error: Out of Memory"); 00030 } 00031 00032 if (nCoreRows > 0) { 00033 dblArrNCoreRows = new double[nCoreRows]; 00034 CoinAssertHint(dblArrNCoreRows, "Error: Out of Memory"); 00035 } 00036 } 00037 00038 public: 00039 DecompMemPool() : 00040 dblArrNCoreCols(0), 00041 dblArrNCoreRows(0) { 00042 } 00043 ~DecompMemPool() { 00044 UTIL_DELARR(dblArrNCoreCols); 00045 UTIL_DELARR(dblArrNCoreRows); 00046 } 00047 }; 00048 00049 #endif