v0.14.0
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 > Class Template Reference

#include <src/ftensor/src/FTensor/Ddg/Ddg_pointer.hpp>

Inheritance diagram for FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >:
[legend]
Collaboration diagram for FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >:
[legend]

Public Member Functions

 Ddg (T *d0000, T *d0010, T *d0011, T *d1000, T *d1010, T *d1011, T *d1100, T *d1110, T *d1111, const int i=1)
 
 Ddg (T *d0000, T *d0001, T *d0002, T *d0011, T *d0012, T *d0022, T *d0100, T *d0101, T *d0102, T *d0111, T *d0112, T *d0122, T *d0200, T *d0201, T *d0202, T *d0211, T *d0212, T *d0222, T *d1100, T *d1101, T *d1102, T *d1111, T *d1112, T *d1122, T *d1200, T *d1201, T *d1202, T *d1211, T *d1212, T *d1222, T *d2200, T *d2201, T *d2202, T *d2211, T *d2212, T *d2222, const int i=1)
 
template<class... U>
 Ddg (U *... d)
 
T & operator() (const int N1, const int N2, const int N3, const int N4)
 
operator() (const int N1, const int N2, const int N3, const int N4) const
 
T *restrict & ptr (const int N1, const int N2, const int N3, const int N4) const
 
template<char i, char j, char k, char l, int Dim01, int Dim23>
Ddg_Expr< Ddg< T *, Tensor_Dim01, Tensor_Dim23 >, T, Dim01, Dim23, i, j, k, loperator() (const Index< i, Dim01 > index1, const Index< j, Dim01 > index2, const Index< k, Dim23 > index3, const Index< l, Dim23 > index4)
 
template<char i, char j, char k, char l, int Dim01, int Dim23>
Ddg_Expr< const Ddg< T *, Tensor_Dim01, Tensor_Dim23 >, T, Dim01, Dim23, i, j, k, loperator() (const Index< i, Dim01 > index1, const Index< j, Dim01 > index2, const Index< k, Dim23 > index3, const Index< l, Dim23 > index4) const
 
template<char i, char j, int N0, int N1, int Dim>
Tensor2_symmetric_Expr< Ddg_number_01< const Ddg< T *, Tensor_Dim01, Tensor_Dim23 >, T, N0, N1 >, T, Dim, i, joperator() (const Number< N0 > n1, const Number< N1 > n2, const Index< i, Dim > index1, const Index< j, Dim > index2) const
 
template<char i, char j, int N0, int N1, int Dim>
Tensor2_symmetric_Expr< Ddg_number_rhs_01< Ddg< T *, Tensor_Dim01, Tensor_Dim23 >, T, N0, N1 >, T, Dim, i, joperator() (const Number< N0 > n1, const Number< N1 > n2, const Index< i, Dim > index1, const Index< j, Dim > index2)
 
template<char i, char j, char k, int N0, int Dim1, int Dim23>
Dg_Expr< Ddg_number_0< const Ddg< T *, Tensor_Dim01, Tensor_Dim23 >, T, N0 >, T, Dim23, Dim1, i, j, koperator() (const Number< N0 > n1, const Index< k, Dim1 > index3, const Index< i, Dim23 > index1, const Index< j, Dim23 > index2) const
 
template<char i, char j, char k, int N0, int Dim1, int Dim23>
Dg_Expr< Ddg_number_rhs_0< Ddg< T *, Tensor_Dim01, Tensor_Dim23 >, T, N0 >, T, Dim23, Dim1, i, j, koperator() (const Number< N0 > n1, const Index< k, Dim1 > index3, const Index< i, Dim23 > index1, const Index< j, Dim23 > index2)
 
template<char i, char j, int Dim>
Tensor2_symmetric_Expr< Ddg_numeral_01< const Ddg< T *, Tensor_Dim01, Tensor_Dim23 >, T >, T, Dim, i, joperator() (const int N0, const int N1, const Index< i, Dim > index1, const Index< j, Dim > index2) const
 
template<char i, char j, int Dim>
Tensor2_symmetric_Expr< Ddg_numeral_23< Ddg< T *, Tensor_Dim01, Tensor_Dim23 >, T >, T, Dim, i, joperator() (const Index< i, Dim > index1, const Index< j, Dim > index2, const int N2, const int N3) const
 
template<char i, int Dim>
Tensor1_Expr< Ddg_numeral_123< Ddg< T *, Tensor_Dim01, Tensor_Dim23 >, T >, T, Dim, ioperator() (const Index< i, Dim > index1, const int N1, const int N2, const int N3)
 
template<char i, int Dim>
Tensor1_Expr< Ddg_numeral_123< Ddg< T *, Tensor_Dim01, Tensor_Dim23 >, T >, T, Dim, ioperator() (const int N1, const Index< i, Dim > index1, const int N2, const int N3)
 
template<char i, char j, char k, int Dim1, int Dim23>
Dg_Expr< Ddg_numeral_0< const Ddg< T *, Tensor_Dim01, Tensor_Dim23 >, T >, T, Dim23, Dim1, i, j, koperator() (const int N0, const Index< k, Dim1 > index3, const Index< i, Dim23 > index1, const Index< j, Dim23 > index2) const
 
const Ddgoperator++ () const
 

Protected Attributes

T *restrict data [(Tensor_Dim01 *(Tensor_Dim01+1))/2][(Tensor_Dim23 *(Tensor_Dim23+1))/2]
 

Private Member Functions

template<int I>
 Ddg (const Ddg< PackPtr< T *, I >, Tensor_Dim01, Tensor_Dim23 > &)=delete
 

Private Attributes

const int inc
 

Detailed Description

template<class T, int Tensor_Dim01, int Tensor_Dim23>
class FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >

Definition at line 8 of file Ddg_pointer.hpp.

Constructor & Destructor Documentation

◆ Ddg() [1/4]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::Ddg ( T *  d0000,
T *  d0010,
T *  d0011,
T *  d1000,
T *  d1010,
T *  d1011,
T *  d1100,
T *  d1110,
T *  d1111,
const int  i = 1 
)
inline

Definition at line 18 of file Ddg_pointer.hpp.

20  : inc(i)
21  {
22  ptr(0, 0, 0, 0) = d0000;
23  ptr(0, 0, 1, 0) = d0010;
24  ptr(0, 0, 1, 1) = d0011;
25  ptr(1, 0, 0, 0) = d1000;
26  ptr(1, 0, 1, 0) = d1010;
27  ptr(1, 0, 1, 1) = d1011;
28  ptr(1, 1, 0, 0) = d1100;
29  ptr(1, 1, 1, 0) = d1110;
30  ptr(1, 1, 1, 1) = d1111;
31  }

◆ Ddg() [2/4]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::Ddg ( T *  d0000,
T *  d0001,
T *  d0002,
T *  d0011,
T *  d0012,
T *  d0022,
T *  d0100,
T *  d0101,
T *  d0102,
T *  d0111,
T *  d0112,
T *  d0122,
T *  d0200,
T *  d0201,
T *  d0202,
T *  d0211,
T *  d0212,
T *  d0222,
T *  d1100,
T *  d1101,
T *  d1102,
T *  d1111,
T *  d1112,
T *  d1122,
T *  d1200,
T *  d1201,
T *  d1202,
T *  d1211,
T *  d1212,
T *  d1222,
T *  d2200,
T *  d2201,
T *  d2202,
T *  d2211,
T *  d2212,
T *  d2222,
const int  i = 1 
)
inline

Definition at line 33 of file Ddg_pointer.hpp.

39  : inc(i)
40  {
41  ptr(0, 0, 0, 0) = d0000;
42  ptr(0, 0, 0, 1) = d0001;
43  ptr(0, 0, 0, 2) = d0002;
44  ptr(0, 0, 1, 1) = d0011;
45  ptr(0, 0, 1, 2) = d0012;
46  ptr(0, 0, 2, 2) = d0022;
47  ptr(0, 1, 0, 0) = d0100;
48  ptr(0, 1, 0, 1) = d0101;
49  ptr(0, 1, 0, 2) = d0102;
50  ptr(0, 1, 1, 1) = d0111;
51  ptr(0, 1, 1, 2) = d0112;
52  ptr(0, 1, 2, 2) = d0122;
53  ptr(0, 2, 0, 0) = d0200;
54  ptr(0, 2, 0, 1) = d0201;
55  ptr(0, 2, 0, 2) = d0202;
56  ptr(0, 2, 1, 1) = d0211;
57  ptr(0, 2, 1, 2) = d0212;
58  ptr(0, 2, 2, 2) = d0222;
59  ptr(1, 1, 0, 0) = d1100;
60  ptr(1, 1, 0, 1) = d1101;
61  ptr(1, 1, 0, 2) = d1102;
62  ptr(1, 1, 1, 1) = d1111;
63  ptr(1, 1, 1, 2) = d1112;
64  ptr(1, 1, 2, 2) = d1122;
65  ptr(1, 2, 0, 0) = d1200;
66  ptr(1, 2, 0, 1) = d1201;
67  ptr(1, 2, 0, 2) = d1202;
68  ptr(1, 2, 1, 1) = d1211;
69  ptr(1, 2, 1, 2) = d1212;
70  ptr(1, 2, 2, 2) = d1222;
71  ptr(2, 2, 0, 0) = d2200;
72  ptr(2, 2, 0, 1) = d2201;
73  ptr(2, 2, 0, 2) = d2202;
74  ptr(2, 2, 1, 1) = d2211;
75  ptr(2, 2, 1, 2) = d2212;
76  ptr(2, 2, 2, 2) = d2222;
77  }

◆ Ddg() [3/4]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
template<class... U>
FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::Ddg ( U *...  d)
inline

Definition at line 80 of file Ddg_pointer.hpp.

80 : data{d...}, inc(1) {}

◆ Ddg() [4/4]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
template<int I>
FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::Ddg ( const Ddg< PackPtr< T *, I >, Tensor_Dim01, Tensor_Dim23 > &  )
privatedelete

Member Function Documentation

◆ operator()() [1/13]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
template<char i, char j, int Dim>
Tensor2_symmetric_Expr< Ddg_numeral_23<Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T>, T, Dim, i, j> FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::operator() ( const Index< i, Dim >  index1,
const Index< j, Dim >  index2,
const int  N2,
const int  N3 
) const
inline

Definition at line 259 of file Ddg_pointer.hpp.

261  {
262  using TensorExpr
263  = Ddg_numeral_23<Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T>;
264  return Tensor2_symmetric_Expr<TensorExpr, T, Dim, i, j>(
265  TensorExpr(*this, N2, N3));
266  }

◆ operator()() [2/13]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
template<char i, int Dim>
Tensor1_Expr<Ddg_numeral_123<Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T>, T, Dim, i> FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::operator() ( const Index< i, Dim >  index1,
const int  N1,
const int  N2,
const int  N3 
)
inline

Definition at line 273 of file Ddg_pointer.hpp.

275  {
276  using TensorExpr
277  = Ddg_numeral_123<Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T>;
279  TensorExpr(*this, N1, N2, N3));
280  }

◆ operator()() [3/13]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
template<char i, char j, char k, char l, int Dim01, int Dim23>
Ddg_Expr<Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T, Dim01, Dim23, i, j, k, l> FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::operator() ( const Index< i, Dim01 >  index1,
const Index< j, Dim01 >  index2,
const Index< k, Dim23 >  index3,
const Index< l, Dim23 >  index4 
)
inline

Definition at line 167 of file Ddg_pointer.hpp.

169  {
170  return Ddg_Expr<Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T, Dim01, Dim23, i,
171  j, k, l>(*this);
172  }

◆ operator()() [4/13]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
template<char i, char j, char k, char l, int Dim01, int Dim23>
Ddg_Expr<const Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T, Dim01, Dim23, i, j, k, l> FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::operator() ( const Index< i, Dim01 >  index1,
const Index< j, Dim01 >  index2,
const Index< k, Dim23 >  index3,
const Index< l, Dim23 >  index4 
) const
inline

Definition at line 177 of file Ddg_pointer.hpp.

180  {
181  return Ddg_Expr<const Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T, Dim01,
182  Dim23, i, j, k, l>(*this);
183  }

◆ operator()() [5/13]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
template<char i, char j, char k, int Dim1, int Dim23>
Dg_Expr<Ddg_numeral_0<const Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T>, T, Dim23, Dim1, i, j, k> FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::operator() ( const int  N0,
const Index< k, Dim1 >  index3,
const Index< i, Dim23 >  index1,
const Index< j, Dim23 >  index2 
) const
inline

Definition at line 301 of file Ddg_pointer.hpp.

304  {
305  using TensorExpr
306  = Ddg_numeral_0<const Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T>;
307  return Dg_Expr<TensorExpr, T, Dim23, Dim1, i, j, k>(
308  TensorExpr(*this, N0));
309  }

◆ operator()() [6/13]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
template<char i, char j, int Dim>
Tensor2_symmetric_Expr< Ddg_numeral_01<const Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T>, T, Dim, i, j> FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::operator() ( const int  N0,
const int  N1,
const Index< i, Dim >  index1,
const Index< j, Dim >  index2 
) const
inline

Definition at line 247 of file Ddg_pointer.hpp.

249  {
250  using TensorExpr
251  = Ddg_numeral_01<const Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T>;
252  return Tensor2_symmetric_Expr<TensorExpr, T, Dim, i, j>(
253  TensorExpr(*this, N0, N1));
254  }

◆ operator()() [7/13]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
template<char i, int Dim>
Tensor1_Expr<Ddg_numeral_123<Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T>, T, Dim, i> FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::operator() ( const int  N1,
const Index< i, Dim >  index1,
const int  N2,
const int  N3 
)
inline

Definition at line 285 of file Ddg_pointer.hpp.

287  {
288  using TensorExpr
289  = Ddg_numeral_123<Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T>;
291  TensorExpr(*this, N1, N2, N3));
292  }

◆ operator()() [8/13]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
T& FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::operator() ( const int  N1,
const int  N2,
const int  N3,
const int  N4 
)
inline

Definition at line 86 of file Ddg_pointer.hpp.

87  {
88 #ifdef FTENSOR_DEBUG
89  if(N1 >= Tensor_Dim01 || N1 < 0 || N2 >= Tensor_Dim01 || N2 < 0
90  || N3 >= Tensor_Dim23 || N3 < 0 || N4 >= Tensor_Dim23 || N4 < 0)
91  {
92  std::stringstream s;
93  s << "Bad index in Dg<T*," << Tensor_Dim01 << "," << Tensor_Dim23
94  << ">.operator(" << N1 << "," << N2 << "," << N3 << "," << N4
95  << ")" << std::endl;
96  throw std::out_of_range(s.str());
97  }
98 #endif
99  return N1 > N2
100  ? (N3 > N4 ? *data[N1 + (N2 * (2 * Tensor_Dim01 - N2 - 1)) / 2]
101  [N3 + (N4 * (2 * Tensor_Dim23 - N4 - 1)) / 2]
102  : *data[N1 + (N2 * (2 * Tensor_Dim01 - N2 - 1)) / 2]
103  [N4 + (N3 * (2 * Tensor_Dim23 - N3 - 1)) / 2])
104  : (N3 > N4
105  ? *data[N2 + (N1 * (2 * Tensor_Dim01 - N1 - 1)) / 2]
106  [N3 + (N4 * (2 * Tensor_Dim23 - N4 - 1)) / 2]
107  : *data[N2 + (N1 * (2 * Tensor_Dim01 - N1 - 1)) / 2]
108  [N4 + (N3 * (2 * Tensor_Dim23 - N3 - 1)) / 2]);
109  }

◆ operator()() [9/13]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
T FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::operator() ( const int  N1,
const int  N2,
const int  N3,
const int  N4 
) const
inline

Definition at line 111 of file Ddg_pointer.hpp.

112  {
113 #ifdef FTENSOR_DEBUG
114  if(N1 >= Tensor_Dim01 || N1 < 0 || N2 >= Tensor_Dim01 || N2 < 0
115  || N3 >= Tensor_Dim23 || N3 < 0 || N4 >= Tensor_Dim23 || N4 < 0)
116  {
117  std::stringstream s;
118  s << "Bad index in Dg<T*," << Tensor_Dim01 << "," << Tensor_Dim23
119  << ">.operator(" << N1 << "," << N2 << "," << N3 << "," << N4
120  << ") const" << std::endl;
121  throw std::out_of_range(s.str());
122  }
123 #endif
124  return N1 > N2
125  ? (N3 > N4 ? *data[N1 + (N2 * (2 * Tensor_Dim01 - N2 - 1)) / 2]
126  [N3 + (N4 * (2 * Tensor_Dim23 - N4 - 1)) / 2]
127  : *data[N1 + (N2 * (2 * Tensor_Dim01 - N2 - 1)) / 2]
128  [N4 + (N3 * (2 * Tensor_Dim23 - N3 - 1)) / 2])
129  : (N3 > N4
130  ? *data[N2 + (N1 * (2 * Tensor_Dim01 - N1 - 1)) / 2]
131  [N3 + (N4 * (2 * Tensor_Dim23 - N4 - 1)) / 2]
132  : *data[N2 + (N1 * (2 * Tensor_Dim01 - N1 - 1)) / 2]
133  [N4 + (N3 * (2 * Tensor_Dim23 - N3 - 1)) / 2]);
134  }

◆ operator()() [10/13]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
template<char i, char j, char k, int N0, int Dim1, int Dim23>
Dg_Expr<Ddg_number_rhs_0<Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T, N0>, T, Dim23, Dim1, i, j, k> FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::operator() ( const Number< N0 >  n1,
const Index< k, Dim1 >  index3,
const Index< i, Dim23 >  index1,
const Index< j, Dim23 >  index2 
)
inline

Definition at line 231 of file Ddg_pointer.hpp.

233  {
234  using TensorExpr
235  = Ddg_number_rhs_0<Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T, N0>;
236  return Dg_Expr<TensorExpr, T, Dim23, Dim1, i, j, k>(*this);
237  }

◆ operator()() [11/13]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
template<char i, char j, char k, int N0, int Dim1, int Dim23>
Dg_Expr<Ddg_number_0<const Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T, N0>, T, Dim23, Dim1, i, j, k> FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::operator() ( const Number< N0 >  n1,
const Index< k, Dim1 >  index3,
const Index< i, Dim23 >  index1,
const Index< j, Dim23 >  index2 
) const
inline

Definition at line 219 of file Ddg_pointer.hpp.

222  {
223  using TensorExpr
224  = Ddg_number_0<const Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T, N0>;
225  return Dg_Expr<TensorExpr, T, Dim23, Dim1, i, j, k>(TensorExpr(*this));
226  }

◆ operator()() [12/13]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
template<char i, char j, int N0, int N1, int Dim>
Tensor2_symmetric_Expr< Ddg_number_rhs_01<Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T, N0, N1>, T, Dim, i, j> FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::operator() ( const Number< N0 >  n1,
const Number< N1 >  n2,
const Index< i, Dim >  index1,
const Index< j, Dim >  index2 
)
inline

Definition at line 205 of file Ddg_pointer.hpp.

207  {
208  using TensorExpr
209  = Ddg_number_rhs_01<Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T, N0, N1>;
210  return Tensor2_symmetric_Expr<TensorExpr, T, Dim, i, j>(*this);
211  }

◆ operator()() [13/13]

template<class T , int Tensor_Dim01, int Tensor_Dim23>
template<char i, char j, int N0, int N1, int Dim>
Tensor2_symmetric_Expr< Ddg_number_01<const Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T, N0, N1>, T, Dim, i, j> FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::operator() ( const Number< N0 >  n1,
const Number< N1 >  n2,
const Index< i, Dim >  index1,
const Index< j, Dim >  index2 
) const
inline

Definition at line 192 of file Ddg_pointer.hpp.

194  {
195  using TensorExpr
196  = Ddg_number_01<const Ddg<T *, Tensor_Dim01, Tensor_Dim23>, T, N0, N1>;
197  return Tensor2_symmetric_Expr<TensorExpr, T, Dim, i, j>(
198  TensorExpr(*this));
199  }

◆ operator++()

template<class T , int Tensor_Dim01, int Tensor_Dim23>
const Ddg& FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::operator++ ( ) const
inline

Definition at line 314 of file Ddg_pointer.hpp.

314  {
315  for(int i = 0; i < (Tensor_Dim01 * (Tensor_Dim01 + 1)) / 2; ++i)
316  for(int j = 0; j < (Tensor_Dim23 * (Tensor_Dim23 + 1)) / 2; ++j)
317  data[i][j] += inc;
318  return *this;
319  }

◆ ptr()

template<class T , int Tensor_Dim01, int Tensor_Dim23>
T* restrict& FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::ptr ( const int  N1,
const int  N2,
const int  N3,
const int  N4 
) const
inline

Definition at line 136 of file Ddg_pointer.hpp.

137  {
138 #ifdef FTENSOR_DEBUG
139  if(N1 >= Tensor_Dim01 || N1 < 0 || N2 >= Tensor_Dim01 || N2 < 0
140  || N3 >= Tensor_Dim23 || N3 < 0 || N4 >= Tensor_Dim23 || N4 < 0)
141  {
142  std::stringstream s;
143  s << "Bad index in Dg<T," << Tensor_Dim01 << "," << Tensor_Dim23
144  << ">.ptr(" << N1 << "," << N2 << "," << N3 << "," << N4 << ")"
145  << std::endl;
146  throw std::out_of_range(s.str());
147  }
148 #endif
149  return N1 > N2
150  ? (N3 > N4 ? data[N1 + (N2 * (2 * Tensor_Dim01 - N2 - 1)) / 2]
151  [N3 + (N4 * (2 * Tensor_Dim23 - N4 - 1)) / 2]
152  : data[N1 + (N2 * (2 * Tensor_Dim01 - N2 - 1)) / 2]
153  [N4 + (N3 * (2 * Tensor_Dim23 - N3 - 1)) / 2])
154  : (N3 > N4 ? data[N2 + (N1 * (2 * Tensor_Dim01 - N1 - 1)) / 2]
155  [N3 + (N4 * (2 * Tensor_Dim23 - N4 - 1)) / 2]
156  : data[N2 + (N1 * (2 * Tensor_Dim01 - N1 - 1)) / 2]
157  [N4 + (N3 * (2 * Tensor_Dim23 - N3 - 1)) / 2]);
158  }

Member Data Documentation

◆ data

template<class T , int Tensor_Dim01, int Tensor_Dim23>
T* restrict FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::data[(Tensor_Dim01 *(Tensor_Dim01+1))/2][(Tensor_Dim23 *(Tensor_Dim23+1))/2]
mutableprotected

Definition at line 15 of file Ddg_pointer.hpp.

◆ inc

template<class T , int Tensor_Dim01, int Tensor_Dim23>
const int FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::inc
private

Definition at line 10 of file Ddg_pointer.hpp.


The documentation for this class was generated from the following file:
FTensor::d
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:27
FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::ptr
T *restrict & ptr(const int N1, const int N2, const int N3, const int N4) const
Definition: Ddg_pointer.hpp:136
FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::inc
const int inc
Definition: Ddg_pointer.hpp:10
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Ddg< T *, Tensor_Dim01, Tensor_Dim23 >::data
T *restrict data[(Tensor_Dim01 *(Tensor_Dim01+1))/2][(Tensor_Dim23 *(Tensor_Dim23+1))/2]
Definition: Ddg_pointer.hpp:15
Tensor1_Expr
Definition: single.cpp:11
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21