FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AccessPattern.hpp
1 #ifndef _AccessPattern_h_
2 #define _AccessPattern_h_
3 
4 /*--------------------------------------------------------------------*/
5 /* Copyright 2005 Sandia Corporation. */
6 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
7 /* non-exclusive license for use of this work by or on behalf */
8 /* of the U.S. Government. Export of this program may require */
9 /* a license from the United States Government. */
10 /*--------------------------------------------------------------------*/
11 
12 #include <cstdlib>
13 
14 class AccessPattern {
15  public:
16  AccessPattern() : ID_(-1), numRowIDs_(0), numFieldsPerRow_(NULL),
17  rowFieldIDs_(NULL), numColIDsPerRow_(0), numFieldsPerCol_(NULL),
18  colFieldIDs_(NULL), interleaveStrategy_(0) {}
19 
20  ~AccessPattern()
21  {
22  int i;
23  for(i=0; i<numRowIDs_; i++) delete [] rowFieldIDs_[i];
24  for(i=0; i<numColIDsPerRow_; i++) delete [] colFieldIDs_[i];
25 
26  delete [] rowFieldIDs_;
27  delete [] colFieldIDs_;
28  delete [] numFieldsPerRow_;
29  delete [] numFieldsPerCol_;
30  numRowIDs_ = 0;
31  numColIDsPerRow_ = 0;
32  }
33 
34  int ID_;
35  int numRowIDs_;
36  int* numFieldsPerRow_;
37  int** rowFieldIDs_;
38  int numColIDsPerRow_;
39  int* numFieldsPerCol_;
40  int** colFieldIDs_;
41  int interleaveStrategy_;
42 };
43 
44 #endif // _AccessPattern_h_