v0.14.0
Functions
test_T2.cpp File Reference
#include "../../../src/FTensor.hpp"
#include "../test_for_zero.hpp"
#include <iostream>

Go to the source code of this file.

Functions

void test_T2_iostream ()
 
void test_T2_01 (const Tensor1< double, 3 > &t1_1, const Tensor1< double, 3 > &t1_2)
 
void test_T2_02 (const Tensor1< double, 3 > &t1_1)
 
void test_T2_03 ()
 
void test_T2_04 (const Tensor2< double, 3, 3 > &t2_1)
 
void test_T2_05 (const Tensor2< double, 3, 3 > &t2_1)
 
void test_T2_06 (const Tensor2< double, 3, 3 > &t2_1)
 
void test_T2_07 (const Tensor2< double, 3, 3 > &t2_1)
 
void test_T2_08 (const Tensor1< double, 3 > &t1_2)
 
void test_T2_09 ()
 
void test_T2_10 (const Tensor2< double, 3, 3 > &t2_1)
 
void test_T2_11 (const Tensor2< double, 3, 3 > &t2_1)
 
void test_T2_12 (const Tensor2< double, 3, 3 > &t2_1)
 
void test_T2_13 (const Tensor2< double, 3, 3 > &t2_1)
 
void test_T2_14 (const Tensor1< double, 3 > &t1_1, const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_15 (const Tensor1< double, 3 > &t1_1, const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_16 (const Tensor1< double, 3 > &t1_1, const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_17 (const Tensor2< double, 3, 3 > &t2_1, const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_18 (const Tensor2< double, 3, 3 > &t2_1, const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_19 (const Tensor1< double, 3 > &t1_1, const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_20 (const Tensor2< double, 3, 3 > &t2_1, const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_21 (const Tensor2< double, 3, 3 > &t2_1, const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_22 (const Tensor2< double, 3, 3 > &t2_1)
 
void test_T2_23 (const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_24 (const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_25 (const Tensor2< double, 4, 3 > &t2_4, const Tensor2< double, 3, 4 > &t2_5)
 
void test_T2_26 (const Tensor2< double, 4, 3 > &t2_4, const Tensor2< double, 3, 4 > &t2_5)
 
void test_T2_27 (const Tensor2< double, 4, 3 > &t2_4, const Tensor2< double, 3, 4 > &t2_5)
 
void test_T2_28 (const Tensor2< double, 4, 3 > &t2_4, const Tensor2< double, 3, 4 > &t2_5)
 
void test_T2_29 (const Tensor2< double, 4, 3 > &t2_4, const Tensor2< double, 3, 4 > &t2_5)
 
void test_T2_30 (const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_31 (const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_32 (const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_33 (const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_34 (const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_35 (const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_36 (const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_37 (const Tensor2< double, 3, 3 > &t2_2)
 
void test_T2_38 ()
 
void test_T2 (const Tensor1< double, 3 > &t1_1, const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_1, const Tensor2< double, 3, 3 > &t2_2, const Tensor2< double, 4, 3 > &t2_4, const Tensor2< double, 3, 4 > &t2_5)
 

Function Documentation

◆ test_T2()

void test_T2 ( const Tensor1< double, 3 > &  t1_1,
const Tensor1< double, 3 > &  t1_2,
const Tensor2< double, 3, 3 > &  t2_1,
const Tensor2< double, 3, 3 > &  t2_2,
const Tensor2< double, 4, 3 > &  t2_4,
const Tensor2< double, 3, 4 > &  t2_5 
)

Definition at line 65 of file test_T2.cpp.

70 {
72  test_T2_01(t1_1, t1_2);
73  test_T2_02(t1_1);
74  test_T2_03();
75  test_T2_04(t2_1);
76  test_T2_05(t2_1);
77  test_T2_06(t2_1);
78  test_T2_07(t2_1);
79  test_T2_08(t1_2);
80  test_T2_09();
81  test_T2_10(t2_1);
82  test_T2_11(t2_1);
83  test_T2_12(t2_1);
84  test_T2_13(t2_1);
85  test_T2_14(t1_1, t1_2, t2_2);
86  test_T2_15(t1_1, t1_2, t2_2);
87  test_T2_16(t1_1, t1_2, t2_2);
88  test_T2_17(t2_1, t2_2);
89  test_T2_18(t2_1, t2_2);
90  test_T2_19(t1_1, t1_2, t2_2);
91  test_T2_20(t2_1, t2_2);
92  test_T2_21(t2_1, t2_2);
93  test_T2_22(t2_1);
94  test_T2_23(t1_2, t2_2);
95  test_T2_24(t1_2, t2_2);
96  test_T2_25(t2_4, t2_5);
97  test_T2_26(t2_4, t2_5);
98  test_T2_27(t2_4, t2_5);
99  test_T2_28(t2_4, t2_5);
100  test_T2_29(t2_4, t2_5);
101  test_T2_30(t1_2, t2_2);
102  test_T2_31(t1_2, t2_2);
103  test_T2_32(t2_2);
104  test_T2_33(t2_2);
105  test_T2_34(t2_2);
106  test_T2_35(t2_2);
107  test_T2_36(t2_2);
108  test_T2_37(t2_2);
109  test_T2_38();
110 }

◆ test_T2_01()

void test_T2_01 ( const Tensor1< double, 3 > &  t1_1,
const Tensor1< double, 3 > &  t1_2 
)

Definition at line 7 of file test_T2_01.cpp.

8 {
11 
12  Number<0> N0;
13  Number<1> N1;
14  Number<2> N2;
15 
16  /* Tensor2 tests */
18 
19  t2_1(i, j) = t1_1(i) * t1_2(j);
20  test_for_zero(t2_1(0, 0) - t1_1(0) * t1_2(0), "T2(i,j)=T1(i)*T1(j)(0,0)");
21  test_for_zero(t2_1(0, 1) - t1_1(0) * t1_2(1), "T2(i,j)=T1(i)*T1(j)(0,1)");
22  test_for_zero(t2_1(0, 2) - t1_1(0) * t1_2(2), "T2(i,j)=T1(i)*T1(j)(0,2)");
23  test_for_zero(t2_1(1, 0) - t1_1(1) * t1_2(0), "T2(i,j)=T1(i)*T1(j)(1,0)");
24  test_for_zero(t2_1(1, 1) - t1_1(1) * t1_2(1), "T2(i,j)=T1(i)*T1(j)(1,1)");
25  test_for_zero(t2_1(1, 2) - t1_1(1) * t1_2(2), "T2(i,j)=T1(i)*T1(j)(1,2)");
26  test_for_zero(t2_1(2, 0) - t1_1(2) * t1_2(0), "T2(i,j)=T1(i)*T1(j)(2,0)");
27  test_for_zero(t2_1(2, 1) - t1_1(2) * t1_2(1), "T2(i,j)=T1(i)*T1(j)(2,1)");
28  test_for_zero(t2_1(2, 2) - t1_1(2) * t1_2(2), "T2(i,j)=T1(i)*T1(j)(2,2)");
29 }

◆ test_T2_02()

void test_T2_02 ( const Tensor1< double, 3 > &  t1_1)

Definition at line 7 of file test_T2_02.cpp.

8 {
10 
11  Number<0> N0;
12  Number<1> N1;
13  Number<2> N2;
14 
15  /* Tensor2 tests */
17 
18  t2_1(N0, i) = t1_1(i);
19  t2_1(N1, i) = t1_1(i);
20  t2_1(N2, i) = t1_1(i);
21  test_for_zero(t2_1(0, 0) - t1_1(0), "T2(N,i)=T1(i)(0,0)");
22  test_for_zero(t2_1(0, 1) - t1_1(1), "T2(N,i)=T1(i)(0,1)");
23  test_for_zero(t2_1(0, 2) - t1_1(2), "T2(N,i)=T1(i)(0,2)");
24  test_for_zero(t2_1(1, 0) - t1_1(0), "T2(N,i)=T1(i)(1,0)");
25  test_for_zero(t2_1(1, 1) - t1_1(1), "T2(N,i)=T1(i)(1,1)");
26  test_for_zero(t2_1(1, 2) - t1_1(2), "T2(N,i)=T1(i)(1,2)");
27  test_for_zero(t2_1(2, 0) - t1_1(0), "T2(N,i)=T1(i)(2,0)");
28  test_for_zero(t2_1(2, 1) - t1_1(1), "T2(N,i)=T1(i)(2,1)");
29  test_for_zero(t2_1(2, 2) - t1_1(2), "T2(N,i)=T1(i)(2,2)");
30 }

◆ test_T2_03()

void test_T2_03 ( )

Definition at line 7 of file test_T2_03.cpp.

8 {
10 
11  Number<0> N0;
12  Number<1> N1;
13  Number<2> N2;
14 
15  /* Tensor2 tests */
17 
18  t2_1(N0, i) = 10;
19  t2_1(N1, i) = 11;
20  t2_1(N2, i) = 12;
21  test_for_zero(t2_1(0, 0) - 10, "T2(N,i)=T(0,0)");
22  test_for_zero(t2_1(0, 1) - 10, "T2(N,i)=T(0,1)");
23  test_for_zero(t2_1(0, 2) - 10, "T2(N,i)=T(0,2)");
24  test_for_zero(t2_1(1, 0) - 11, "T2(N,i)=T(1,0)");
25  test_for_zero(t2_1(1, 1) - 11, "T2(N,i)=T(1,1)");
26  test_for_zero(t2_1(1, 2) - 11, "T2(N,i)=T(1,2)");
27  test_for_zero(t2_1(2, 0) - 12, "T2(N,i)=T(2,0)");
28  test_for_zero(t2_1(2, 1) - 12, "T2(N,i)=T(2,1)");
29  test_for_zero(t2_1(2, 2) - 12, "T2(N,i)=T(2,2)");
30 }

◆ test_T2_04()

void test_T2_04 ( const Tensor2< double, 3, 3 > &  t2_1)

Definition at line 7 of file test_T2_04.cpp.

8 {
11 
12  Number<0> N0;
13  Number<1> N1;
14  Number<2> N2;
15 
16  /* Tensor2 tests */
18  t2(i, j) = t2_1(i, j);
19 
20  t2(N0, i) += 10;
21  t2(N1, i) += 29;
22  t2(N2, i) += 48;
23  test_for_zero(t2(0, 0) - (t2_1(0, 0) + 10), "T2(N,i)+=T(0,0)");
24  test_for_zero(t2(0, 1) - (t2_1(0, 1) + 10), "T2(N,i)+=T(0,1)");
25  test_for_zero(t2(0, 2) - (t2_1(0, 2) + 10), "T2(N,i)+=T(0,2)");
26  test_for_zero(t2(1, 0) - (t2_1(1, 0) + 29), "T2(N,i)+=T(1,0)");
27  test_for_zero(t2(1, 1) - (t2_1(1, 1) + 29), "T2(N,i)+=T(1,1)");
28  test_for_zero(t2(1, 2) - (t2_1(1, 2) + 29), "T2(N,i)+=T(1,2)");
29  test_for_zero(t2(2, 0) - (t2_1(2, 0) + 48), "T2(N,i)+=T(2,0)");
30  test_for_zero(t2(2, 1) - (t2_1(2, 1) + 48), "T2(N,i)+=T(2,1)");
31  test_for_zero(t2(2, 2) - (t2_1(2, 2) + 48), "T2(N,i)+=T(2,2)");
32 }

◆ test_T2_05()

void test_T2_05 ( const Tensor2< double, 3, 3 > &  t2_1)

Definition at line 7 of file test_T2_05.cpp.

8 {
11 
12  Number<0> N0;
13  Number<1> N1;
14  Number<2> N2;
15 
16  /* Tensor2 tests */
18  t2(i, j) = t2_1(i, j);
19 
20  t2(N0, i) -= 10;
21  t2(N1, i) -= 29;
22  t2(N2, i) -= 48;
23  test_for_zero(t2(0, 0) - (t2_1(0, 0) - 10), "T2(N,i)-=T(0,0)");
24  test_for_zero(t2(0, 1) - (t2_1(0, 1) - 10), "T2(N,i)-=T(0,1)");
25  test_for_zero(t2(0, 2) - (t2_1(0, 2) - 10), "T2(N,i)-=T(0,2)");
26  test_for_zero(t2(1, 0) - (t2_1(1, 0) - 29), "T2(N,i)-=T(1,0)");
27  test_for_zero(t2(1, 1) - (t2_1(1, 1) - 29), "T2(N,i)-=T(1,1)");
28  test_for_zero(t2(1, 2) - (t2_1(1, 2) - 29), "T2(N,i)-=T(1,2)");
29  test_for_zero(t2(2, 0) - (t2_1(2, 0) - 48), "T2(N,i)-=T(2,0)");
30  test_for_zero(t2(2, 1) - (t2_1(2, 1) - 48), "T2(N,i)-=T(2,1)");
31  test_for_zero(t2(2, 2) - (t2_1(2, 2) - 48), "T2(N,i)-=T(2,2)");
32 }

◆ test_T2_06()

void test_T2_06 ( const Tensor2< double, 3, 3 > &  t2_1)

Definition at line 7 of file test_T2_06.cpp.

8 {
11 
12  Number<0> N0;
13  Number<1> N1;
14  Number<2> N2;
15 
16  /* Tensor2 tests */
18  t2(i, j) = t2_1(i, j);
19 
20  t2(N0, i) *= 4;
21  t2(N1, i) *= 6;
22  t2(N2, i) *= 8;
23  test_for_zero(t2(0, 0) - (t2_1(0, 0) * 4), "T2(N,i)*=T(0,0)");
24  test_for_zero(t2(0, 1) - (t2_1(0, 1) * 4), "T2(N,i)*=T(0,1)");
25  test_for_zero(t2(0, 2) - (t2_1(0, 2) * 4), "T2(N,i)*=T(0,2)");
26  test_for_zero(t2(1, 0) - (t2_1(1, 0) * 6), "T2(N,i)*=T(1,0)");
27  test_for_zero(t2(1, 1) - (t2_1(1, 1) * 6), "T2(N,i)*=T(1,1)");
28  test_for_zero(t2(1, 2) - (t2_1(1, 2) * 6), "T2(N,i)*=T(1,2)");
29  test_for_zero(t2(2, 0) - (t2_1(2, 0) * 8), "T2(N,i)*=T(2,0)");
30  test_for_zero(t2(2, 1) - (t2_1(2, 1) * 8), "T2(N,i)*=T(2,1)");
31  test_for_zero(t2(2, 2) - (t2_1(2, 2) * 8), "T2(N,i)*=T(2,2)");
32 }

◆ test_T2_07()

void test_T2_07 ( const Tensor2< double, 3, 3 > &  t2_1)

Definition at line 7 of file test_T2_07.cpp.

8 {
11 
12  Number<0> N0;
13  Number<1> N1;
14  Number<2> N2;
15 
16  /* Tensor2 tests */
18  t2(i, j) = t2_1(i, j);
19 
20  t2(N0, i) /= 2;
21  t2(N1, i) /= 3;
22  t2(N2, i) /= 4;
23 
24  test_for_zero(t2(0, 0) - (t2_1(0, 0) / 2), "T2(N,i)/=T(0,0)");
25  test_for_zero(t2(0, 1) - (t2_1(0, 1) / 2), "T2(N,i)/=T(0,1)");
26  test_for_zero(t2(0, 2) - (t2_1(0, 2) / 2), "T2(N,i)/=T(0,2)");
27  test_for_zero(t2(1, 0) - (t2_1(1, 0) / 3), "T2(N,i)/=T(1,0)");
28  test_for_zero(t2(1, 1) - (t2_1(1, 1) / 3), "T2(N,i)/=T(1,1)");
29  test_for_zero(t2(1, 2) - (t2_1(1, 2) / 3), "T2(N,i)/=T(1,2)");
30  test_for_zero(t2(2, 0) - (t2_1(2, 0) / 4), "T2(N,i)/=T(2,0)");
31  test_for_zero(t2(2, 1) - (t2_1(2, 1) / 4), "T2(N,i)/=T(2,1)");
32  test_for_zero(t2(2, 2) - (t2_1(2, 2) / 4), "T2(N,i)/=T(2,2)");
33 }

◆ test_T2_08()

void test_T2_08 ( const Tensor1< double, 3 > &  t1_2)

Definition at line 7 of file test_T2_08.cpp.

8 {
10 
11  Number<0> N0;
12  Number<1> N1;
13  Number<2> N2;
14 
15  /* Tensor2 tests */
17 
18  t2(i, N0) = t1_2(i);
19  t2(i, N1) = t1_2(i);
20  t2(i, N2) = t1_2(i);
21  test_for_zero(t2(0, 0) - t1_2(0), "T2(i,N)=T1(i)(0,0)");
22  test_for_zero(t2(0, 1) - t1_2(0), "T2(i,N)=T1(i)(0,1)");
23  test_for_zero(t2(0, 2) - t1_2(0), "T2(i,N)=T1(i)(0,2)");
24  test_for_zero(t2(1, 0) - t1_2(1), "T2(i,N)=T1(i)(1,0)");
25  test_for_zero(t2(1, 1) - t1_2(1), "T2(i,N)=T1(i)(1,1)");
26  test_for_zero(t2(1, 2) - t1_2(1), "T2(i,N)=T1(i)(1,2)");
27  test_for_zero(t2(2, 0) - t1_2(2), "T2(i,N)=T1(i)(2,0)");
28  test_for_zero(t2(2, 1) - t1_2(2), "T2(i,N)=T1(i)(2,1)");
29  test_for_zero(t2(2, 2) - t1_2(2), "T2(i,N)=T1(i)(2,2)");
30 }

◆ test_T2_09()

void test_T2_09 ( )

Definition at line 7 of file test_T2_09.cpp.

8 {
10 
11  Number<0> N0;
12  Number<1> N1;
13  Number<2> N2;
14 
15  /* Tensor2 tests */
17 
18  t2(i, N0) = 10;
19  t2(i, N1) = 11;
20  t2(i, N2) = 12;
21  test_for_zero(t2(0, 0) - 10, "T2(i,N)=T(0,0)");
22  test_for_zero(t2(1, 0) - 10, "T2(i,N)=T(1,0)");
23  test_for_zero(t2(2, 0) - 10, "T2(i,N)=T(2,0)");
24  test_for_zero(t2(0, 1) - 11, "T2(i,N)=T(0,1)");
25  test_for_zero(t2(1, 1) - 11, "T2(i,N)=T(1,1)");
26  test_for_zero(t2(2, 1) - 11, "T2(i,N)=T(2,1)");
27  test_for_zero(t2(0, 2) - 12, "T2(i,N)=T(0,2)");
28  test_for_zero(t2(1, 2) - 12, "T2(i,N)=T(1,2)");
29  test_for_zero(t2(2, 2) - 12, "T2(i,N)=T(2,2)");
30 }

◆ test_T2_10()

void test_T2_10 ( const Tensor2< double, 3, 3 > &  t2_1)

Definition at line 7 of file test_T2_10.cpp.

8 {
11 
12  Number<0> N0;
13  Number<1> N1;
14  Number<2> N2;
15 
16  /* Tensor2 tests */
18  t2(i, j) = t2_1(i, j);
19 
20  t2(i, N0) += 10;
21  t2(i, N1) += 29;
22  t2(i, N2) += 48;
23  test_for_zero(t2(0, 0) - (t2_1(0, 0) + 10), "T2(i,N)+=T(0,0)");
24  test_for_zero(t2(1, 0) - (t2_1(1, 0) + 10), "T2(i,N)+=T(1,0)");
25  test_for_zero(t2(2, 0) - (t2_1(2, 0) + 10), "T2(i,N)+=T(2,0)");
26  test_for_zero(t2(0, 1) - (t2_1(0, 1) + 29), "T2(i,N)+=T(0,1)");
27  test_for_zero(t2(1, 1) - (t2_1(1, 1) + 29), "T2(i,N)+=T(1,1)");
28  test_for_zero(t2(2, 1) - (t2_1(2, 1) + 29), "T2(i,N)+=T(2,1)");
29  test_for_zero(t2(0, 2) - (t2_1(0, 2) + 48), "T2(i,N)+=T(0,2)");
30  test_for_zero(t2(1, 2) - (t2_1(1, 2) + 48), "T2(i,N)+=T(1,2)");
31  test_for_zero(t2(2, 2) - (t2_1(2, 2) + 48), "T2(i,N)+=T(2,2)");
32 }

◆ test_T2_11()

void test_T2_11 ( const Tensor2< double, 3, 3 > &  t2_1)

Definition at line 7 of file test_T2_11.cpp.

8 {
11 
12  Number<0> N0;
13  Number<1> N1;
14  Number<2> N2;
15 
16  /* Tensor2 tests */
18  t2(i, j) = t2_1(i, j);
19 
20  t2(i, N0) -= 10;
21  t2(i, N1) -= 29;
22  t2(i, N2) -= 48;
23  test_for_zero(t2(0, 0) - (t2_1(0, 0) - 10), "T2(i,N)-=T(0,0)");
24  test_for_zero(t2(1, 0) - (t2_1(1, 0) - 10), "T2(i,N)-=T(1,0)");
25  test_for_zero(t2(2, 0) - (t2_1(2, 0) - 10), "T2(i,N)-=T(2,0)");
26  test_for_zero(t2(0, 1) - (t2_1(0, 1) - 29), "T2(i,N)-=T(0,1)");
27  test_for_zero(t2(1, 1) - (t2_1(1, 1) - 29), "T2(i,N)-=T(1,1)");
28  test_for_zero(t2(2, 1) - (t2_1(2, 1) - 29), "T2(i,N)-=T(2,1)");
29  test_for_zero(t2(0, 2) - (t2_1(0, 2) - 48), "T2(i,N)-=T(0,2)");
30  test_for_zero(t2(1, 2) - (t2_1(1, 2) - 48), "T2(i,N)-=T(1,2)");
31  test_for_zero(t2(2, 2) - (t2_1(2, 2) - 48), "T2(i,N)-=T(2,2)");
32 }

◆ test_T2_12()

void test_T2_12 ( const Tensor2< double, 3, 3 > &  t2_1)

Definition at line 7 of file test_T2_12.cpp.

8 {
11 
12  Number<0> N0;
13  Number<1> N1;
14  Number<2> N2;
15 
16  /* Tensor2 tests */
18  t2(i, j) = t2_1(i, j);
19 
20  t2(i, N0) *= 4;
21  t2(i, N1) *= 6;
22  t2(i, N2) *= 8;
23  test_for_zero(t2(0, 0) - (t2_1(0, 0) * 4), "T2(i,N)*=T(0,0)");
24  test_for_zero(t2(1, 0) - (t2_1(1, 0) * 4), "T2(i,N)*=T(1,0)");
25  test_for_zero(t2(2, 0) - (t2_1(2, 0) * 4), "T2(i,N)*=T(2,0)");
26  test_for_zero(t2(0, 1) - (t2_1(0, 1) * 6), "T2(i,N)*=T(0,1)");
27  test_for_zero(t2(1, 1) - (t2_1(1, 1) * 6), "T2(i,N)*=T(1,1)");
28  test_for_zero(t2(2, 1) - (t2_1(2, 1) * 6), "T2(i,N)*=T(2,1)");
29  test_for_zero(t2(0, 2) - (t2_1(0, 2) * 8), "T2(i,N)*=T(0,2)");
30  test_for_zero(t2(1, 2) - (t2_1(1, 2) * 8), "T2(i,N)*=T(1,2)");
31  test_for_zero(t2(2, 2) - (t2_1(2, 2) * 8), "T2(i,N)*=T(2,2)");
32 
33  t2(i, j) = t2_1(i, j);
34  t2(i, N0) /= 2;
35  t2(i, N1) /= 3;
36  t2(i, N2) /= 4;
37 
38  test_for_zero(t2(0, 0) - (t2_1(0, 0) / 2), "T2(i,N)/=T(0,0)");
39  test_for_zero(t2(1, 0) - (t2_1(1, 0) / 2), "T2(i,N)/=T(1,0)");
40  test_for_zero(t2(2, 0) - (t2_1(2, 0) / 2), "T2(i,N)/=T(2,0)");
41  test_for_zero(t2(0, 1) - (t2_1(0, 1) / 3), "T2(i,N)/=T(0,1)");
42  test_for_zero(t2(1, 1) - (t2_1(1, 1) / 3), "T2(i,N)/=T(1,1)");
43  test_for_zero(t2(2, 1) - (t2_1(2, 1) / 3), "T2(i,N)/=T(2,1)");
44  test_for_zero(t2(0, 2) - (t2_1(0, 2) / 4), "T2(i,N)/=T(0,2)");
45  test_for_zero(t2(1, 2) - (t2_1(1, 2) / 4), "T2(i,N)/=T(1,2)");
46  test_for_zero(t2(2, 2) - (t2_1(2, 2) / 4), "T2(i,N)/=T(2,2)");
47 
48  t2(i, j) = t2_1(i, j);
49  const Tensor2<double, 3, 3> t2_const(t2);
50  test_for_zero(t2_const(i, i) - (t2_1(0, 0) + t2_1(1, 1) + t2_1(2, 2)),
51  "T2(i,i)");
52 }

◆ test_T2_13()

void test_T2_13 ( const Tensor2< double, 3, 3 > &  t2_1)

Definition at line 7 of file test_T2_13.cpp.

8 {
10 
11  Number<0> N0;
12  Number<1> N1;
13  Number<2> N2;
14 
15  /* Tensor2 tests */
16 
17  /* Test of actual numerals as an index. */
19 
20  t1(i) = t2_1(0, i);
21  test_for_zero(t2_1(0, 0) - t1(0), "T1(i)=T2(Num,i)(0,0)");
22  test_for_zero(t2_1(0, 1) - t1(1), "T1(i)=T2(Num,i)(0,1)");
23  test_for_zero(t2_1(0, 2) - t1(2), "T1(i)=T2(Num,i)(0,2)");
24  t1(i) = t2_1(1, i);
25  test_for_zero(t2_1(1, 0) - t1(0), "T1(i)=T2(Num,i)(1,0)");
26  test_for_zero(t2_1(1, 1) - t1(1), "T1(i)=T2(Num,i)(1,1)");
27  test_for_zero(t2_1(1, 2) - t1(2), "T1(i)=T2(Num,i)(1,2)");
28  t1(i) = t2_1(2, i);
29  test_for_zero(t2_1(2, 0) - t1(0), "T1(i)=T2(Num,i)(2,0)");
30  test_for_zero(t2_1(2, 1) - t1(1), "T1(i)=T2(Num,i)(2,1)");
31  test_for_zero(t2_1(2, 2) - t1(2), "T1(i)=T2(Num,i)(2,2)");
32 
33  t1(i) = t2_1(i, 0);
34  test_for_zero(t2_1(0, 0) - t1(0), "T1(i)=T2(i,Num)(0,0)");
35  test_for_zero(t2_1(1, 0) - t1(1), "T1(i)=T2(i,Num)(1,0)");
36  test_for_zero(t2_1(2, 0) - t1(2), "T1(i)=T2(i,Num)(2,0)");
37  t1(i) = t2_1(i, 1);
38  test_for_zero(t2_1(0, 1) - t1(0), "T1(i)=T2(i,Num)(0,1)");
39  test_for_zero(t2_1(1, 1) - t1(1), "T1(i)=T2(i,Num)(1,1)");
40  test_for_zero(t2_1(2, 1) - t1(2), "T1(i)=T2(i,Num)(2,1)");
41  t1(i) = t2_1(i, 2);
42  test_for_zero(t2_1(0, 2) - t1(0), "T1(i)=T2(i,Num)(0,2)");
43  test_for_zero(t2_1(1, 2) - t1(1), "T1(i)=T2(i,Num)(1,2)");
44  test_for_zero(t2_1(2, 2) - t1(2), "T1(i)=T2(i,Num)(2,2)");
45 }

◆ test_T2_14()

void test_T2_14 ( const Tensor1< double, 3 > &  t1_1,
const Tensor1< double, 3 > &  t1_2,
const Tensor2< double, 3, 3 > &  t2_2 
)

Definition at line 7 of file test_T2_14.cpp.

9 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
19 
20  /* add/subtract */
21 
22  t2(i, j) = t2_2(i, j) - t1_1(i) * t1_2(j);
23  test_for_zero(t2(0, 0) - (t2_2(0, 0) - t1_1(0) * t1_2(0)),
24  "T2(i,j)-T2(i,j)(0,0)");
25  test_for_zero(t2(0, 1) - (t2_2(0, 1) - t1_1(0) * t1_2(1)),
26  "T2(i,j)-T2(i,j)(0,1)");
27  test_for_zero(t2(0, 2) - (t2_2(0, 2) - t1_1(0) * t1_2(2)),
28  "T2(i,j)-T2(i,j)(0,2)");
29  test_for_zero(t2(1, 0) - (t2_2(1, 0) - t1_1(1) * t1_2(0)),
30  "T2(i,j)-T2(i,j)(1,0)");
31  test_for_zero(t2(1, 1) - (t2_2(1, 1) - t1_1(1) * t1_2(1)),
32  "T2(i,j)-T2(i,j)(1,1)");
33  test_for_zero(t2(1, 2) - (t2_2(1, 2) - t1_1(1) * t1_2(2)),
34  "T2(i,j)-T2(i,j)(1,2)");
35  test_for_zero(t2(2, 0) - (t2_2(2, 0) - t1_1(2) * t1_2(0)),
36  "T2(i,j)-T2(i,j)(2,0)");
37  test_for_zero(t2(2, 1) - (t2_2(2, 1) - t1_1(2) * t1_2(1)),
38  "T2(i,j)-T2(i,j)(2,1)");
39  test_for_zero(t2(2, 2) - (t2_2(2, 2) - t1_1(2) * t1_2(2)),
40  "T2(i,j)-T2(i,j)(2,2)");
41 
42  t2(i, j) = t2_2(i, j) - t1_1(j) * t1_2(i);
43  test_for_zero(t2(0, 0) - (t2_2(0, 0) - t1_2(0) * t1_1(0)),
44  "T2(i,j)-T2(j,i)(0,0)");
45  test_for_zero(t2(0, 1) - (t2_2(0, 1) - t1_2(0) * t1_1(1)),
46  "T2(i,j)-T2(j,i)(0,1)");
47  test_for_zero(t2(0, 2) - (t2_2(0, 2) - t1_2(0) * t1_1(2)),
48  "T2(i,j)-T2(j,i)(0,2)");
49  test_for_zero(t2(1, 0) - (t2_2(1, 0) - t1_2(1) * t1_1(0)),
50  "T2(i,j)-T2(j,i)(1,0)");
51  test_for_zero(t2(1, 1) - (t2_2(1, 1) - t1_2(1) * t1_1(1)),
52  "T2(i,j)-T2(j,i)(1,1)");
53  test_for_zero(t2(1, 2) - (t2_2(1, 2) - t1_2(1) * t1_1(2)),
54  "T2(i,j)-T2(j,i)(1,2)");
55  test_for_zero(t2(2, 0) - (t2_2(2, 0) - t1_2(2) * t1_1(0)),
56  "T2(i,j)-T2(j,i)(2,0)");
57  test_for_zero(t2(2, 1) - (t2_2(2, 1) - t1_2(2) * t1_1(1)),
58  "T2(i,j)-T2(j,i)(2,1)");
59  test_for_zero(t2(2, 2) - (t2_2(2, 2) - t1_2(2) * t1_1(2)),
60  "T2(i,j)-T2(j,i)(2,2)");
61 }

◆ test_T2_15()

void test_T2_15 ( const Tensor1< double, 3 > &  t1_1,
const Tensor1< double, 3 > &  t1_2,
const Tensor2< double, 3, 3 > &  t2_2 
)

Definition at line 7 of file test_T2_15.cpp.

9 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
19 
20  /* add/subtract */
21 
22  t2(i, j) = t2_2(i, j) + t1_1(i) * t1_2(j);
23  test_for_zero(t2(0, 0) - (t2_2(0, 0) + t1_1(0) * t1_2(0)),
24  "T2(i,j)+T2(i,j)(0,0)");
25  test_for_zero(t2(0, 1) - (t2_2(0, 1) + t1_1(0) * t1_2(1)),
26  "T2(i,j)+T2(i,j)(0,1)");
27  test_for_zero(t2(0, 2) - (t2_2(0, 2) + t1_1(0) * t1_2(2)),
28  "T2(i,j)+T2(i,j)(0,2)");
29  test_for_zero(t2(1, 0) - (t2_2(1, 0) + t1_1(1) * t1_2(0)),
30  "T2(i,j)+T2(i,j)(1,0)");
31  test_for_zero(t2(1, 1) - (t2_2(1, 1) + t1_1(1) * t1_2(1)),
32  "T2(i,j)+T2(i,j)(1,1)");
33  test_for_zero(t2(1, 2) - (t2_2(1, 2) + t1_1(1) * t1_2(2)),
34  "T2(i,j)+T2(i,j)(1,2)");
35  test_for_zero(t2(2, 0) - (t2_2(2, 0) + t1_1(2) * t1_2(0)),
36  "T2(i,j)+T2(i,j)(2,0)");
37  test_for_zero(t2(2, 1) - (t2_2(2, 1) + t1_1(2) * t1_2(1)),
38  "T2(i,j)+T2(i,j)(2,1)");
39  test_for_zero(t2(2, 2) - (t2_2(2, 2) + t1_1(2) * t1_2(2)),
40  "T2(i,j)+T2(i,j)(2,2)");
41 
42  t2(i, j) = t2_2(i, j) + t1_1(j) * t1_2(i);
43  test_for_zero(t2(0, 0) - (t2_2(0, 0) + t1_1(0) * t1_2(0)),
44  "T2(i,j)+T2(j,i)(0,0)");
45  test_for_zero(t2(1, 0) - (t2_2(1, 0) + t1_1(0) * t1_2(1)),
46  "T2(i,j)+T2(j,i)(0,1)");
47  test_for_zero(t2(2, 0) - (t2_2(2, 0) + t1_1(0) * t1_2(2)),
48  "T2(i,j)+T2(j,i)(0,2)");
49  test_for_zero(t2(0, 1) - (t2_2(0, 1) + t1_1(1) * t1_2(0)),
50  "T2(i,j)+T2(j,i)(1,0)");
51  test_for_zero(t2(1, 1) - (t2_2(1, 1) + t1_1(1) * t1_2(1)),
52  "T2(i,j)+T2(j,i)(1,1)");
53  test_for_zero(t2(2, 1) - (t2_2(2, 1) + t1_1(1) * t1_2(2)),
54  "T2(i,j)+T2(j,i)(1,2)");
55  test_for_zero(t2(0, 2) - (t2_2(0, 2) + t1_1(2) * t1_2(0)),
56  "T2(i,j)+T2(j,i)(2,0)");
57  test_for_zero(t2(1, 2) - (t2_2(1, 2) + t1_1(2) * t1_2(1)),
58  "T2(i,j)+T2(j,i)(2,1)");
59  test_for_zero(t2(2, 2) - (t2_2(2, 2) + t1_1(2) * t1_2(2)),
60  "T2(i,j)+T2(j,i)(2,2)");
61 }

◆ test_T2_16()

void test_T2_16 ( const Tensor1< double, 3 > &  t1_1,
const Tensor1< double, 3 > &  t1_2,
const Tensor2< double, 3, 3 > &  t2_2 
)

Definition at line 7 of file test_T2_16.cpp.

9 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
19 
20  /* Equals */
21 
22  t2(i, j) = t2_2(i, j) + t1_1(j) * t1_2(i);
23  test_for_zero(t2(0, 0) - (t2_2(0, 0) + t1_2(0) * t1_1(0)),
24  "T2(i,j)=T2(i,j)(0,0)");
25  test_for_zero(t2(0, 1) - (t2_2(0, 1) + t1_2(0) * t1_1(1)),
26  "T2(i,j)=T2(i,j)(0,1)");
27  test_for_zero(t2(0, 2) - (t2_2(0, 2) + t1_2(0) * t1_1(2)),
28  "T2(i,j)=T2(i,j)(0,2)");
29  test_for_zero(t2(1, 0) - (t2_2(1, 0) + t1_2(1) * t1_1(0)),
30  "T2(i,j)=T2(i,j)(1,0)");
31  test_for_zero(t2(1, 1) - (t2_2(1, 1) + t1_2(1) * t1_1(1)),
32  "T2(i,j)=T2(i,j)(1,1)");
33  test_for_zero(t2(1, 2) - (t2_2(1, 2) + t1_2(1) * t1_1(2)),
34  "T2(i,j)=T2(i,j)(1,2)");
35  test_for_zero(t2(2, 0) - (t2_2(2, 0) + t1_2(2) * t1_1(0)),
36  "T2(i,j)=T2(i,j)(2,0)");
37  test_for_zero(t2(2, 1) - (t2_2(2, 1) + t1_2(2) * t1_1(1)),
38  "T2(i,j)=T2(i,j)(2,1)");
39  test_for_zero(t2(2, 2) - (t2_2(2, 2) + t1_2(2) * t1_1(2)),
40  "T2(i,j)=T2(i,j)(2,2)");
41 }

◆ test_T2_17()

void test_T2_17 ( const Tensor2< double, 3, 3 > &  t2_1,
const Tensor2< double, 3, 3 > &  t2_2 
)

Definition at line 7 of file test_T2_17.cpp.

9 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
19  t2(i, j) = t2_1(i, j);
20 
21  /* Equals */
22 
23  t2(i, j) += t2_2(i, j);
24  test_for_zero(t2(0, 0) - (t2_1(0, 0) + t2_2(0, 0)), "T2(i,j)+=T2(i,j)(0,0)");
25  test_for_zero(t2(0, 1) - (t2_1(0, 1) + t2_2(0, 1)), "T2(i,j)+=T2(i,j)(0,1)");
26  test_for_zero(t2(0, 2) - (t2_1(0, 2) + t2_2(0, 2)), "T2(i,j)+=T2(i,j)(0,2)");
27  test_for_zero(t2(1, 0) - (t2_1(1, 0) + t2_2(1, 0)), "T2(i,j)+=T2(i,j)(1,0)");
28  test_for_zero(t2(1, 1) - (t2_1(1, 1) + t2_2(1, 1)), "T2(i,j)+=T2(i,j)(1,1)");
29  test_for_zero(t2(1, 2) - (t2_1(1, 2) + t2_2(1, 2)), "T2(i,j)+=T2(i,j)(1,2)");
30  test_for_zero(t2(2, 0) - (t2_1(2, 0) + t2_2(2, 0)), "T2(i,j)+=T2(i,j)(2,0)");
31  test_for_zero(t2(2, 1) - (t2_1(2, 1) + t2_2(2, 1)), "T2(i,j)+=T2(i,j)(2,1)");
32  test_for_zero(t2(2, 2) - (t2_1(2, 2) + t2_2(2, 2)), "T2(i,j)+=T2(i,j)(2,2)");
33 }

◆ test_T2_18()

void test_T2_18 ( const Tensor2< double, 3, 3 > &  t2_1,
const Tensor2< double, 3, 3 > &  t2_2 
)

Definition at line 7 of file test_T2_18.cpp.

9 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
19  t2(i, j) = t2_1(i, j);
20 
21  /* Equals */
22 
23  t2(i, j) -= 5 * t2_2(i, j);
24  test_for_zero(t2(0, 0) - (t2_1(0, 0) - 5 * t2_2(0, 0)),
25  "T2(i,j)-=T2(i,j)(0,0)");
26  test_for_zero(t2(0, 1) - (t2_1(0, 1) - 5 * t2_2(0, 1)),
27  "T2(i,j)-=T2(i,j)(0,1)");
28  test_for_zero(t2(0, 2) - (t2_1(0, 2) - 5 * t2_2(0, 2)),
29  "T2(i,j)-=T2(i,j)(0,2)");
30  test_for_zero(t2(1, 0) - (t2_1(1, 0) - 5 * t2_2(1, 0)),
31  "T2(i,j)-=T2(i,j)(1,0)");
32  test_for_zero(t2(1, 1) - (t2_1(1, 1) - 5 * t2_2(1, 1)),
33  "T2(i,j)-=T2(i,j)(1,1)");
34  test_for_zero(t2(1, 2) - (t2_1(1, 2) - 5 * t2_2(1, 2)),
35  "T2(i,j)-=T2(i,j)(1,2)");
36  test_for_zero(t2(2, 0) - (t2_1(2, 0) - 5 * t2_2(2, 0)),
37  "T2(i,j)-=T2(i,j)(2,0)");
38  test_for_zero(t2(2, 1) - (t2_1(2, 1) - 5 * t2_2(2, 1)),
39  "T2(i,j)-=T2(i,j)(2,1)");
40  test_for_zero(t2(2, 2) - (t2_1(2, 2) - 5 * t2_2(2, 2)),
41  "T2(i,j)-=T2(i,j)(2,2)");
42 }

◆ test_T2_19()

void test_T2_19 ( const Tensor1< double, 3 > &  t1_1,
const Tensor1< double, 3 > &  t1_2,
const Tensor2< double, 3, 3 > &  t2_2 
)

Definition at line 7 of file test_T2_19.cpp.

9 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
19 
20  /* Equals */
21 
22  /* Switch indices */
23 
24  t2(j, i) = t2_2(i, j) + t1_1(j) * t1_2(i);
25  test_for_zero(t2(0, 0) - (t2_2(0, 0) + t1_2(0) * t1_1(0)),
26  "T2(j,i)=T2(i,j)(0,0)");
27  test_for_zero(t2(1, 0) - (t2_2(0, 1) + t1_2(0) * t1_1(1)),
28  "T2(j,i)=T2(i,j)(0,1)");
29  test_for_zero(t2(2, 0) - (t2_2(0, 2) + t1_2(0) * t1_1(2)),
30  "T2(j,i)=T2(i,j)(0,2)");
31  test_for_zero(t2(0, 1) - (t2_2(1, 0) + t1_2(1) * t1_1(0)),
32  "T2(j,i)=T2(i,j)(1,0)");
33  test_for_zero(t2(1, 1) - (t2_2(1, 1) + t1_2(1) * t1_1(1)),
34  "T2(j,i)=T2(i,j)(1,1)");
35  test_for_zero(t2(2, 1) - (t2_2(1, 2) + t1_2(1) * t1_1(2)),
36  "T2(j,i)=T2(i,j)(1,2)");
37  test_for_zero(t2(0, 2) - (t2_2(2, 0) + t1_2(2) * t1_1(0)),
38  "T2(j,i)=T2(i,j)(2,0)");
39  test_for_zero(t2(1, 2) - (t2_2(2, 1) + t1_2(2) * t1_1(1)),
40  "T2(j,i)=T2(i,j)(2,1)");
41  test_for_zero(t2(2, 2) - (t2_2(2, 2) + t1_2(2) * t1_1(2)),
42  "T2(j,i)=T2(i,j)(2,2)");
43 }

◆ test_T2_20()

void test_T2_20 ( const Tensor2< double, 3, 3 > &  t2_1,
const Tensor2< double, 3, 3 > &  t2_2 
)

Definition at line 7 of file test_T2_20.cpp.

9 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
19  t2(i, j) = t2_1(i, j);
20 
21  /* Equals */
22 
23  /* Switch indices */
24 
25  t2(j, i) += t2_2(i, j);
26  test_for_zero(t2(0, 0) - (t2_1(0, 0) + t2_2(0, 0)), "T2(j,i)+=T2(i,j)(0,0)");
27  test_for_zero(t2(1, 0) - (t2_1(1, 0) + t2_2(0, 1)), "T2(j,i)+=T2(i,j)(0,1)");
28  test_for_zero(t2(2, 0) - (t2_1(2, 0) + t2_2(0, 2)), "T2(j,i)+=T2(i,j)(0,2)");
29  test_for_zero(t2(0, 1) - (t2_1(0, 1) + t2_2(1, 0)), "T2(j,i)+=T2(i,j)(1,0)");
30  test_for_zero(t2(1, 1) - (t2_1(1, 1) + t2_2(1, 1)), "T2(j,i)+=T2(i,j)(1,1)");
31  test_for_zero(t2(2, 1) - (t2_1(2, 1) + t2_2(1, 2)), "T2(j,i)+=T2(i,j)(1,2)");
32  test_for_zero(t2(0, 2) - (t2_1(0, 2) + t2_2(2, 0)), "T2(j,i)+=T2(i,j)(2,0)");
33  test_for_zero(t2(1, 2) - (t2_1(1, 2) + t2_2(2, 1)), "T2(j,i)+=T2(i,j)(2,1)");
34  test_for_zero(t2(2, 2) - (t2_1(2, 2) + t2_2(2, 2)), "T2(j,i)+=T2(i,j)(2,2)");
35 }

◆ test_T2_21()

void test_T2_21 ( const Tensor2< double, 3, 3 > &  t2_1,
const Tensor2< double, 3, 3 > &  t2_2 
)

Definition at line 7 of file test_T2_21.cpp.

9 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
19  t2(i, j) = t2_1(i, j);
20 
21  /* Equals */
22 
23  /* Switch indices */
24 
25  t2(j, i) -= 5 * t2_2(i, j);
26  test_for_zero(t2(0, 0) - (t2_1(0, 0) - 5 * t2_2(0, 0)),
27  "T2(j,i)-=T2(i,j)(0,0)");
28  test_for_zero(t2(1, 0) - (t2_1(1, 0) - 5 * t2_2(0, 1)),
29  "T2(j,i)-=T2(i,j)(0,1)");
30  test_for_zero(t2(2, 0) - (t2_1(2, 0) - 5 * t2_2(0, 2)),
31  "T2(j,i)-=T2(i,j)(0,2)");
32  test_for_zero(t2(0, 1) - (t2_1(0, 1) - 5 * t2_2(1, 0)),
33  "T2(j,i)-=T2(i,j)(1,0)");
34  test_for_zero(t2(1, 1) - (t2_1(1, 1) - 5 * t2_2(1, 1)),
35  "T2(j,i)-=T2(i,j)(1,1)");
36  test_for_zero(t2(2, 1) - (t2_1(2, 1) - 5 * t2_2(1, 2)),
37  "T2(j,i)-=T2(i,j)(1,2)");
38  test_for_zero(t2(0, 2) - (t2_1(0, 2) - 5 * t2_2(2, 0)),
39  "T2(j,i)-=T2(i,j)(2,0)");
40  test_for_zero(t2(1, 2) - (t2_1(1, 2) - 5 * t2_2(2, 1)),
41  "T2(j,i)-=T2(i,j)(2,1)");
42  test_for_zero(t2(2, 2) - (t2_1(2, 2) - 5 * t2_2(2, 2)),
43  "T2(j,i)-=T2(i,j)(2,2)");
44 }

◆ test_T2_22()

void test_T2_22 ( const Tensor2< double, 3, 3 > &  t2_1)

Definition at line 7 of file test_T2_22.cpp.

8 {
11 
12  Number<0> N0;
13  Number<1> N1;
14  Number<2> N2;
15 
16  /* Tensor2 tests */
18 
19  /* Equals */
20 
21  t2(i, j) = t2_1(i, j);
22  t2(i, j) += 10;
23  test_for_zero(t2(0, 0) - (t2_1(0, 0) + 10), "T2+=T(0,0)");
24  test_for_zero(t2(1, 0) - (t2_1(1, 0) + 10), "T2+=T(0,1)");
25  test_for_zero(t2(2, 0) - (t2_1(2, 0) + 10), "T2+=T(0,2)");
26  test_for_zero(t2(0, 1) - (t2_1(0, 1) + 10), "T2+=T(1,0)");
27  test_for_zero(t2(1, 1) - (t2_1(1, 1) + 10), "T2+=T(1,1)");
28  test_for_zero(t2(2, 1) - (t2_1(2, 1) + 10), "T2+=T(1,2)");
29  test_for_zero(t2(0, 2) - (t2_1(0, 2) + 10), "T2+=T(2,0)");
30  test_for_zero(t2(1, 2) - (t2_1(1, 2) + 10), "T2+=T(2,1)");
31  test_for_zero(t2(2, 2) - (t2_1(2, 2) + 10), "T2+=T(2,2)");
32 
33  t2(i, j) = t2_1(i, j);
34  t2(i, j) -= 7;
35  test_for_zero(t2(0, 0) - (t2_1(0, 0) - 7), "T2-=T(0,0)");
36  test_for_zero(t2(1, 0) - (t2_1(1, 0) - 7), "T2-=T(0,1)");
37  test_for_zero(t2(2, 0) - (t2_1(2, 0) - 7), "T2-=T(0,2)");
38  test_for_zero(t2(0, 1) - (t2_1(0, 1) - 7), "T2-=T(1,0)");
39  test_for_zero(t2(1, 1) - (t2_1(1, 1) - 7), "T2-=T(1,1)");
40  test_for_zero(t2(2, 1) - (t2_1(2, 1) - 7), "T2-=T(1,2)");
41  test_for_zero(t2(0, 2) - (t2_1(0, 2) - 7), "T2-=T(2,0)");
42  test_for_zero(t2(1, 2) - (t2_1(1, 2) - 7), "T2-=T(2,1)");
43  test_for_zero(t2(2, 2) - (t2_1(2, 2) - 7), "T2-=T(2,2)");
44 
45  t2(i, j) = t2_1(i, j);
46  t2(i, j) *= 12;
47  test_for_zero(t2(0, 0) - (t2_1(0, 0) * 12), "T2*=T(0,0)");
48  test_for_zero(t2(1, 0) - (t2_1(1, 0) * 12), "T2*=T(0,1)");
49  test_for_zero(t2(2, 0) - (t2_1(2, 0) * 12), "T2*=T(0,2)");
50  test_for_zero(t2(0, 1) - (t2_1(0, 1) * 12), "T2*=T(1,0)");
51  test_for_zero(t2(1, 1) - (t2_1(1, 1) * 12), "T2*=T(1,1)");
52  test_for_zero(t2(2, 1) - (t2_1(2, 1) * 12), "T2*=T(1,2)");
53  test_for_zero(t2(0, 2) - (t2_1(0, 2) * 12), "T2*=T(2,0)");
54  test_for_zero(t2(1, 2) - (t2_1(1, 2) * 12), "T2*=T(2,1)");
55  test_for_zero(t2(2, 2) - (t2_1(2, 2) * 12), "T2*=T(2,2)");
56 
57  t2(i, j) = t2_1(i, j);
58  t2(i, j) /= 4;
59  test_for_zero(t2(0, 0) - (t2_1(0, 0) / 4), "T2/=T(0,0)");
60  test_for_zero(t2(1, 0) - (t2_1(1, 0) / 4), "T2/=T(0,1)");
61  test_for_zero(t2(2, 0) - (t2_1(2, 0) / 4), "T2/=T(0,2)");
62  test_for_zero(t2(0, 1) - (t2_1(0, 1) / 4), "T2/=T(1,0)");
63  test_for_zero(t2(1, 1) - (t2_1(1, 1) / 4), "T2/=T(1,1)");
64  test_for_zero(t2(2, 1) - (t2_1(2, 1) / 4), "T2/=T(1,2)");
65  test_for_zero(t2(0, 2) - (t2_1(0, 2) / 4), "T2/=T(2,0)");
66  test_for_zero(t2(1, 2) - (t2_1(1, 2) / 4), "T2/=T(2,1)");
67  test_for_zero(t2(2, 2) - (t2_1(2, 2) / 4), "T2/=T(2,2)");
68 }

◆ test_T2_23()

void test_T2_23 ( const Tensor1< double, 3 > &  t1_2,
const Tensor2< double, 3, 3 > &  t2_2 
)

Definition at line 7 of file test_T2_23.cpp.

9 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
18 
19  /* Tensor2*Tensor1 */
21 
22  t1(i) = t2_2(i, j) * t1_2(j);
24  t1(0)
25  - (t2_2(0, 0) * t1_2(0) + t2_2(0, 1) * t1_2(1) + t2_2(0, 2) * t1_2(2)),
26  "T2(i,j)*T1(j)(0)");
28  t1(1)
29  - (t2_2(1, 0) * t1_2(0) + t2_2(1, 1) * t1_2(1) + t2_2(1, 2) * t1_2(2)),
30  "T2(i,j)*T1(j)(1)");
32  t1(2)
33  - (t2_2(2, 0) * t1_2(0) + t2_2(2, 1) * t1_2(1) + t2_2(2, 2) * t1_2(2)),
34  "T2(i,j)*T1(j)(2)");
35 
36  t1(i) = t1_2(j) * t2_2(i, j);
38  t1(0)
39  - (t2_2(0, 0) * t1_2(0) + t2_2(0, 1) * t1_2(1) + t2_2(0, 2) * t1_2(2)),
40  "T1(j)*T2(i,j)(0)");
42  t1(1)
43  - (t2_2(1, 0) * t1_2(0) + t2_2(1, 1) * t1_2(1) + t2_2(1, 2) * t1_2(2)),
44  "T1(j)*T2(i,j)(1)");
46  t1(2)
47  - (t2_2(2, 0) * t1_2(0) + t2_2(2, 1) * t1_2(1) + t2_2(2, 2) * t1_2(2)),
48  "T1(j)*T2(i,j)(2)");
49 
50  t1(j) = t2_2(i, j) * t1_2(i);
52  t1(0)
53  - (t2_2(0, 0) * t1_2(0) + t2_2(1, 0) * t1_2(1) + t2_2(2, 0) * t1_2(2)),
54  "T2(i,j)*T1(i)(0)");
56  t1(1)
57  - (t2_2(0, 1) * t1_2(0) + t2_2(1, 1) * t1_2(1) + t2_2(2, 1) * t1_2(2)),
58  "T2(i,j)*T1(i)(1)");
60  t1(2)
61  - (t2_2(0, 2) * t1_2(0) + t2_2(1, 2) * t1_2(1) + t2_2(2, 2) * t1_2(2)),
62  "T2(i,j)*T1(i)(2)");
63 
64  t1(j) = t1_2(i) * t2_2(i, j);
66  t1(0)
67  - (t2_2(0, 0) * t1_2(0) + t2_2(1, 0) * t1_2(1) + t2_2(2, 0) * t1_2(2)),
68  "T1(i)*T2(i,j)(0)");
70  t1(1)
71  - (t2_2(0, 1) * t1_2(0) + t2_2(1, 1) * t1_2(1) + t2_2(2, 1) * t1_2(2)),
72  "T1(i)*T2(i,j)(1)");
74  t1(2)
75  - (t2_2(0, 2) * t1_2(0) + t2_2(1, 2) * t1_2(1) + t2_2(2, 2) * t1_2(2)),
76  "T1(i)*T2(i,j)(2)");
77 }

◆ test_T2_24()

void test_T2_24 ( const Tensor1< double, 3 > &  t1_2,
const Tensor2< double, 3, 3 > &  t2_2 
)

Definition at line 7 of file test_T2_24.cpp.

9 {
13 
14  Number<0> N0;
15  Number<1> N1;
16  Number<2> N2;
17 
18  /* Tensor2 tests */
19 
20  /* Tensor2*Tensor1 */
21 
22  test_for_zero((t2_2(i, j) * t1_2(k))(0, 0, 0) - t2_2(0, 0) * t1_2(0),
23  "T2(i,j)*T1(k)(0,0,0)");
24  test_for_zero((t2_2(i, j) * t1_2(k))(0, 0, 1) - t2_2(0, 0) * t1_2(1),
25  "T2(i,j)*T1(k)(0,0,1)");
26  test_for_zero((t2_2(i, j) * t1_2(k))(0, 0, 2) - t2_2(0, 0) * t1_2(2),
27  "T2(i,j)*T1(k)(0,0,2)");
28  test_for_zero((t2_2(i, j) * t1_2(k))(0, 1, 0) - t2_2(0, 1) * t1_2(0),
29  "T2(i,j)*T1(k)(0,1,0)");
30  test_for_zero((t2_2(i, j) * t1_2(k))(0, 1, 1) - t2_2(0, 1) * t1_2(1),
31  "T2(i,j)*T1(k)(0,1,1)");
32  test_for_zero((t2_2(i, j) * t1_2(k))(0, 1, 2) - t2_2(0, 1) * t1_2(2),
33  "T2(i,j)*T1(k)(0,1,2)");
34  test_for_zero((t2_2(i, j) * t1_2(k))(0, 2, 0) - t2_2(0, 2) * t1_2(0),
35  "T2(i,j)*T1(k)(0,2,0)");
36  test_for_zero((t2_2(i, j) * t1_2(k))(0, 2, 1) - t2_2(0, 2) * t1_2(1),
37  "T2(i,j)*T1(k)(0,2,1)");
38  test_for_zero((t2_2(i, j) * t1_2(k))(0, 2, 2) - t2_2(0, 2) * t1_2(2),
39  "T2(i,j)*T1(k)(0,2,2)");
40  test_for_zero((t2_2(i, j) * t1_2(k))(1, 0, 0) - t2_2(1, 0) * t1_2(0),
41  "T2(i,j)*T1(k)(1,0,0)");
42  test_for_zero((t2_2(i, j) * t1_2(k))(1, 0, 1) - t2_2(1, 0) * t1_2(1),
43  "T2(i,j)*T1(k)(1,0,1)");
44  test_for_zero((t2_2(i, j) * t1_2(k))(1, 0, 2) - t2_2(1, 0) * t1_2(2),
45  "T2(i,j)*T1(k)(1,0,2)");
46  test_for_zero((t2_2(i, j) * t1_2(k))(1, 1, 0) - t2_2(1, 1) * t1_2(0),
47  "T2(i,j)*T1(k)(1,1,0)");
48  test_for_zero((t2_2(i, j) * t1_2(k))(1, 1, 1) - t2_2(1, 1) * t1_2(1),
49  "T2(i,j)*T1(k)(1,1,1)");
50  test_for_zero((t2_2(i, j) * t1_2(k))(1, 1, 2) - t2_2(1, 1) * t1_2(2),
51  "T2(i,j)*T1(k)(1,1,2)");
52  test_for_zero((t2_2(i, j) * t1_2(k))(1, 2, 0) - t2_2(1, 2) * t1_2(0),
53  "T2(i,j)*T1(k)(1,2,0)");
54  test_for_zero((t2_2(i, j) * t1_2(k))(1, 2, 1) - t2_2(1, 2) * t1_2(1),
55  "T2(i,j)*T1(k)(1,2,1)");
56  test_for_zero((t2_2(i, j) * t1_2(k))(1, 2, 2) - t2_2(1, 2) * t1_2(2),
57  "T2(i,j)*T1(k)(1,2,2)");
58  test_for_zero((t2_2(i, j) * t1_2(k))(2, 0, 0) - t2_2(2, 0) * t1_2(0),
59  "T2(i,j)*T1(k)(2,0,0)");
60  test_for_zero((t2_2(i, j) * t1_2(k))(2, 0, 1) - t2_2(2, 0) * t1_2(1),
61  "T2(i,j)*T1(k)(2,0,1)");
62  test_for_zero((t2_2(i, j) * t1_2(k))(2, 0, 2) - t2_2(2, 0) * t1_2(2),
63  "T2(i,j)*T1(k)(2,0,2)");
64  test_for_zero((t2_2(i, j) * t1_2(k))(2, 1, 0) - t2_2(2, 1) * t1_2(0),
65  "T2(i,j)*T1(k)(2,1,0)");
66  test_for_zero((t2_2(i, j) * t1_2(k))(2, 1, 1) - t2_2(2, 1) * t1_2(1),
67  "T2(i,j)*T1(k)(2,1,1)");
68  test_for_zero((t2_2(i, j) * t1_2(k))(2, 1, 2) - t2_2(2, 1) * t1_2(2),
69  "T2(i,j)*T1(k)(2,1,2)");
70  test_for_zero((t2_2(i, j) * t1_2(k))(2, 2, 0) - t2_2(2, 2) * t1_2(0),
71  "T2(i,j)*T1(k)(2,2,0)");
72  test_for_zero((t2_2(i, j) * t1_2(k))(2, 2, 1) - t2_2(2, 2) * t1_2(1),
73  "T2(i,j)*T1(k)(2,2,1)");
74  test_for_zero((t2_2(i, j) * t1_2(k))(2, 2, 2) - t2_2(2, 2) * t1_2(2),
75  "T2(i,j)*T1(k)(2,2,2)");
76 
77  test_for_zero((t1_2(k) * t2_2(i, j))(0, 0, 0) - t2_2(0, 0) * t1_2(0),
78  "T1(k)*T2(i,j)(0,0,0)");
79  test_for_zero((t1_2(k) * t2_2(i, j))(0, 0, 1) - t2_2(0, 0) * t1_2(1),
80  "T1(k)*T2(i,j)(0,0,1)");
81  test_for_zero((t1_2(k) * t2_2(i, j))(0, 0, 2) - t2_2(0, 0) * t1_2(2),
82  "T1(k)*T2(i,j)(0,0,2)");
83  test_for_zero((t1_2(k) * t2_2(i, j))(0, 1, 0) - t2_2(0, 1) * t1_2(0),
84  "T1(k)*T2(i,j)(0,1,0)");
85  test_for_zero((t1_2(k) * t2_2(i, j))(0, 1, 1) - t2_2(0, 1) * t1_2(1),
86  "T1(k)*T2(i,j)(0,1,1)");
87  test_for_zero((t1_2(k) * t2_2(i, j))(0, 1, 2) - t2_2(0, 1) * t1_2(2),
88  "T1(k)*T2(i,j)(0,1,2)");
89  test_for_zero((t1_2(k) * t2_2(i, j))(0, 2, 0) - t2_2(0, 2) * t1_2(0),
90  "T1(k)*T2(i,j)(0,2,0)");
91  test_for_zero((t1_2(k) * t2_2(i, j))(0, 2, 1) - t2_2(0, 2) * t1_2(1),
92  "T1(k)*T2(i,j)(0,2,1)");
93  test_for_zero((t1_2(k) * t2_2(i, j))(0, 2, 2) - t2_2(0, 2) * t1_2(2),
94  "T1(k)*T2(i,j)(0,2,2)");
95  test_for_zero((t1_2(k) * t2_2(i, j))(1, 0, 0) - t2_2(1, 0) * t1_2(0),
96  "T1(k)*T2(i,j)(1,0,0)");
97  test_for_zero((t1_2(k) * t2_2(i, j))(1, 0, 1) - t2_2(1, 0) * t1_2(1),
98  "T1(k)*T2(i,j)(1,0,1)");
99  test_for_zero((t1_2(k) * t2_2(i, j))(1, 0, 2) - t2_2(1, 0) * t1_2(2),
100  "T1(k)*T2(i,j)(1,0,2)");
101  test_for_zero((t1_2(k) * t2_2(i, j))(1, 1, 0) - t2_2(1, 1) * t1_2(0),
102  "T1(k)*T2(i,j)(1,1,0)");
103  test_for_zero((t1_2(k) * t2_2(i, j))(1, 1, 1) - t2_2(1, 1) * t1_2(1),
104  "T1(k)*T2(i,j)(1,1,1)");
105  test_for_zero((t1_2(k) * t2_2(i, j))(1, 1, 2) - t2_2(1, 1) * t1_2(2),
106  "T1(k)*T2(i,j)(1,1,2)");
107  test_for_zero((t1_2(k) * t2_2(i, j))(1, 2, 0) - t2_2(1, 2) * t1_2(0),
108  "T1(k)*T2(i,j)(1,2,0)");
109  test_for_zero((t1_2(k) * t2_2(i, j))(1, 2, 1) - t2_2(1, 2) * t1_2(1),
110  "T1(k)*T2(i,j)(1,2,1)");
111  test_for_zero((t1_2(k) * t2_2(i, j))(1, 2, 2) - t2_2(1, 2) * t1_2(2),
112  "T1(k)*T2(i,j)(1,2,2)");
113  test_for_zero((t1_2(k) * t2_2(i, j))(2, 0, 0) - t2_2(2, 0) * t1_2(0),
114  "T1(k)*T2(i,j)(2,0,0)");
115  test_for_zero((t1_2(k) * t2_2(i, j))(2, 0, 1) - t2_2(2, 0) * t1_2(1),
116  "T1(k)*T2(i,j)(2,0,1)");
117  test_for_zero((t1_2(k) * t2_2(i, j))(2, 0, 2) - t2_2(2, 0) * t1_2(2),
118  "T1(k)*T2(i,j)(2,0,2)");
119  test_for_zero((t1_2(k) * t2_2(i, j))(2, 1, 0) - t2_2(2, 1) * t1_2(0),
120  "T1(k)*T2(i,j)(2,1,0)");
121  test_for_zero((t1_2(k) * t2_2(i, j))(2, 1, 1) - t2_2(2, 1) * t1_2(1),
122  "T1(k)*T2(i,j)(2,1,1)");
123  test_for_zero((t1_2(k) * t2_2(i, j))(2, 1, 2) - t2_2(2, 1) * t1_2(2),
124  "T1(k)*T2(i,j)(2,1,2)");
125  test_for_zero((t1_2(k) * t2_2(i, j))(2, 2, 0) - t2_2(2, 2) * t1_2(0),
126  "T1(k)*T2(i,j)(2,2,0)");
127  test_for_zero((t1_2(k) * t2_2(i, j))(2, 2, 1) - t2_2(2, 2) * t1_2(1),
128  "T1(k)*T2(i,j)(2,2,1)");
129  test_for_zero((t1_2(k) * t2_2(i, j))(2, 2, 2) - t2_2(2, 2) * t1_2(2),
130  "T1(k)*T2(i,j)(2,2,2)");
131 }

◆ test_T2_25()

void test_T2_25 ( const Tensor2< double, 4, 3 > &  t2_4,
const Tensor2< double, 3, 4 > &  t2_5 
)

Definition at line 7 of file test_T2_25.cpp.

9 {
12 
14  t2_a(i, j) = t2_5(j, i);
15 
16  test_for_zero((t2_4(i, j) * t2_a(i, j)
17  - (t2_4(0, 0) * t2_a(0, 0) + t2_4(0, 1) * t2_a(0, 1)
18  + t2_4(0, 2) * t2_a(0, 2) + t2_4(1, 0) * t2_a(1, 0)
19  + t2_4(1, 1) * t2_a(1, 1) + t2_4(1, 2) * t2_a(1, 2)
20  + t2_4(2, 0) * t2_a(2, 0) + t2_4(2, 1) * t2_a(2, 1)
21  + t2_4(2, 2) * t2_a(2, 2) + t2_4(3, 0) * t2_a(3, 0)
22  + t2_4(3, 1) * t2_a(3, 1) + t2_4(3, 2) * t2_a(3, 2)))
23  * 1e-5,
24  "T2(i,j)*T2(i,j)");
25 
26  test_for_zero((t2_4(i, j) * t2_5(j, i)
27  - (t2_4(0, 0) * t2_5(0, 0) + t2_4(0, 1) * t2_5(1, 0)
28  + t2_4(0, 2) * t2_5(2, 0) + t2_4(1, 0) * t2_5(0, 1)
29  + t2_4(1, 1) * t2_5(1, 1) + t2_4(1, 2) * t2_5(2, 1)
30  + t2_4(2, 0) * t2_5(0, 2) + t2_4(2, 1) * t2_5(1, 2)
31  + t2_4(2, 2) * t2_5(2, 2) + t2_4(3, 0) * t2_5(0, 3)
32  + t2_4(3, 1) * t2_5(1, 3) + t2_4(3, 2) * t2_5(2, 3)))
33  * 1e-5,
34  "T2(i,j)*T2(j,i)");
35 }

◆ test_T2_26()

void test_T2_26 ( const Tensor2< double, 4, 3 > &  t2_4,
const Tensor2< double, 3, 4 > &  t2_5 
)

Definition at line 7 of file test_T2_26.cpp.

9 {
13 
15  t2(i, k) = t2_5(i, j) * t2_4(j, k);
16 
17  for(int ii = 0; ii < 3; ++ii)
18  for(int kk = 0; kk < 3; ++kk)
19  {
21  t2(ii, kk)
22  - (t2_5(ii, 0) * t2_4(0, kk) + t2_5(ii, 1) * t2_4(1, kk)
23  + t2_5(ii, 2) * t2_4(2, kk) + t2_5(ii, 3) * t2_4(3, kk)),
24  "T2(i,j)*T2(j,k)(" + std::to_string(ii) + "," + std::to_string(kk)
25  + ")");
26  }
27 }

◆ test_T2_27()

void test_T2_27 ( const Tensor2< double, 4, 3 > &  t2_4,
const Tensor2< double, 3, 4 > &  t2_5 
)

Definition at line 7 of file test_T2_27.cpp.

9 {
13 
15  t2_a(j, i) = t2_4(i, j);
16 
18  t2(j, k) = t2_a(j, i) * t2_5(k, i);
19 
20  for(int jj = 0; jj < 3; ++jj)
21  for(int kk = 0; kk < 3; ++kk)
22  {
24  t2(jj, kk)
25  - (t2_a(jj, 0) * t2_5(kk, 0) + t2_a(jj, 1) * t2_5(kk, 1)
26  + t2_a(jj, 2) * t2_5(kk, 2) + t2_a(jj, 3) * t2_5(kk, 3)),
27  "T2(i,j)*T2(k,j)(" + std::to_string(jj) + "," + std::to_string(kk)
28  + ")");
29  }
30 }

◆ test_T2_28()

void test_T2_28 ( const Tensor2< double, 4, 3 > &  t2_4,
const Tensor2< double, 3, 4 > &  t2_5 
)

Definition at line 7 of file test_T2_28.cpp.

9 {
13 
15  t2_a(i, j) = t2_5(j, i);
16 
18  t2(j, k) = t2_4(i, j) * t2_a(i, k);
19 
20  for(int jj = 0; jj < 3; ++jj)
21  for(int kk = 0; kk < 3; ++kk)
22  {
24  t2(jj, kk)
25  - (t2_4(0, jj) * t2_a(0, kk) + t2_4(1, jj) * t2_a(1, kk)
26  + t2_4(2, jj) * t2_a(2, kk) + t2_4(3, jj) * t2_a(3, kk)),
27  "T2(i,j)*T2(i,k)(" + std::to_string(jj) + "," + std::to_string(kk)
28  + ")");
29  }
30 }

◆ test_T2_29()

void test_T2_29 ( const Tensor2< double, 4, 3 > &  t2_4,
const Tensor2< double, 3, 4 > &  t2_5 
)

Definition at line 7 of file test_T2_29.cpp.

9 {
13 
14  /* Tensor2 tests */
15 
16  /* Tensor2*Tensor2 */
18 
19  t2(j, k) = t2_4(i, j) * t2_5(k, i);
20  test_for_zero(t2(0, 0)
21  - (t2_4(0, 0) * t2_5(0, 0) + t2_4(1, 0) * t2_5(0, 1)
22  + t2_4(2, 0) * t2_5(0, 2) + t2_4(3, 0) * t2_5(0, 3)),
23  "T2(i,j)*T2(k,i)(0,0)");
24  test_for_zero(t2(0, 1)
25  - (t2_4(0, 0) * t2_5(1, 0) + t2_4(1, 0) * t2_5(1, 1)
26  + t2_4(2, 0) * t2_5(1, 2) + t2_4(3, 0) * t2_5(1, 3)),
27  "T2(i,j)*T2(k,i)(0,1)");
28  test_for_zero(t2(0, 2)
29  - (t2_4(0, 0) * t2_5(2, 0) + t2_4(1, 0) * t2_5(2, 1)
30  + t2_4(2, 0) * t2_5(2, 2) + t2_4(3, 0) * t2_5(2, 3)),
31  "T2(i,j)*T2(k,i)(0,2)");
32  test_for_zero(t2(1, 0)
33  - (t2_4(0, 1) * t2_5(0, 0) + t2_4(1, 1) * t2_5(0, 1)
34  + t2_4(2, 1) * t2_5(0, 2) + t2_4(3, 1) * t2_5(0, 3)),
35  "T2(i,j)*T2(k,i)(1,0)");
36  test_for_zero(t2(1, 1)
37  - (t2_4(0, 1) * t2_5(1, 0) + t2_4(1, 1) * t2_5(1, 1)
38  + t2_4(2, 1) * t2_5(1, 2) + t2_4(3, 1) * t2_5(1, 3)),
39  "T2(i,j)*T2(k,i)(1,1)");
40  test_for_zero(t2(1, 2)
41  - (t2_4(0, 1) * t2_5(2, 0) + t2_4(1, 1) * t2_5(2, 1)
42  + t2_4(2, 1) * t2_5(2, 2) + t2_4(3, 1) * t2_5(2, 3)),
43  "T2(i,j)*T2(k,i)(1,2)");
44  test_for_zero(t2(2, 0)
45  - (t2_4(0, 2) * t2_5(0, 0) + t2_4(1, 2) * t2_5(0, 1)
46  + t2_4(2, 2) * t2_5(0, 2) + t2_4(3, 2) * t2_5(0, 3)),
47  "T2(i,j)*T2(k,i)(2,0)");
48  test_for_zero(t2(2, 1)
49  - (t2_4(0, 2) * t2_5(1, 0) + t2_4(1, 2) * t2_5(1, 1)
50  + t2_4(2, 2) * t2_5(1, 2) + t2_4(3, 2) * t2_5(1, 3)),
51  "T2(i,j)*T2(k,i)(2,1)");
52  test_for_zero(t2(2, 2)
53  - (t2_4(0, 2) * t2_5(2, 0) + t2_4(1, 2) * t2_5(2, 1)
54  + t2_4(2, 2) * t2_5(2, 2) + t2_4(3, 2) * t2_5(2, 3)),
55  "T2(i,j)*T2(k,i)(2,2)");
56 }

◆ test_T2_30()

void test_T2_30 ( const Tensor1< double, 3 > &  t1_2,
const Tensor2< double, 3, 3 > &  t2_2 
)

Definition at line 7 of file test_T2_30.cpp.

9 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
18 
19  /* Tensor2&Tensor1 */
21 
22  t2(i, j) = (t2_2(i, j) & t1_2(j));
23  test_for_zero(t2(0, 0) - (t2_2(0, 0) * t1_2(0)), "T2(i,j)&T2(j)(0,0)");
24  test_for_zero(t2(0, 1) - (t2_2(0, 1) * t1_2(1)), "T2(i,j)&T2(j)(0,1)");
25  test_for_zero(t2(0, 2) - (t2_2(0, 2) * t1_2(2)), "T2(i,j)&T2(j)(0,2)");
26  test_for_zero(t2(1, 0) - (t2_2(1, 0) * t1_2(0)), "T2(i,j)&T2(j)(1,0)");
27  test_for_zero(t2(1, 1) - (t2_2(1, 1) * t1_2(1)), "T2(i,j)&T2(j)(1,1)");
28  test_for_zero(t2(1, 2) - (t2_2(1, 2) * t1_2(2)), "T2(i,j)&T2(j)(1,2)");
29  test_for_zero(t2(2, 0) - (t2_2(2, 0) * t1_2(0)), "T2(i,j)&T2(j)(2,0)");
30  test_for_zero(t2(2, 1) - (t2_2(2, 1) * t1_2(1)), "T2(i,j)&T2(j)(2,1)");
31  test_for_zero(t2(2, 2) - (t2_2(2, 2) * t1_2(2)), "T2(i,j)&T2(j)(2,2)");
32 
33  t2(i, j) = (t1_2(j) & t2_2(i, j));
34  test_for_zero(t2(0, 0) - (t2_2(0, 0) * t1_2(0)), "T2(j)&T2(i,j)(0,0)");
35  test_for_zero(t2(0, 1) - (t2_2(0, 1) * t1_2(1)), "T2(j)&T2(i,j)(0,1)");
36  test_for_zero(t2(0, 2) - (t2_2(0, 2) * t1_2(2)), "T2(j)&T2(i,j)(0,2)");
37  test_for_zero(t2(1, 0) - (t2_2(1, 0) * t1_2(0)), "T2(j)&T2(i,j)(1,0)");
38  test_for_zero(t2(1, 1) - (t2_2(1, 1) * t1_2(1)), "T2(j)&T2(i,j)(1,1)");
39  test_for_zero(t2(1, 2) - (t2_2(1, 2) * t1_2(2)), "T2(j)&T2(i,j)(1,2)");
40  test_for_zero(t2(2, 0) - (t2_2(2, 0) * t1_2(0)), "T2(j)&T2(i,j)(2,0)");
41  test_for_zero(t2(2, 1) - (t2_2(2, 1) * t1_2(1)), "T2(j)&T2(i,j)(2,1)");
42  test_for_zero(t2(2, 2) - (t2_2(2, 2) * t1_2(2)), "T2(j)&T2(i,j)(2,2)");
43 }

◆ test_T2_31()

void test_T2_31 ( const Tensor1< double, 3 > &  t1_2,
const Tensor2< double, 3, 3 > &  t2_2 
)

Definition at line 7 of file test_T2_31.cpp.

9 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
18 
19  /* Tensor2&Tensor1 */
21 
22  t2(i, j) = (t2_2(i, j) & t1_2(i));
23  test_for_zero(t2(0, 0) - (t2_2(0, 0) * t1_2(0)), "T2(i,j)&T2(i)(0,0)");
24  test_for_zero(t2(0, 1) - (t2_2(0, 1) * t1_2(0)), "T2(i,j)&T2(i)(0,1)");
25  test_for_zero(t2(0, 2) - (t2_2(0, 2) * t1_2(0)), "T2(i,j)&T2(i)(0,2)");
26  test_for_zero(t2(1, 0) - (t2_2(1, 0) * t1_2(1)), "T2(i,j)&T2(i)(1,0)");
27  test_for_zero(t2(1, 1) - (t2_2(1, 1) * t1_2(1)), "T2(i,j)&T2(i)(1,1)");
28  test_for_zero(t2(1, 2) - (t2_2(1, 2) * t1_2(1)), "T2(i,j)&T2(i)(1,2)");
29  test_for_zero(t2(2, 0) - (t2_2(2, 0) * t1_2(2)), "T2(i,j)&T2(i)(2,0)");
30  test_for_zero(t2(2, 1) - (t2_2(2, 1) * t1_2(2)), "T2(i,j)&T2(i)(2,1)");
31  test_for_zero(t2(2, 2) - (t2_2(2, 2) * t1_2(2)), "T2(i,j)&T2(i)(2,2)");
32 
33  t2(i, j) = (t1_2(i) & t2_2(i, j));
34  test_for_zero(t2(0, 0) - (t2_2(0, 0) * t1_2(0)), "T2(i)&T2(i,j)(0,0)");
35  test_for_zero(t2(0, 1) - (t2_2(0, 1) * t1_2(0)), "T2(i)&T2(i,j)(0,1)");
36  test_for_zero(t2(0, 2) - (t2_2(0, 2) * t1_2(0)), "T2(i)&T2(i,j)(0,2)");
37  test_for_zero(t2(1, 0) - (t2_2(1, 0) * t1_2(1)), "T2(i)&T2(i,j)(1,0)");
38  test_for_zero(t2(1, 1) - (t2_2(1, 1) * t1_2(1)), "T2(i)&T2(i,j)(1,1)");
39  test_for_zero(t2(1, 2) - (t2_2(1, 2) * t1_2(1)), "T2(i)&T2(i,j)(1,2)");
40  test_for_zero(t2(2, 0) - (t2_2(2, 0) * t1_2(2)), "T2(i)&T2(i,j)(2,0)");
41  test_for_zero(t2(2, 1) - (t2_2(2, 1) * t1_2(2)), "T2(i)&T2(i,j)(2,1)");
42  test_for_zero(t2(2, 2) - (t2_2(2, 2) * t1_2(2)), "T2(i)&T2(i,j)(2,2)");
43 }

◆ test_T2_32()

void test_T2_32 ( const Tensor2< double, 3, 3 > &  t2_2)

Definition at line 7 of file test_T2_32.cpp.

8 {
11 
12  Number<0> N0;
13  Number<1> N1;
14  Number<2> N2;
15 
16  /* Tensor2 tests */
17 
18  /* Tensor2*T or /T */
20 
21  t2(i, j) = t2_2(i, j) * 10;
22  test_for_zero(t2(0, 0) - (t2_2(0, 0) * 10), "T2(i,j)*T(0,0)");
23  test_for_zero(t2(0, 1) - (t2_2(0, 1) * 10), "T2(i,j)*T(0,1)");
24  test_for_zero(t2(0, 2) - (t2_2(0, 2) * 10), "T2(i,j)*T(0,2)");
25  test_for_zero(t2(1, 0) - (t2_2(1, 0) * 10), "T2(i,j)*T(1,0)");
26  test_for_zero(t2(1, 1) - (t2_2(1, 1) * 10), "T2(i,j)*T(1,1)");
27  test_for_zero(t2(1, 2) - (t2_2(1, 2) * 10), "T2(i,j)*T(1,2)");
28  test_for_zero(t2(2, 0) - (t2_2(2, 0) * 10), "T2(i,j)*T(2,0)");
29  test_for_zero(t2(2, 1) - (t2_2(2, 1) * 10), "T2(i,j)*T(2,1)");
30  test_for_zero(t2(2, 2) - (t2_2(2, 2) * 10), "T2(i,j)*T(2,2)");
31 
32  t2(i, j) = 10 * t2_2(i, j);
33  test_for_zero(t2(0, 0) - (t2_2(0, 0) * 10), "T*T2(i,j)(0,0)");
34  test_for_zero(t2(0, 1) - (t2_2(0, 1) * 10), "T*T2(i,j)(0,1)");
35  test_for_zero(t2(0, 2) - (t2_2(0, 2) * 10), "T*T2(i,j)(0,2)");
36  test_for_zero(t2(1, 0) - (t2_2(1, 0) * 10), "T*T2(i,j)(1,0)");
37  test_for_zero(t2(1, 1) - (t2_2(1, 1) * 10), "T*T2(i,j)(1,1)");
38  test_for_zero(t2(1, 2) - (t2_2(1, 2) * 10), "T*T2(i,j)(1,2)");
39  test_for_zero(t2(2, 0) - (t2_2(2, 0) * 10), "T*T2(i,j)(2,0)");
40  test_for_zero(t2(2, 1) - (t2_2(2, 1) * 10), "T*T2(i,j)(2,1)");
41  test_for_zero(t2(2, 2) - (t2_2(2, 2) * 10), "T*T2(i,j)(2,2)");
42 
43  t2(i, j) = t2_2(i, j) / 10;
44  test_for_zero(t2(0, 0) - (t2_2(0, 0) / 10), "T2(i,j)/T(0,0)");
45  test_for_zero(t2(0, 1) - (t2_2(0, 1) / 10), "T2(i,j)/T(0,1)");
46  test_for_zero(t2(0, 2) - (t2_2(0, 2) / 10), "T2(i,j)/T(0,2)");
47  test_for_zero(t2(1, 0) - (t2_2(1, 0) / 10), "T2(i,j)/T(1,0)");
48  test_for_zero(t2(1, 1) - (t2_2(1, 1) / 10), "T2(i,j)/T(1,1)");
49  test_for_zero(t2(1, 2) - (t2_2(1, 2) / 10), "T2(i,j)/T(1,2)");
50  test_for_zero(t2(2, 0) - (t2_2(2, 0) / 10), "T2(i,j)/T(2,0)");
51  test_for_zero(t2(2, 1) - (t2_2(2, 1) / 10), "T2(i,j)/T(2,1)");
52  test_for_zero(t2(2, 2) - (t2_2(2, 2) / 10), "T2(i,j)/T(2,2)");
53 }

◆ test_T2_33()

void test_T2_33 ( const Tensor2< double, 3, 3 > &  t2_2)

Definition at line 7 of file test_T2_33.cpp.

8 {
11 
12  Number<0> N0;
13  Number<1> N1;
14  Number<2> N2;
15 
16  /* Tensor2 tests */
17 
18  /* -Tensor2 */
20 
21  t2(i, j) = -t2_2(i, j);
22  test_for_zero(t2(0, 0) + (t2_2(0, 0)), "-T2(i,j)(0,0)");
23  test_for_zero(t2(0, 1) + (t2_2(0, 1)), "-T2(i,j)(0,1)");
24  test_for_zero(t2(0, 2) + (t2_2(0, 2)), "-T2(i,j)(0,2)");
25  test_for_zero(t2(1, 0) + (t2_2(1, 0)), "-T2(i,j)(1,0)");
26  test_for_zero(t2(1, 1) + (t2_2(1, 1)), "-T2(i,j)(1,1)");
27  test_for_zero(t2(1, 2) + (t2_2(1, 2)), "-T2(i,j)(1,2)");
28  test_for_zero(t2(2, 0) + (t2_2(2, 0)), "-T2(i,j)(2,0)");
29  test_for_zero(t2(2, 1) + (t2_2(2, 1)), "-T2(i,j)(2,1)");
30  test_for_zero(t2(2, 2) + (t2_2(2, 2)), "-T2(i,j)(2,2)");
31 }

◆ test_T2_34()

void test_T2_34 ( const Tensor2< double, 3, 3 > &  t2_2)

Definition at line 7 of file test_T2_34.cpp.

8 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
20 
21  t2(i, j) = t2_2(i, j);
22  t2s(i, j) = t2(i, k) ^ t2_2(j, k);
23  test_for_zero(t2s(0, 0)
24  - (t2(0, 0) * t2_2(0, 0) + t2(0, 1) * t2_2(0, 1)
25  + t2(0, 2) * t2_2(0, 2)),
26  "T2(i,k)^T2(j,k)(0,0)");
27  test_for_zero(t2s(1, 0)
28  - (t2(1, 0) * t2_2(0, 0) + t2(1, 1) * t2_2(0, 1)
29  + t2(1, 2) * t2_2(0, 2)),
30  "T2(i,k)^T2(j,k)(1,0)");
31  test_for_zero(t2s(2, 0)
32  - (t2(2, 0) * t2_2(0, 0) + t2(2, 1) * t2_2(0, 1)
33  + t2(2, 2) * t2_2(0, 2)),
34  "T2(i,k)^T2(j,k)(2,0)");
35  test_for_zero(t2s(0, 1)
36  - (t2(0, 0) * t2_2(1, 0) + t2(0, 1) * t2_2(1, 1)
37  + t2(0, 2) * t2_2(1, 2)),
38  "T2(i,k)^T2(j,k)(0,1)");
39  test_for_zero(t2s(1, 1)
40  - (t2(1, 0) * t2_2(1, 0) + t2(1, 1) * t2_2(1, 1)
41  + t2(1, 2) * t2_2(1, 2)),
42  "T2(i,k)^T2(j,k)(1,1)");
43  test_for_zero(t2s(2, 1)
44  - (t2(2, 0) * t2_2(1, 0) + t2(2, 1) * t2_2(1, 1)
45  + t2(2, 2) * t2_2(1, 2)),
46  "T2(i,k)^T2(j,k)(2,1)");
47  test_for_zero(t2s(0, 2)
48  - (t2(0, 0) * t2_2(2, 0) + t2(0, 1) * t2_2(2, 1)
49  + t2(0, 2) * t2_2(2, 2)),
50  "T2(i,k)^T2(j,k)(0,2)");
51  test_for_zero(t2s(1, 2)
52  - (t2(1, 0) * t2_2(2, 0) + t2(1, 1) * t2_2(2, 1)
53  + t2(1, 2) * t2_2(2, 2)),
54  "T2(i,k)^T2(j,k)(1,2)");
55  test_for_zero(t2s(2, 2)
56  - (t2(2, 0) * t2_2(2, 0) + t2(2, 1) * t2_2(2, 1)
57  + t2(2, 2) * t2_2(2, 2)),
58  "T2(i,k)^T2(j,k)(2,2)");
59 }

◆ test_T2_35()

void test_T2_35 ( const Tensor2< double, 3, 3 > &  t2_2)

Definition at line 7 of file test_T2_35.cpp.

8 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
20 
21  t2(i, j) = t2_2(i, j);
22 
23  t2s(i, j) = t2(k, i) ^ t2_2(k, j);
24  test_for_zero(t2s(0, 0)
25  - (t2(0, 0) * t2_2(0, 0) + t2(1, 0) * t2_2(1, 0)
26  + t2(2, 0) * t2_2(2, 0)),
27  "T2(k,i)^T2(k,j)(0,0)");
28  test_for_zero(t2s(1, 0)
29  - (t2(0, 1) * t2_2(0, 0) + t2(1, 1) * t2_2(1, 0)
30  + t2(2, 1) * t2_2(2, 0)),
31  "T2(k,i)^T2(k,j)(1,0)");
32  test_for_zero(t2s(2, 0)
33  - (t2(0, 2) * t2_2(0, 0) + t2(1, 2) * t2_2(1, 0)
34  + t2(2, 2) * t2_2(2, 0)),
35  "T2(k,i)^T2(k,j)(2,0)");
36  test_for_zero(t2s(0, 1)
37  - (t2(0, 0) * t2_2(0, 1) + t2(1, 0) * t2_2(1, 1)
38  + t2(2, 0) * t2_2(2, 1)),
39  "T2(k,i)^T2(k,j)(0,1)");
40  test_for_zero(t2s(1, 1)
41  - (t2(0, 1) * t2_2(0, 1) + t2(1, 1) * t2_2(1, 1)
42  + t2(2, 1) * t2_2(2, 1)),
43  "T2(k,i)^T2(k,j)(1,1)");
44  test_for_zero(t2s(2, 1)
45  - (t2(0, 2) * t2_2(0, 1) + t2(1, 2) * t2_2(1, 1)
46  + t2(2, 2) * t2_2(2, 1)),
47  "T2(k,i)^T2(k,j)(2,1)");
48  test_for_zero(t2s(0, 2)
49  - (t2(0, 0) * t2_2(0, 2) + t2(1, 0) * t2_2(1, 2)
50  + t2(2, 0) * t2_2(2, 2)),
51  "T2(k,i)^T2(k,j)(0,2)");
52  test_for_zero(t2s(1, 2)
53  - (t2(0, 1) * t2_2(0, 2) + t2(1, 1) * t2_2(1, 2)
54  + t2(2, 1) * t2_2(2, 2)),
55  "T2(k,i)^T2(k,j)(1,2)");
56  test_for_zero(t2s(2, 2)
57  - (t2(0, 2) * t2_2(0, 2) + t2(1, 2) * t2_2(1, 2)
58  + t2(2, 2) * t2_2(2, 2)),
59  "T2(k,i)^T2(k,j)(2,2)");
60 }

◆ test_T2_36()

void test_T2_36 ( const Tensor2< double, 3, 3 > &  t2_2)

Definition at line 7 of file test_T2_36.cpp.

8 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
20 
21  t2(i, j) = t2_2(j, i);
22  t2s(i, j) = t2(k, i) ^ t2_2(j, k);
23  test_for_zero(t2s(0, 0)
24  - (t2(0, 0) * t2_2(0, 0) + t2(1, 0) * t2_2(0, 1)
25  + t2(2, 0) * t2_2(0, 2)),
26  "T2(k,i)^T2(j,k)(0,0)");
27  test_for_zero(t2s(1, 0)
28  - (t2(0, 1) * t2_2(0, 0) + t2(1, 1) * t2_2(0, 1)
29  + t2(2, 1) * t2_2(0, 2)),
30  "T2(k,i)^T2(j,k)(1,0)");
31  test_for_zero(t2s(2, 0)
32  - (t2(0, 2) * t2_2(0, 0) + t2(1, 2) * t2_2(0, 1)
33  + t2(2, 2) * t2_2(0, 2)),
34  "T2(k,i)^T2(j,k)(2,0)");
35  test_for_zero(t2s(0, 1)
36  - (t2(0, 0) * t2_2(1, 0) + t2(1, 0) * t2_2(1, 1)
37  + t2(2, 0) * t2_2(1, 2)),
38  "T2(k,i)^T2(j,k)(0,1)");
39  test_for_zero(t2s(1, 1)
40  - (t2(0, 1) * t2_2(1, 0) + t2(1, 1) * t2_2(1, 1)
41  + t2(2, 1) * t2_2(1, 2)),
42  "T2(k,i)^T2(j,k)(1,1)");
43  test_for_zero(t2s(2, 1)
44  - (t2(0, 2) * t2_2(1, 0) + t2(1, 2) * t2_2(1, 1)
45  + t2(2, 2) * t2_2(1, 2)),
46  "T2(k,i)^T2(j,k)(2,1)");
47  test_for_zero(t2s(0, 2)
48  - (t2(0, 0) * t2_2(2, 0) + t2(1, 0) * t2_2(2, 1)
49  + t2(2, 0) * t2_2(2, 2)),
50  "T2(k,i)^T2(j,k)(0,2)");
51  test_for_zero(t2s(1, 2)
52  - (t2(0, 1) * t2_2(2, 0) + t2(1, 1) * t2_2(2, 1)
53  + t2(2, 1) * t2_2(2, 2)),
54  "T2(k,i)^T2(j,k)(1,2)");
55  test_for_zero(t2s(2, 2)
56  - (t2(0, 2) * t2_2(2, 0) + t2(1, 2) * t2_2(2, 1)
57  + t2(2, 2) * t2_2(2, 2)),
58  "T2(k,i)^T2(j,k)(2,2)");
59 }

◆ test_T2_37()

void test_T2_37 ( const Tensor2< double, 3, 3 > &  t2_2)

Definition at line 7 of file test_T2_37.cpp.

8 {
12 
13  Number<0> N0;
14  Number<1> N1;
15  Number<2> N2;
16 
17  /* Tensor2 tests */
20 
21  t2(i, j) = t2_2(j, i);
22 
23  t2s(i, j) = t2(i, k) ^ t2_2(k, j);
24  test_for_zero(t2s(0, 0)
25  - (t2(0, 0) * t2_2(0, 0) + t2(0, 1) * t2_2(1, 0)
26  + t2(0, 2) * t2_2(2, 0)),
27  "T2(i,k)^T2(k,j)(0,0)");
28  test_for_zero(t2s(1, 0)
29  - (t2(1, 0) * t2_2(0, 0) + t2(1, 1) * t2_2(1, 0)
30  + t2(1, 2) * t2_2(2, 0)),
31  "T2(i,k)^T2(k,j)(1,0)");
32  test_for_zero(t2s(2, 0)
33  - (t2(2, 0) * t2_2(0, 0) + t2(2, 1) * t2_2(1, 0)
34  + t2(2, 2) * t2_2(2, 0)),
35  "T2(i,k)^T2(k,j)(2,0)");
36  test_for_zero(t2s(0, 1)
37  - (t2(0, 0) * t2_2(0, 1) + t2(0, 1) * t2_2(1, 1)
38  + t2(0, 2) * t2_2(2, 1)),
39  "T2(i,k)^T2(k,j)(0,1)");
40  test_for_zero(t2s(1, 1)
41  - (t2(1, 0) * t2_2(0, 1) + t2(1, 1) * t2_2(1, 1)
42  + t2(1, 2) * t2_2(2, 1)),
43  "T2(i,k)^T2(k,j)(1,1)");
44  test_for_zero(t2s(2, 1)
45  - (t2(2, 0) * t2_2(0, 1) + t2(2, 1) * t2_2(1, 1)
46  + t2(2, 2) * t2_2(2, 1)),
47  "T2(i,k)^T2(k,j)(2,1)");
48  test_for_zero(t2s(0, 2)
49  - (t2(0, 0) * t2_2(0, 2) + t2(0, 1) * t2_2(1, 2)
50  + t2(0, 2) * t2_2(2, 2)),
51  "T2(i,k)^T2(k,j)(0,2)");
52  test_for_zero(t2s(1, 2)
53  - (t2(1, 0) * t2_2(0, 2) + t2(1, 1) * t2_2(1, 2)
54  + t2(1, 2) * t2_2(2, 2)),
55  "T2(i,k)^T2(k,j)(1,2)");
56  test_for_zero(t2s(2, 2)
57  - (t2(2, 0) * t2_2(0, 2) + t2(2, 1) * t2_2(1, 2)
58  + t2(2, 2) * t2_2(2, 2)),
59  "T2(i,k)^T2(k,j)(2,2)");
60 }

◆ test_T2_38()

void test_T2_38 ( )

Definition at line 7 of file test_T2_38.cpp.

8 {
9  Number<0> N0;
10  Number<1> N1;
11  Number<2> N2;
12 
13  /* Tensor2 tests */
14 
15  /* Checking whether functors work */
16 
17  Tensor2<complex<double>, 2, 2> t1(
18  complex<double>(1, 2), complex<double>(3, 4), complex<double>(5, 6),
19  complex<double>(7, 8));
20 
22  Index<'b', 2> b;
23 
24  /* I have this function pointer defined here because I can't seem to
25  make the compiler understand what kind of function I have.
26  Unless I do casts, which are ugly. It seems to have something to
27  do with conj being a templated function. */
28 
29  complex<double> (*cj)(const complex<double> &);
30  cj = &(conj<double>);
31 
33  conj(t1(0, 0))
34  - transform(t1(a, b),
35  static_cast<complex<double> (*)(const complex<double> &)>(
36  &(conj<double>)))(0, 0),
37  "transform(T2)(0,0) cast");
39  conj(t1(0, 1))
40  - transform(t1(a, b),
41  static_cast<complex<double> (*)(const complex<double> &)>(
42  &(conj<double>)))(0, 1),
43  "transform(T2)(0,1) cast");
45  conj(t1(1, 0))
46  - transform(t1(a, b),
47  static_cast<complex<double> (*)(const complex<double> &)>(
48  &(conj<double>)))(1, 0),
49  "transform(T2)(1,0) cast");
51  conj(t1(1, 1))
52  - transform(t1(a, b),
53  static_cast<complex<double> (*)(const complex<double> &)>(
54  &(conj<double>)))(1, 1),
55  "transform(T2)(1,1) cast");
56  test_for_zero(conj(t1(0, 0)) - transform(t1(a, b), cj)(0, 0),
57  "transform(T2)(0,0)");
58  test_for_zero(conj(t1(0, 1)) - transform(t1(a, b), cj)(0, 1),
59  "transform(T2)(0,1)");
60  test_for_zero(conj(t1(1, 0)) - transform(t1(a, b), cj)(1, 0),
61  "transform(T2)(1,0)");
62  test_for_zero(conj(t1(1, 1)) - transform(t1(a, b), cj)(1, 1),
63  "transform(T2)(1,1)");
64 
65  /* Check plain old conj */
66 
67  test_for_zero(conj(t1(0, 0)) - conj(t1(a, b))(0, 0), "conj(T2)(0,0)");
68  test_for_zero(conj(t1(0, 1)) - conj(t1(a, b))(0, 1), "conj(T2)(0,1)");
69  test_for_zero(conj(t1(1, 0)) - conj(t1(a, b))(1, 0), "conj(T2)(1,0)");
70  test_for_zero(conj(t1(1, 1)) - conj(t1(a, b))(1, 1), "conj(T2)(1,1)");
71 }

◆ test_T2_iostream()

void test_T2_iostream ( )

Definition at line 7 of file test_T2_iostream.cpp.

8 {
10  Tensor2<double, 3, 3>(3., 7., 11., 13., 17., 23., 27., 31., 37.),
11  "[[3,7,11],[13,17,23],[27,31,37]]", "operator<<(T2<3,3>)");
12  test_ostream(Tensor2<double, 1, 2>(13., 17.), "[[13,17]]",
13  "operator<<(T2<1,2>)");
14  test_ostream(Tensor2<double, 2, 1>(13., 17.), "[[13],[17]]",
15  "operator<<(T2<2,1>)");
16 
18  std::stringstream ss("[[3,7,11],[13,17,23],[27,31,37]]");
19  ss >> t2_1;
20  test_for_zero(t2_1(0, 0) - 3, "operator>>(T2)(0,0)");
21  test_for_zero(t2_1(0, 1) - 7, "operator>>(T2)(0,1)");
22  test_for_zero(t2_1(0, 2) - 11, "operator>>(T2)(0,2)");
23  test_for_zero(t2_1(1, 0) - 13, "operator>>(T2)(1,0)");
24  test_for_zero(t2_1(1, 1) - 17, "operator>>(T2)(1,1)");
25  test_for_zero(t2_1(1, 2) - 23, "operator>>(T2)(1,2)");
26  test_for_zero(t2_1(2, 0) - 27, "operator>>(T2)(2,0)");
27  test_for_zero(t2_1(2, 1) - 31, "operator>>(T2)(2,1)");
28  test_for_zero(t2_1(2, 2) - 37, "operator>>(T2)(2,2)");
29 }
FTensor::Tensor1< double, 3 >
test_T2_24
void test_T2_24(const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_24.cpp:7
test_T2_16
void test_T2_16(const Tensor1< double, 3 > &t1_1, const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_16.cpp:7
test_T2_03
void test_T2_03()
Definition: test_T2_03.cpp:7
test_T2_20
void test_T2_20(const Tensor2< double, 3, 3 > &t2_1, const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_20.cpp:7
test_T2_04
void test_T2_04(const Tensor2< double, 3, 3 > &t2_1)
Definition: test_T2_04.cpp:7
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
test_T2_06
void test_T2_06(const Tensor2< double, 3, 3 > &t2_1)
Definition: test_T2_06.cpp:7
test_ostream
void test_ostream(const T &t, const std::string &expected, const std::string &test_name)
Definition: test_ostream.hpp:7
FTensor::Tensor2< double, 3, 3 >
test_T2_23
void test_T2_23(const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_23.cpp:7
test_T2_21
void test_T2_21(const Tensor2< double, 3, 3 > &t2_1, const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_21.cpp:7
FTensor::Number< 0 >
test_T2_19
void test_T2_19(const Tensor1< double, 3 > &t1_1, const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_19.cpp:7
test_T2_01
void test_T2_01(const Tensor1< double, 3 > &t1_1, const Tensor1< double, 3 > &t1_2)
Definition: test_T2_01.cpp:7
a
constexpr double a
Definition: approx_sphere.cpp:30
test_T2_31
void test_T2_31(const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_31.cpp:7
test_T2_32
void test_T2_32(const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_32.cpp:7
test_T2_38
void test_T2_38()
Definition: test_T2_38.cpp:7
test_T2_05
void test_T2_05(const Tensor2< double, 3, 3 > &t2_1)
Definition: test_T2_05.cpp:7
test_for_zero
void test_for_zero(const T &t, const std::string &s)
Definition: test_for_zero.hpp:7
test_T2_22
void test_T2_22(const Tensor2< double, 3, 3 > &t2_1)
Definition: test_T2_22.cpp:7
test_T2_07
void test_T2_07(const Tensor2< double, 3, 3 > &t2_1)
Definition: test_T2_07.cpp:7
test_T2_08
void test_T2_08(const Tensor1< double, 3 > &t1_2)
Definition: test_T2_08.cpp:7
test_T2_17
void test_T2_17(const Tensor2< double, 3, 3 > &t2_1, const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_17.cpp:7
FTensor::conj
Tensor2_Expr< conj_Tensor2< A, T, Dim0, Dim1, i, j >, T, Dim0, Dim1, i, j > conj(const Tensor2_Expr< A, T, Dim0, Dim1, i, j > &a)
Definition: conj_Tensor2.hpp:23
test_T2_02
void test_T2_02(const Tensor1< double, 3 > &t1_1)
Definition: test_T2_02.cpp:7
test_T2_35
void test_T2_35(const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_35.cpp:7
test_T2_27
void test_T2_27(const Tensor2< double, 4, 3 > &t2_4, const Tensor2< double, 3, 4 > &t2_5)
Definition: test_T2_27.cpp:7
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', 3 >
test_T2_26
void test_T2_26(const Tensor2< double, 4, 3 > &t2_4, const Tensor2< double, 3, 4 > &t2_5)
Definition: test_T2_26.cpp:7
test_T2_34
void test_T2_34(const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_34.cpp:7
test_T2_iostream
void test_T2_iostream()
Definition: test_T2_iostream.cpp:7
test_T2_33
void test_T2_33(const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_33.cpp:7
test_T2_14
void test_T2_14(const Tensor1< double, 3 > &t1_1, const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_14.cpp:7
test_T2_10
void test_T2_10(const Tensor2< double, 3, 3 > &t2_1)
Definition: test_T2_10.cpp:7
test_T2_15
void test_T2_15(const Tensor1< double, 3 > &t1_1, const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_15.cpp:7
test_T2_29
void test_T2_29(const Tensor2< double, 4, 3 > &t2_4, const Tensor2< double, 3, 4 > &t2_5)
Definition: test_T2_29.cpp:7
test_T2_30
void test_T2_30(const Tensor1< double, 3 > &t1_2, const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_30.cpp:7
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
test_T2_25
void test_T2_25(const Tensor2< double, 4, 3 > &t2_4, const Tensor2< double, 3, 4 > &t2_5)
Definition: test_T2_25.cpp:7
test_T2_18
void test_T2_18(const Tensor2< double, 3, 3 > &t2_1, const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_18.cpp:7
FTensor::transform
Tensor2_Expr< transform_Tensor2< A, B, T, Dim0, Dim1, i, j >, T, Dim0, Dim1, i, j > transform(const Tensor2_Expr< A, T, Dim0, Dim1, i, j > &a, B function)
Definition: Tensor2_transform.hpp:27
test_T2_28
void test_T2_28(const Tensor2< double, 4, 3 > &t2_4, const Tensor2< double, 3, 4 > &t2_5)
Definition: test_T2_28.cpp:7
test_T2_36
void test_T2_36(const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_36.cpp:7
test_T2_09
void test_T2_09()
Definition: test_T2_09.cpp:7
test_T2_11
void test_T2_11(const Tensor2< double, 3, 3 > &t2_1)
Definition: test_T2_11.cpp:7
test_T2_12
void test_T2_12(const Tensor2< double, 3, 3 > &t2_1)
Definition: test_T2_12.cpp:7
test_T2_37
void test_T2_37(const Tensor2< double, 3, 3 > &t2_2)
Definition: test_T2_37.cpp:7
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
test_T2_13
void test_T2_13(const Tensor2< double, 3, 3 > &t2_1)
Definition: test_T2_13.cpp:7