FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CoefAccess.hpp
Go to the documentation of this file.
1 #ifndef _CoefAccess_h_
2 #define _CoefAccess_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 CoefAccess {
15  public:
18  coefs_(NULL) {}
19 
20  CoefAccess(const CoefAccess& src)
21  {
22  *this = src;
23  }
24 
26  {
27  patternID_ = src.patternID_;
28 
29  numRowIDs_ = src.numRowIDs_;
33 
34  if (numRowIDs_ > 0) {
36  for(int i=0; i<numRowIDs_; i++) rowIDs_[i] = src.rowIDs_[i];
37  }
38 
39  if (numColIDsPerRow_ > 0 && numRowIDs_ > 0) {
40  int len = numRowIDs_*numColIDsPerRow_;
41  colIDs_ = new GlobalID[len];
42  for(int i=0; i<len; i++) colIDs_[i] = src.colIDs_[i];
43  }
44 
45  if (numRowCoefs_ > 0 && numColCoefs_ > 0) {
46  int len = numRowCoefs_*numColCoefs_;
47  coefs_ = new double[len];
48  for(int i=0; i<len; i++) coefs_[i] = src.coefs_[i];
49  }
50 
51  return(*this);
52  }
53 
55  {
56  delete [] rowIDs_; delete [] colIDs_; delete [] coefs_;
58  }
59 
61 
64 
67 
70 
71  double* coefs_;
72 };
73 
74 #endif // _CoefAccess_h_
CoefAccess & operator=(const CoefAccess &src)
Definition: CoefAccess.hpp:25
int GlobalID
Definition: fei_defs.h:60
int numRowIDs_
Definition: CoefAccess.hpp:62
int numColCoefs_
Definition: CoefAccess.hpp:69
int patternID_
Definition: CoefAccess.hpp:60
int numRowCoefs_
Definition: CoefAccess.hpp:68
double * coefs_
Definition: CoefAccess.hpp:71
GlobalID * colIDs_
Definition: CoefAccess.hpp:66
int numColIDsPerRow_
Definition: CoefAccess.hpp:65
CoefAccess(const CoefAccess &src)
Definition: CoefAccess.hpp:20
GlobalID * rowIDs_
Definition: CoefAccess.hpp:63