v0.14.0
test_T0.cpp
Go to the documentation of this file.
1 #include "../../src/FTensor.hpp"
2 #include "test_for_zero.hpp"
3 #include <iostream>
4 using namespace FTensor;
5 using namespace std;
6 
7 void test_T0(const int &T, Tensor0<double *> &t0_1,
8  const Tensor0<double *> &t0_2)
9 {
10  Number<0> N0;
11  Number<1> N1;
12  Number<2> N2;
13 
14  /* Tensor0 test cases. */
15 
16  t0_1 = T + t0_2;
17  test_for_zero(t0_1 - T - t0_2, "T+T0");
18  t0_1 += 10 + t0_2;
19  test_for_zero(t0_1 - (10 + T + 2 * t0_2), "T0+=T");
20  t0_1 -= 5 + 3 * t0_2;
21  test_for_zero(t0_1 - (5 + T - t0_2), "T0-=T");
22  t0_1 *= 2 + t0_2;
23  test_for_zero(t0_1 - (5 + T - t0_2) * (2 + t0_2), "T0*=T");
24  t0_1 /= 7.0 + t0_2;
25  test_for_zero(t0_1 - (5 + T - t0_2) * (2 + t0_2) / (7.0 + t0_2), "T0/=T");
26 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Number< 0 >
test_for_zero
void test_for_zero(const T &t, const std::string &s)
Definition: test_for_zero.hpp:7
test_for_zero.hpp
FTensor::Tensor0
Definition: Tensor0.hpp:16
std
Definition: enable_if.hpp:5
test_T0
void test_T0(const int &T, Tensor0< double * > &t0_1, const Tensor0< double * > &t0_2)
Definition: test_T0.cpp:7