00001 //===========================================================================// 00002 // This file is part of the DIP Solver Framework. // 00003 // // 00004 // DIP is distributed under the Eclipse 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 // Conceptual Design: Matthew Galati, SAS Institute Inc. // 00010 // Ted Ralphs, Lehigh University // 00011 // // 00012 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, Ted Ralphs // 00013 // All Rights Reserved. // 00014 //===========================================================================// 00015 00016 //===========================================================================// 00017 #ifndef DecompMemPool_h_ 00018 #define DecompMemPool_h_ 00019 00020 #include "CoinError.hpp" 00021 00022 // --------------------------------------------------------------------- // 00023 class DecompMemPool { 00024 public: 00025 double* dblArrNCoreCols; 00026 double* dblArrNCoreRows; 00027 00028 public: 00029 void allocateMemory(const int nCoreCols, 00030 const int nCoreRows) { 00031 if (nCoreCols > 0) { 00032 dblArrNCoreCols = new double[nCoreCols]; 00033 CoinAssertHint(dblArrNCoreCols, "Error: Out of Memory"); 00034 } 00035 00036 if (nCoreRows > 0) { 00037 dblArrNCoreRows = new double[nCoreRows]; 00038 CoinAssertHint(dblArrNCoreRows, "Error: Out of Memory"); 00039 } 00040 } 00041 00042 public: 00043 DecompMemPool() : 00044 dblArrNCoreCols(0), 00045 dblArrNCoreRows(0) { 00046 } 00047 ~DecompMemPool() { 00048 UTIL_DELARR(dblArrNCoreCols); 00049 UTIL_DELARR(dblArrNCoreRows); 00050 } 00051 }; 00052 00053 #endif