v0.13.2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
FTensor::Levi_Civita< T > Class Template Reference

Levi_Civita Classes. More...

#include <src/ftensor/src/FTensor/Levi_Civita.hpp>

Public Member Functions

constexpr T operator() (const int N1, const int N2) const
 Rank 2. More...
 
template<char i, char j, int Dim0, int Dim1>
std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type operator() (const Index< i, Dim0 > &, const Index< j, Dim1 > &)
 
template<char i, int Dim0>
constexpr auto operator() (const Index< i, Dim0 > &, const int &N1)
 
template<char j, int Dim1>
constexpr auto operator() (const int &N0, const Index< j, Dim1 > &)
 
constexpr T operator() (const int N1, const int N2, const int N3) const
 Rank 3. More...
 
template<char i, char j, char k, int Dim0, int Dim1, int Dim2>
std::enable_if<(Dim0<=3 &&Dim1<=3 &&Dim2<=3), Tensor3_Expr< Levi_Civita< T >, T, Dim0, Dim1, Dim2, i, j, k > >::type operator() (const Index< i, Dim0 > &, const Index< j, Dim1 > &, const Index< k, Dim2 > &)
 
template<char i, char j, int Dim0, int Dim1>
auto operator() (const Index< i, Dim0 > &, const Index< j, Dim1 > &, const int &N2)
 
template<char i, char k, int Dim0, int Dim2>
auto operator() (const Index< i, Dim0 > &, const int &N1, const Index< k, Dim2 > &)
 
template<char j, char k, int Dim1, int Dim2>
auto operator() (const int &N0, const Index< j, Dim1 > &, const Index< k, Dim2 > &)
 
template<char i, int Dim0>
auto operator() (const Index< i, Dim0 > &, const int &N1, const int &N2)
 
template<char j, int Dim1>
auto operator() (const int &N0, const Index< j, Dim1 > &, const int &N2)
 
template<char k, int Dim2>
auto operator() (const int &N0, const int &N1, const Index< k, Dim2 > &)
 
constexpr T operator() (const int N1, const int N2, const int N3, const int N4) const
 Rank 4. More...
 
template<char i, char j, char k, char l, int Dim0, int Dim1, int Dim2, int Dim3>
std::enable_if<(Dim0<=4 &&Dim1<=4 &&Dim2<=4 &&Dim3<=4), Tensor4_Expr< Levi_Civita< T >, T, Dim0, Dim1, Dim2, Dim3, i, j, k, l > >::type operator() (const Index< i, Dim0 > &, const Index< j, Dim1 > &, const Index< k, Dim2 > &, const Index< l, Dim3 > &)
 
template<char i, char j, char k, int Dim0, int Dim1, int Dim2>
constexpr auto operator() (const Index< i, Dim0 > &, const Index< j, Dim1 > &, const Index< k, Dim2 > &, const int &N3)
 
template<char i, char j, char l, int Dim0, int Dim1, int Dim3>
constexpr auto operator() (const Index< i, Dim0 > &, const Index< j, Dim1 > &, const int &N2, const Index< l, Dim3 > &)
 
template<char i, char k, char l, int Dim0, int Dim2, int Dim3>
constexpr auto operator() (const Index< i, Dim0 > &, const int &N1, const Index< k, Dim2 > &, const Index< l, Dim3 > &)
 
template<char j, char k, char l, int Dim1, int Dim2, int Dim3>
constexpr auto operator() (const int &N0, const Index< j, Dim1 > &, const Index< k, Dim2 > &, const Index< l, Dim3 > &)
 
template<char i, char j, int Dim0, int Dim1>
constexpr auto operator() (const Index< i, Dim0 > &, const Index< j, Dim1 > &, const int &N2, const int &N3)
 
template<char i, char k, int Dim0, int Dim2>
constexpr auto operator() (const Index< i, Dim0 > &, const int &N1, const Index< k, Dim2 > &, const int &N3)
 
template<char j, char k, int Dim1, int Dim2>
constexpr auto operator() (const int &N0, const Index< j, Dim1 > &, const Index< k, Dim2 > &, const int &N3)
 
template<char i, char l, int Dim0, int Dim3>
constexpr auto operator() (const Index< i, Dim0 > &, const int &N1, const int &N2, const Index< l, Dim3 > &)
 
template<char j, char l, int Dim1, int Dim3>
constexpr auto operator() (const int &N0, const Index< j, Dim1 > &, const int &N2, const Index< l, Dim3 > &)
 
template<char k, char l, int Dim2, int Dim3>
constexpr auto operator() (const int &N0, const int &N1, const Index< k, Dim2 > &, const Index< l, Dim3 > &)
 
template<char i, int Dim0>
constexpr auto operator() (const Index< i, Dim0 > &, const int &N1, const int &N2, const int &N3)
 
template<char j, int Dim1>
constexpr auto operator() (const int &N0, const Index< j, Dim1 > &, const int &N2, const int &N3)
 
template<char k, int Dim2>
constexpr auto operator() (const int &N0, const int &N1, const Index< k, Dim2 > &, const int &N3)
 
template<char l, int Dim3>
constexpr auto operator() (const int &N0, const int &N1, const int &N2, const Index< l, Dim3 > &)
 

Detailed Description

template<class T = int>
class FTensor::Levi_Civita< T >

Levi_Civita Classes.

Definition at line 10 of file Levi_Civita.hpp.

Member Function Documentation

◆ operator()() [1/28]

template<class T = int>
template<char i, char j, int Dim0, int Dim1>
std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type FTensor::Levi_Civita< T >::operator() ( const Index< i, Dim0 > &  ,
const Index< j, Dim1 > &   
)
inline

Definition at line 23 of file Levi_Civita.hpp.

24 {
25 return Tensor2_Expr<Levi_Civita<T>, T, Dim0, Dim1, i, j>(*this);
26 };
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
const double T

◆ operator()() [2/28]

template<class T = int>
template<char i, char j, char k, int Dim0, int Dim1, int Dim2>
std::enable_if<(Dim0<=3 &&Dim1<=3 &&Dim2<=3), Tensor3_Expr< Levi_Civita< T >, T, Dim0, Dim1, Dim2, i, j, k > >::type FTensor::Levi_Civita< T >::operator() ( const Index< i, Dim0 > &  ,
const Index< j, Dim1 > &  ,
const Index< k, Dim2 > &   
)
inline

Definition at line 76 of file Levi_Civita.hpp.

78 {
79 return Tensor3_Expr<Levi_Civita<T>, T, Dim0, Dim1, Dim2, i, j, k>(*this);
80 };
FTensor::Index< 'k', 3 > k

◆ operator()() [3/28]

template<class T = int>
template<char i, char j, char k, char l, int Dim0, int Dim1, int Dim2, int Dim3>
std::enable_if<(Dim0<=4 &&Dim1<=4 &&Dim2<=4 &&Dim3<=4), Tensor4_Expr< Levi_Civita< T >, T, Dim0, Dim1, Dim2, Dim3, i, j, k, l > >::type FTensor::Levi_Civita< T >::operator() ( const Index< i, Dim0 > &  ,
const Index< j, Dim1 > &  ,
const Index< k, Dim2 > &  ,
const Index< l, Dim3 > &   
)
inline

Definition at line 240 of file Levi_Civita.hpp.

242 {
243 return Tensor4_Expr<Levi_Civita<T>, T, Dim0, Dim1, Dim2, Dim3, i, j, k,
244 l>(*this);
245 }
FTensor::Index< 'l', 3 > l

◆ operator()() [4/28]

template<class T = int>
template<char i, char j, char k, int Dim0, int Dim1, int Dim2>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const Index< i, Dim0 > &  ,
const Index< j, Dim1 > &  ,
const Index< k, Dim2 > &  ,
const int &  N3 
)
inlineconstexpr

Definition at line 248 of file Levi_Civita.hpp.

250 {
251 static_assert(
252 Dim0 <= 4 && Dim1 <= 4 && Dim2 <= 4,
253 "Index dimension exceeds the maximum for Rank 4 Levi-Civita Tensor");
254#ifdef FTENSOR_DEBUG
255 if(N3 >= 4 || N3 < 0)
256 throw std::out_of_range(
257 "Bad index in Levi_Civita<T>::operator()("
258 "Index<"
259 + std::basic_string<char>{i} + ", " + std::to_string(Dim0)
260 + ">, "
261 "Index<"
262 + std::basic_string<char>{j} + ", " + std::to_string(Dim1)
263 + ">, "
264 "Index<"
265 + std::basic_string<char>{k} + ", " + std::to_string(Dim2) + ">, "
266 + std::to_string(N3) + ")\n");
267#endif
268 auto TensorExpr
269 = [this, N3](const int &N0, const int &N1, const int &N2) {
270 return this->operator()(N0, N1, N2, N3);
271 };
272 return Tensor3_Expr<decltype(TensorExpr), T, Dim0, Dim1, Dim2, i, j, k>{
273 TensorExpr};
274 }
static Number< 2 > N2
static Number< 1 > N1
static Number< 0 > N0
constexpr T operator()(const int N1, const int N2) const
Rank 2.
Definition: Levi_Civita.hpp:14

◆ operator()() [5/28]

template<class T = int>
template<char i, char j, int Dim0, int Dim1>
auto FTensor::Levi_Civita< T >::operator() ( const Index< i, Dim0 > &  ,
const Index< j, Dim1 > &  ,
const int &  N2 
)
inline

Definition at line 84 of file Levi_Civita.hpp.

85 {
86 static_assert(
87 Dim0 <= 3 && Dim1 <= 3,
88 "Index dimension exceeds the maximum for Rank 3 Levi-Civita Tensor");
89#ifdef FTENSOR_DEBUG
90 if(N2 >= 3 || N2 < 0)
91 throw std::out_of_range(
92 "Bad index in Levi_Civita<T>::operator()("
93 "Index<"
94 + std::basic_string<char>{i} + ", " + std::to_string(Dim0)
95 + ">, "
96 "Index<"
97 + std::basic_string<char>{j} + ", " + std::to_string(Dim1) + ">, "
98 + std::to_string(N2) + ")\n");
99#endif
100 auto TensorExpr = [this, N2](const int &N0, const int &N1) {
101 return this->operator()(N0, N1, N2);
102 };
103 return Tensor2_Expr<decltype(TensorExpr), T, Dim0, Dim1, i, j>{
104 TensorExpr};
105 }

◆ operator()() [6/28]

template<class T = int>
template<char i, char j, char l, int Dim0, int Dim1, int Dim3>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const Index< i, Dim0 > &  ,
const Index< j, Dim1 > &  ,
const int &  N2,
const Index< l, Dim3 > &   
)
inlineconstexpr

Definition at line 277 of file Levi_Civita.hpp.

279 {
280 static_assert(
281 Dim0 <= 4 && Dim1 <= 4 && Dim3 <= 4,
282 "Index dimension exceeds the maximum for Rank 4 Levi-Civita Tensor");
283#ifdef FTENSOR_DEBUG
284 if(N2 >= 4 || N2 < 0)
285 throw std::out_of_range(
286 "Bad index in Levi_Civita<T>::operator()("
287 "Index<"
288 + std::basic_string<char>{i} + ", " + std::to_string(Dim0)
289 + ">, "
290 "Index<"
291 + std::basic_string<char>{j} + ", " + std::to_string(Dim1) + ">, "
292 + std::to_string(N2)
293 + ", "
294 "Index<"
295 + std::basic_string<char>{l} + ", " + std::to_string(Dim3) + ">)\n");
296#endif
297 auto TensorExpr
298 = [this, N2](const int &N0, const int &N1, const int &N3) {
299 return this->operator()(N0, N1, N2, N3);
300 };
301 return Tensor3_Expr<decltype(TensorExpr), T, Dim0, Dim1, Dim3, i, j, l>{
302 TensorExpr};
303 }

◆ operator()() [7/28]

template<class T = int>
template<char i, char j, int Dim0, int Dim1>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const Index< i, Dim0 > &  ,
const Index< j, Dim1 > &  ,
const int &  N2,
const int &  N3 
)
inlineconstexpr

Definition at line 364 of file Levi_Civita.hpp.

366 {
367 static_assert(
368 Dim0 <= 4 && Dim1 <= 4,
369 "Index dimension exceeds the maximum for Rank 4 Levi-Civita Tensor");
370#ifdef FTENSOR_DEBUG
371 if(N2 >= 4 || N2 < 0 || N3 >= 4 || N3 < 0)
372 throw std::out_of_range(
373 "Bad index in Levi_Civita<T>::operator()("
374 "Index<"
375 + std::basic_string<char>{i} + ", " + std::to_string(Dim0)
376 + ">, "
377 "Index<"
378 + std::basic_string<char>{j} + ", " + std::to_string(Dim1) + ">, "
379 + std::to_string(N2) + ", " + std::to_string(N3) + ")\n");
380#endif
381 auto TensorExpr = [this, N2, N3](const int &N0, const int &N1) {
382 return this->operator()(N0, N1, N2, N3);
383 };
384 return Tensor2_Expr<decltype(TensorExpr), T, Dim0, Dim1, i, j>{
385 TensorExpr};
386 }

◆ operator()() [8/28]

template<class T = int>
template<char i, int Dim0>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const Index< i, Dim0 > &  ,
const int &  N1 
)
inlineconstexpr

Definition at line 29 of file Levi_Civita.hpp.

30 {
31 static_assert(
32 Dim0 <= 2,
33 "Index dimension exceeds the maximum for Rank 2 Levi-Civita Tensor");
34#ifdef FTENSOR_DEBUG
35 if(N1 >= 2 || N1 < 0)
36 throw std::out_of_range(
37 "Bad index in Levi_Civita<T>::operator()(Index<"
38 + std::basic_string<char>{i} + ", " + std::to_string(Dim0) + ">, "
39 + std::to_string(N1) + ")\n");
40#endif
41 auto TensorExpr
42 = [this, N1](const int &N0) { return this->operator()(N0, N1); };
44 };

◆ operator()() [9/28]

template<class T = int>
template<char i, char k, int Dim0, int Dim2>
auto FTensor::Levi_Civita< T >::operator() ( const Index< i, Dim0 > &  ,
const int &  N1,
const Index< k, Dim2 > &   
)
inline

Definition at line 109 of file Levi_Civita.hpp.

110 {
111 static_assert(
112 Dim0 <= 3 && Dim2 <= 3,
113 "Index dimension exceeds the maximum for Rank 3 Levi-Civita Tensor");
114#ifdef FTENSOR_DEBUG
115 if(N1 >= 3 || N1 < 0)
116 throw std::out_of_range(
117 "Bad index in Levi_Civita<T>::operator()("
118 "Index<"
119 + std::basic_string<char>{i} + ", " + std::to_string(Dim0) + ">, "
120 + std::to_string(N1)
121 + ", "
122 "Index<"
123 + std::basic_string<char>{k} + ", " + std::to_string(Dim2) + ">)\n");
124#endif
125 auto TensorExpr = [this, N1](const int &N0, const int &N2) {
126 return this->operator()(N0, N1, N2);
127 };
128 return Tensor2_Expr<decltype(TensorExpr), T, Dim0, Dim2, i, k>{
129 TensorExpr};
130 }

◆ operator()() [10/28]

template<class T = int>
template<char i, char k, char l, int Dim0, int Dim2, int Dim3>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const Index< i, Dim0 > &  ,
const int &  N1,
const Index< k, Dim2 > &  ,
const Index< l, Dim3 > &   
)
inlineconstexpr

Definition at line 306 of file Levi_Civita.hpp.

308 {
309 static_assert(
310 Dim0 <= 4 && Dim2 <= 4 && Dim3 <= 4,
311 "Index dimension exceeds the maximum for Rank 4 Levi-Civita Tensor");
312#ifdef FTENSOR_DEBUG
313 if(N1 >= 4 || N1 < 0)
314 throw std::out_of_range(
315 "Bad index in Levi_Civita<T>::operator()("
316 "Index<"
317 + std::basic_string<char>{i} + ", " + std::to_string(Dim0) + ">, "
318 + std::to_string(N1)
319 + ", "
320 "Index<"
321 + std::basic_string<char>{k} + ", " + std::to_string(Dim2)
322 + ">, "
323 "Index<"
324 + std::basic_string<char>{l} + ", " + std::to_string(Dim3) + ">)\n");
325#endif
326 auto TensorExpr
327 = [this, N1](const int &N0, const int &N2, const int &N3) {
328 return this->operator()(N0, N1, N2, N3);
329 };
330 return Tensor3_Expr<decltype(TensorExpr), T, Dim0, Dim2, Dim3, i, k, l>{
331 TensorExpr};
332 }

◆ operator()() [11/28]

template<class T = int>
template<char i, char k, int Dim0, int Dim2>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const Index< i, Dim0 > &  ,
const int &  N1,
const Index< k, Dim2 > &  ,
const int &  N3 
)
inlineconstexpr

Definition at line 389 of file Levi_Civita.hpp.

391 {
392 static_assert(
393 Dim0 <= 4 && Dim2 <= 4,
394 "Index dimension exceeds the maximum for Rank 4 Levi-Civita Tensor");
395#ifdef FTENSOR_DEBUG
396 if(N1 >= 4 || N1 < 0 || N3 >= 4 || N3 < 0)
397 throw std::out_of_range(
398 "Bad index in Levi_Civita<T>::operator()("
399 "Index<"
400 + std::basic_string<char>{i} + ", " + std::to_string(Dim0) + ">, "
401 + std::to_string(N1)
402 + ", "
403 "Index<"
404 + std::basic_string<char>{k} + ", " + std::to_string(Dim2) + ">, "
405 + std::to_string(N3) + ")\n");
406#endif
407 auto TensorExpr = [this, N1, N3](const int &N0, const int &N2) {
408 return this->operator()(N0, N1, N2, N3);
409 };
410 return Tensor2_Expr<decltype(TensorExpr), T, Dim0, Dim2, i, k>{
411 TensorExpr};
412 }

◆ operator()() [12/28]

template<class T = int>
template<char i, int Dim0>
auto FTensor::Levi_Civita< T >::operator() ( const Index< i, Dim0 > &  ,
const int &  N1,
const int &  N2 
)
inline

Definition at line 158 of file Levi_Civita.hpp.

159 {
160 static_assert(
161 Dim0 <= 3,
162 "Index dimension exceeds the maximum for Rank 3 Levi-Civita Tensor");
163#ifdef FTENSOR_DEBUG
164 if(N1 >= 3 || N1 < 0 || N2 >= 3 || N2 < 0)
165 throw std::out_of_range(
166 "Bad index in Levi_Civita<T>::operator()("
167 "Index<"
168 + std::basic_string<char>{i} + ", " + std::to_string(Dim0) + ">, "
169 + std::to_string(N1) + ", " + std::to_string(N2) + ")\n");
170#endif
171 auto TensorExpr = [this, N1, N2](const int &N0) {
172 return this->operator()(N0, N1, N2);
173 };
174 return Tensor1_Expr<decltype(TensorExpr), T, Dim0, i>{TensorExpr};
175 }

◆ operator()() [13/28]

template<class T = int>
template<char i, char l, int Dim0, int Dim3>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const Index< i, Dim0 > &  ,
const int &  N1,
const int &  N2,
const Index< l, Dim3 > &   
)
inlineconstexpr

Definition at line 441 of file Levi_Civita.hpp.

443 {
444 static_assert(
445 Dim0 <= 4 && Dim3 <= 4,
446 "Index dimension exceeds the maximum for Rank 4 Levi-Civita Tensor");
447#ifdef FTENSOR_DEBUG
448 if(N1 >= 4 || N1 < 0 || N2 >= 4 || N2 < 0)
449 throw std::out_of_range(
450 "Bad index in Levi_Civita<T>::operator()("
451 "Index<"
452 + std::basic_string<char>{i} + ", " + std::to_string(Dim0) + ">, "
453 + std::to_string(N1) + ", " + std::to_string(N2)
454 + ", "
455 "Index<"
456 + std::basic_string<char>{l} + ", " + std::to_string(Dim3) + ">)\n");
457#endif
458 auto TensorExpr = [this, N1, N2](const int &N0, const int &N3) {
459 return this->operator()(N0, N1, N2, N3);
460 };
461 return Tensor2_Expr<decltype(TensorExpr), T, Dim0, Dim3, i, l>{
462 TensorExpr};
463 }

◆ operator()() [14/28]

template<class T = int>
template<char i, int Dim0>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const Index< i, Dim0 > &  ,
const int &  N1,
const int &  N2,
const int &  N3 
)
inlineconstexpr

Definition at line 518 of file Levi_Civita.hpp.

520 {
521 static_assert(
522 Dim0 <= 4,
523 "Index dimension exceeds the maximum for Rank 4 Levi-Civita Tensor");
524#ifdef FTENSOR_DEBUG
525 if(N1 >= 4 || N1 < 0 || N2 >= 4 || N2 < 0 || N3 >= 4 || N3 < 0)
526 throw std::out_of_range(
527 "Bad index in Levi_Civita<T>::operator()("
528 "Index<"
529 + std::basic_string<char>{i} + ", " + std::to_string(Dim0) + ">, "
530 + std::to_string(N1) + ", " + std::to_string(N2) + ", "
531 + std::to_string(N3) + ")\n");
532#endif
533 auto TensorExpr = [this, N1, N2, N3](const int &N0) {
534 return this->operator()(N0, N1, N2, N3);
535 };
536 return Tensor1_Expr<decltype(TensorExpr), T, Dim0, i>{TensorExpr};
537 }

◆ operator()() [15/28]

template<class T = int>
template<char j, int Dim1>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const int &  N0,
const Index< j, Dim1 > &   
)
inlineconstexpr

Definition at line 47 of file Levi_Civita.hpp.

48 {
49 static_assert(
50 Dim1 <= 2,
51 "Index dimension exceeds the maximum for Rank 2 Levi-Civita Tensor");
52#ifdef FTENSOR_DEBUG
53 if(N0 >= 2 || N0 < 0)
54 throw std::out_of_range("Bad index in Levi_Civita<T>::operator()("
55 + std::to_string(N0) + ", Index<"
56 + std::basic_string<char>{j} + ", "
57 + std::to_string(Dim1) + ">)\n");
58#endif
59 auto TensorExpr
60 = [this, N0](const int &N1) { return this->operator()(N0, N1); };
61 return Tensor1_Expr<decltype(TensorExpr), T, Dim1, j>{TensorExpr};
62 };

◆ operator()() [16/28]

template<class T = int>
template<char j, char k, int Dim1, int Dim2>
auto FTensor::Levi_Civita< T >::operator() ( const int &  N0,
const Index< j, Dim1 > &  ,
const Index< k, Dim2 > &   
)
inline

Definition at line 134 of file Levi_Civita.hpp.

135 {
136 static_assert(
137 Dim1 <= 3 && Dim2 <= 3,
138 "Index dimension exceeds the maximum for Rank 3 Levi-Civita Tensor");
139#ifdef FTENSOR_DEBUG
140 if(N0 >= 3 || N0 < 0)
141 throw std::out_of_range(
142 "Bad index in Levi_Civita<T>::operator()(" + std::to_string(N0)
143 + ", "
144 "Index<"
145 + std::basic_string<char>{j} + ", " + std::to_string(Dim1)
146 + ">, "
147 "Index<"
148 + std::basic_string<char>{k} + ", " + std::to_string(Dim2) + ">)\n");
149#endif
150 auto TensorExpr = [this, N0](const int &N1, const int &N2) {
151 return this->operator()(N0, N1, N2);
152 };
153 return Tensor2_Expr<decltype(TensorExpr), T, Dim1, Dim2, j, k>{
154 TensorExpr};
155 }

◆ operator()() [17/28]

template<class T = int>
template<char j, char k, char l, int Dim1, int Dim2, int Dim3>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const int &  N0,
const Index< j, Dim1 > &  ,
const Index< k, Dim2 > &  ,
const Index< l, Dim3 > &   
)
inlineconstexpr

Definition at line 335 of file Levi_Civita.hpp.

337 {
338 static_assert(
339 Dim1 <= 4 && Dim2 <= 4 && Dim3 <= 4,
340 "Index dimension exceeds the maximum for Rank 4 Levi-Civita Tensor");
341#ifdef FTENSOR_DEBUG
342 if(N0 >= 4 || N0 < 0)
343 throw std::out_of_range(
344 "Bad index in Levi_Civita<T>::operator()(" + std::to_string(N0)
345 + ", "
346 "Index<"
347 + std::basic_string<char>{j} + ", " + std::to_string(Dim1)
348 + ">, "
349 "Index<"
350 + std::basic_string<char>{k} + ", " + std::to_string(Dim2)
351 + ">, "
352 "Index<"
353 + std::basic_string<char>{l} + ", " + std::to_string(Dim3) + ">)\n");
354#endif
355 auto TensorExpr
356 = [this, N0](const int &N1, const int &N2, const int &N3) {
357 return this->operator()(N0, N1, N2, N3);
358 };
359 return Tensor3_Expr<decltype(TensorExpr), T, Dim1, Dim2, Dim3, j, k, l>{
360 TensorExpr};
361 }

◆ operator()() [18/28]

template<class T = int>
template<char j, char k, int Dim1, int Dim2>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const int &  N0,
const Index< j, Dim1 > &  ,
const Index< k, Dim2 > &  ,
const int &  N3 
)
inlineconstexpr

Definition at line 415 of file Levi_Civita.hpp.

417 {
418 static_assert(
419 Dim1 <= 4 && Dim2 <= 4,
420 "Index dimension exceeds the maximum for Rank 4 Levi-Civita Tensor");
421#ifdef FTENSOR_DEBUG
422 if(N0 >= 4 || N0 < 0 || N3 >= 4 || N3 < 0)
423 throw std::out_of_range(
424 "Bad index in Levi_Civita<T>::operator()(" + std::to_string(N0)
425 + ", "
426 "Index<"
427 + std::basic_string<char>{j} + ", " + std::to_string(Dim1)
428 + ">, "
429 "Index<"
430 + std::basic_string<char>{k} + ", " + std::to_string(Dim2) + ">, "
431 + std::to_string(N3) + ")\n");
432#endif
433 auto TensorExpr = [this, N0, N3](const int &N1, const int &N2) {
434 return this->operator()(N0, N1, N2, N3);
435 };
436 return Tensor2_Expr<decltype(TensorExpr), T, Dim1, Dim2, j, k>{
437 TensorExpr};
438 }

◆ operator()() [19/28]

template<class T = int>
template<char j, int Dim1>
auto FTensor::Levi_Civita< T >::operator() ( const int &  N0,
const Index< j, Dim1 > &  ,
const int &  N2 
)
inline

Definition at line 178 of file Levi_Civita.hpp.

179 {
180 static_assert(
181 Dim1 <= 3,
182 "Index dimension exceeds the maximum for Rank 3 Levi-Civita Tensor");
183#ifdef FTENSOR_DEBUG
184 if(N0 >= 3 || N0 < 0 || N2 >= 3 || N2 < 0)
185 throw std::out_of_range(
186 "Bad index in Levi_Civita<T>::operator()(" + std::to_string(N0)
187 + ", "
188 "Index<"
189 + std::basic_string<char>{j} + ", " + std::to_string(Dim1) + ">, "
190 + std::to_string(N2) + ")\n");
191#endif
192 auto TensorExpr = [this, N0, N2](const int &N1) {
193 return this->operator()(N0, N1, N2);
194 };
195 return Tensor1_Expr<decltype(TensorExpr), T, Dim1, j>{TensorExpr};
196 }

◆ operator()() [20/28]

template<class T = int>
template<char j, char l, int Dim1, int Dim3>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const int &  N0,
const Index< j, Dim1 > &  ,
const int &  N2,
const Index< l, Dim3 > &   
)
inlineconstexpr

Definition at line 466 of file Levi_Civita.hpp.

468 {
469 static_assert(
470 Dim1 <= 4 && Dim3 <= 4,
471 "Index dimension exceeds the maximum for Rank 4 Levi-Civita Tensor");
472#ifdef FTENSOR_DEBUG
473 if(N0 >= 4 || N0 < 0 || N2 >= 4 || N2 < 0)
474 throw std::out_of_range(
475 "Bad index in Levi_Civita<T>::operator()(" + std::to_string(N0)
476 + ", "
477 "Index<"
478 + std::basic_string<char>{j} + ", " + std::to_string(Dim1) + ">, "
479 + std::to_string(N2)
480 + ", "
481 "Index<"
482 + std::basic_string<char>{l} + ", " + std::to_string(Dim3) + ">)\n");
483#endif
484 auto TensorExpr = [this, N0, N2](const int &N1, const int &N3) {
485 return this->operator()(N0, N1, N2, N3);
486 };
487 return Tensor2_Expr<decltype(TensorExpr), T, Dim1, Dim3, j, l>{
488 TensorExpr};
489 }

◆ operator()() [21/28]

template<class T = int>
template<char j, int Dim1>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const int &  N0,
const Index< j, Dim1 > &  ,
const int &  N2,
const int &  N3 
)
inlineconstexpr

Definition at line 540 of file Levi_Civita.hpp.

542 {
543 static_assert(
544 Dim1 <= 4,
545 "Index dimension exceeds the maximum for Rank 4 Levi-Civita Tensor");
546#ifdef FTENSOR_DEBUG
547 if(N0 >= 4 || N0 < 0 || N2 >= 4 || N2 < 0 || N3 >= 4 || N3 < 0)
548 throw std::out_of_range(
549 "Bad index in Levi_Civita<T>::operator()(" + std::to_string(N0)
550 + ", "
551 "Index<"
552 + std::basic_string<char>{j} + ", " + std::to_string(Dim1) + ">, "
553 + std::to_string(N2) + ", " + std::to_string(N3) + ")\n");
554#endif
555 auto TensorExpr = [this, N0, N2, N3](const int &N1) {
556 return this->operator()(N0, N1, N2, N3);
557 };
558 return Tensor1_Expr<decltype(TensorExpr), T, Dim1, j>{TensorExpr};
559 }

◆ operator()() [22/28]

template<class T = int>
template<char k, int Dim2>
auto FTensor::Levi_Civita< T >::operator() ( const int &  N0,
const int &  N1,
const Index< k, Dim2 > &   
)
inline

Definition at line 199 of file Levi_Civita.hpp.

200 {
201 static_assert(
202 Dim2 <= 3,
203 "Index dimension exceeds the maximum for Rank 3 Levi-Civita Tensor");
204#ifdef FTENSOR_DEBUG
205 if(N0 >= 3 || N0 < 0 || N1 >= 3 || N1 < 0)
206 throw std::out_of_range(
207 "Bad index in Levi_Civita<T>::operator()(" + std::to_string(N0)
208 + ", " + std::to_string(N1)
209 + ", "
210 "Index<"
211 + std::basic_string<char>{k} + ", " + std::to_string(Dim2) + ">)\n");
212#endif
213 auto TensorExpr = [this, N0, N1](const int &N2) {
214 return this->operator()(N0, N1, N2);
215 };
216 return Tensor1_Expr<decltype(TensorExpr), T, Dim2, k>{TensorExpr};
217 }

◆ operator()() [23/28]

template<class T = int>
template<char k, char l, int Dim2, int Dim3>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const int &  N0,
const int &  N1,
const Index< k, Dim2 > &  ,
const Index< l, Dim3 > &   
)
inlineconstexpr

Definition at line 492 of file Levi_Civita.hpp.

494 {
495 static_assert(
496 Dim2 <= 4 && Dim3 <= 4,
497 "Index dimension exceeds the maximum for Rank 4 Levi-Civita Tensor");
498#ifdef FTENSOR_DEBUG
499 if(N0 >= 4 || N0 < 0 || N1 >= 4 || N1 < 0)
500 throw std::out_of_range(
501 "Bad index in Levi_Civita<T>::operator()(" + std::to_string(N0)
502 + ", " + std::to_string(N1)
503 + ", "
504 "Index<"
505 + std::basic_string<char>{k} + ", " + std::to_string(Dim2)
506 + ">, "
507 "Index<"
508 + std::basic_string<char>{l} + ", " + std::to_string(Dim3) + ">)\n");
509#endif
510 auto TensorExpr = [this, N0, N1](const int &N2, const int &N3) {
511 return this->operator()(N0, N1, N2, N3);
512 };
513 return Tensor2_Expr<decltype(TensorExpr), T, Dim2, Dim3, k, l>{
514 TensorExpr};
515 }

◆ operator()() [24/28]

template<class T = int>
template<char k, int Dim2>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const int &  N0,
const int &  N1,
const Index< k, Dim2 > &  ,
const int &  N3 
)
inlineconstexpr

Definition at line 562 of file Levi_Civita.hpp.

564 {
565 static_assert(
566 Dim2 <= 4,
567 "Index dimension exceeds the maximum for Rank 4 Levi-Civita Tensor");
568#ifdef FTENSOR_DEBUG
569 if(N0 >= 4 || N0 < 0 || N1 >= 4 || N1 < 0 || N3 >= 4 || N3 < 0)
570 throw std::out_of_range(
571 "Bad index in Levi_Civita<T>::operator()(" + std::to_string(N0)
572 + ", " + std::to_string(N1)
573 + ", "
574 "Index<"
575 + std::basic_string<char>{k} + ", " + std::to_string(Dim2) + ">, "
576 + std::to_string(N3) + ")\n");
577#endif
578 auto TensorExpr = [this, N0, N1, N3](const int &N2) {
579 return this->operator()(N0, N1, N2, N3);
580 };
581 return Tensor1_Expr<decltype(TensorExpr), T, Dim2, k>{TensorExpr};
582 }

◆ operator()() [25/28]

template<class T = int>
template<char l, int Dim3>
constexpr auto FTensor::Levi_Civita< T >::operator() ( const int &  N0,
const int &  N1,
const int &  N2,
const Index< l, Dim3 > &   
)
inlineconstexpr

Definition at line 585 of file Levi_Civita.hpp.

587 {
588 static_assert(
589 Dim3 <= 4,
590 "Index dimension exceeds the maximum for Rank 4 Levi-Civita Tensor");
591#ifdef FTENSOR_DEBUG
592 if(N0 >= 4 || N0 < 0 || N1 >= 4 || N1 < 0 || N2 >= 4 || N2 < 0)
593 throw std::out_of_range(
594 "Bad index in Levi_Civita<T>::operator()(" + std::to_string(N0)
595 + ", " + std::to_string(N1) + ", " + std::to_string(N2)
596 + ", "
597 "Index<"
598 + std::basic_string<char>{l} + ", " + std::to_string(Dim3) + ">)\n");
599#endif
600 auto TensorExpr = [this, N0, N1, N2](const int &N3) {
601 return this->operator()(N0, N1, N2, N3);
602 };
603 return Tensor1_Expr<decltype(TensorExpr), T, Dim3, l>{TensorExpr};
604 }

◆ operator()() [26/28]

template<class T = int>
constexpr T FTensor::Levi_Civita< T >::operator() ( const int  N1,
const int  N2 
) const
inlineconstexpr

Rank 2.

Definition at line 14 of file Levi_Civita.hpp.

15 {
16 return (N1 == N2) ? T(0) : ((N1 == 0) ? T(1) : T(-1));
17 }

◆ operator()() [27/28]

template<class T = int>
constexpr T FTensor::Levi_Civita< T >::operator() ( const int  N1,
const int  N2,
const int  N3 
) const
inlineconstexpr

Rank 3.

Definition at line 65 of file Levi_Civita.hpp.

66 {
67 return (N1 == N2 || N1 == N3 || N2 == N3)
68 ? T(0)
69 : (((N1 + 1) % 3 == N2) ? T(1) : T(-1));
70 }

◆ operator()() [28/28]

template<class T = int>
constexpr T FTensor::Levi_Civita< T >::operator() ( const int  N1,
const int  N2,
const int  N3,
const int  N4 
) const
inlineconstexpr

Rank 4.

Definition at line 221 of file Levi_Civita.hpp.

222 {
223 return (N1 == N2 || N1 == N3 || N1 == N4 || N2 == N3 || N2 == N4
224 || N3 == N4)
225 ? T(0)
226 : ((N1 + N2 == 1 || N1 + N2 == 5)
227 ? (((N2 + N3) % 4 == 3) ? T(1) : T(-1))
228 : ((N1 + N2 == 2 || N1 + N2 == 4)
229 ? (((N2 + N3) % 4 == 1) ? T(1) : T(-1))
230 : (N1 + N2 == 3
231 ? (((N2 + N3) % 4 != 1) ? T(1) : T(-1))
232 : T(0))));
233 }

The documentation for this class was generated from the following file: