v0.5.86
Tensor4_ddg_Expr.hpp
Go to the documentation of this file.
1 /* Declares a wrapper class for rank 4 Tensor expressions symmetric on
2  the first two and last two indices. */
3 
17 #include "minus_Tensor4_ddg.hpp"
18 // #include "Tensor4_ddg_mod_Tensor4_ddg.hpp"
19 
20 template<class A, class T, int Dim01, int Dim23,
21  char i, char j, char k, char l>
23 {
24  A iter;
25 public:
26  Tensor4_ddg_Expr(A &a): iter(a) {}
27  T operator()(const int N1, const int N2, const int N3, const int N4)
28  const
29  {
30  return iter(N1,N2,N3,N4);
31  }
32 };
33 
34 template<class A, class T, int Tensor_Dim01, int Tensor_Dim23,
35  int Dim01, int Dim23, char i, char j, char k, char l>
36 class Tensor4_ddg_Expr<Tensor4_ddg<A,Tensor_Dim01,Tensor_Dim23>,T,Dim01,Dim23,i,j,k,l>
37 {
39 public:
41  T operator()(const int N1, const int N2, const int N3, const int N4)
42  const
43  {
44  return iter(N1,N2,N3,N4);
45  }
46 
47  /* Various assignment operators. I have to explicitly declare the
48  second operator= because otherwise the compiler will generate its
49  own and not use the template code. */
50 
51  template<class B, class U>
53  operator=(const Tensor4_ddg_Expr<B,U,Dim01,Dim23,i,j,k,l> &result);
54 
56  operator=(const Tensor4_ddg_Expr<Tensor4_ddg<A,Tensor_Dim01,Tensor_Dim23>,T,Dim01,Dim23,i,j,k,l> &result);
57 
58  /* This is for int's, double's, etc. */
59 
60  template <class U> inline
62  operator=(const U &d);
63 
64  template <class U> inline
66  operator*=(const U &d);
67 
68 };
69 
T operator()(const int N1, const int N2, const int N3, const int N4) const
T operator()(const int N1, const int N2, const int N3, const int N4) const
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T *> &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: dTensor0.hpp:22