v0.14.0
test_T3_iostream.cpp
Go to the documentation of this file.
1 #include "../../../src/FTensor.hpp"
2 #include "../test_for_zero.hpp"
3 #include "../test_ostream.hpp"
4 
5 using namespace FTensor;
6 using namespace std;
8 {
9  test_ostream(Tensor3<double, 2, 2, 2>(3., 4., 7., 8., 11., 12., 13., 14.),
10  "[[[3,4],[7,8]],[[11,12],[13,14]]]", "operator<<(T3<3,3,2>)");
11 
13  std::stringstream ss("[[[3,4],[7,8]],[[11,12],[13,14]]]");
14  ss >> t3_1;
15  test_for_zero(t3_1(0, 0, 0) - 3, "operator>>(T3)(0,0,0)");
16  test_for_zero(t3_1(0, 0, 1) - 4, "operator>>(T3)(0,0,1)");
17  test_for_zero(t3_1(0, 1, 0) - 7, "operator>>(T3)(0,1,0)");
18  test_for_zero(t3_1(0, 1, 1) - 8, "operator>>(T3)(0,1,1)");
19  test_for_zero(t3_1(1, 0, 0) - 11, "operator>>(T3)(1,0,0)");
20  test_for_zero(t3_1(1, 0, 1) - 12, "operator>>(T3)(1,0,1)");
21  test_for_zero(t3_1(1, 1, 0) - 13, "operator>>(T3)(1,1,0)");
22  test_for_zero(t3_1(1, 1, 1) - 14, "operator>>(T3)(1,1,1)");
23 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
test_ostream
void test_ostream(const T &t, const std::string &expected, const std::string &test_name)
Definition: test_ostream.hpp:7
FTensor::Tensor3
Definition: Tensor3_value.hpp:12
test_for_zero
void test_for_zero(const T &t, const std::string &s)
Definition: test_for_zero.hpp:7
std
Definition: enable_if.hpp:5
test_T3_iostream
void test_T3_iostream()
Definition: test_T3_iostream.cpp:7