Dip  0.92.4
MAD_MemPool.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 // Authors: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8 // Ted Ralphs, Lehigh University (ted@lehigh.edu) //
9 // Jiadong Wang, Lehigh University (jiw408@lehigh.edu) //
10 // //
11 // Copyright (C) 2002-2019, Lehigh University, Matthew Galati, and Ted Ralphs//
12 // All Rights Reserved. //
13 //===========================================================================//
14 
15 #ifndef MAD_MEMPOOL_INCLUDED
16 #define MAD_MEMPOOL_INCLUDED
17 
18 #include "CoinError.hpp"
19 
20 // --------------------------------------------------------------------- //
21 class MAD_MemPool {
22  public:
25  double * dblArrNCoreCols;
26  pair<int, double> * pIntDblArrNCoreCols;
27  double * dblArrNBlocks;
28 
29  public:
30  void allocateMemory(const int nOrigRows,
31  const int nCoreCols,
32  const int nBlocks ) throw(CoinError) {
33  if(nOrigRows > 0){
34  intArrNOrigRows = new int[nOrigRows];
35  CoinAssertHint(intArrNOrigRows, "Error: Out of Memory");
36  }
37  if(nCoreCols > 0){
38  intArrNCoreCols = new int[nCoreCols];
39  dblArrNCoreCols = new double[nCoreCols];
40  pIntDblArrNCoreCols = new pair<int,double>[nCoreCols];
44  "Error: Out of Memory");
45  }
46  if(nBlocks > 0){
47  dblArrNBlocks = new double[nBlocks];
48  CoinAssertHint(dblArrNBlocks, "Error: Out of Memory");
49  }
50  }
51 
52 public:
54  intArrNOrigRows(0),
55  intArrNCoreCols(0),
56  dblArrNCoreCols(0),
58  dblArrNBlocks(0)
59  {
60  }
62  {
68  }
69 };
70 
71 #endif
double * dblArrNCoreCols
Definition: MAD_MemPool.h:25
#define UTIL_DELARR(x)
Definition: UtilMacros.h:29
#define CoinAssertHint(expression, hint)
Definition: CoinError.hpp:184
void allocateMemory(const int nOrigRows, const int nCoreCols, const int nBlocks)
Definition: MAD_MemPool.h:30
pair< int, double > * pIntDblArrNCoreCols
Definition: MAD_MemPool.h:26
int * intArrNOrigRows
Definition: MAD_MemPool.h:23
Error Class thrown by an exception.
Definition: CoinError.hpp:42
double * dblArrNBlocks
Definition: MAD_MemPool.h:27
int * intArrNCoreCols
Definition: MAD_MemPool.h:24