Kindfield
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Friends Pages
hermiteintegral.h
Go to the documentation of this file.
1 #ifndef HERMITEINTEGRAL_H
2 #define HERMITEINTEGRAL_H
3 
4 #include "math/vector3.h"
5 #include "math/boysfunction.h"
6 
7 #include <armadillo>
8 
9 using namespace arma;
10 using namespace std;
11 
13 {
14 public:
15  HermiteIntegral(int dimensionMax);
16 
17  void reset(int dimension);
18  void set(double alpha, const Vector3 &A, int t, int u, int v);
19  void setupR(int t, int u, int v);
20 
21  const cube &operator [](const uword row) const;
22  cube &operator[](const uword row);
23  const cube &operator()(const uword row) const;
24  cube &operator()(const uword row);
25  double operator ()(const uword n, const uword t, const uword u, const uword v) const;
26 protected:
27  double m_alpha;
29  field<cube> m_R;
32 };
33 
34 inline const cube &HermiteIntegral::operator()(const uword row) const {
35  return m_R(row);
36 }
37 
38 inline double HermiteIntegral::operator()(const uword n, const uword t, const uword u, const uword v) const {
39  return m_R(n)(t,u,v);
40 }
41 
42 inline const cube &HermiteIntegral::operator[](const uword row) const {
43  return m_R[row];
44 }
45 
46 // Non-const version based on Scott Meyer's Item 3 in Effective C++ Third Edition
47 
48 inline cube &HermiteIntegral::operator()(const uword row)
49 {
50  return const_cast<cube&>(static_cast<const HermiteIntegral&>(*this)(row));
51 }
52 
53 inline cube &HermiteIntegral::operator[](const uword row)
54 {
55  return const_cast<cube&>(static_cast<const HermiteIntegral&>(*this)[row]);
56 }
57 
58 #endif // HERMITEINTEGRAL_H