v0.14.0
test_T2as.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;
7 void test_T2as()
8 {
9  test_ostream(Tensor2_antisymmetric<double, 3>(3., 7., 11.), "[[3,7],[11]]",
10  "operator<<(T2as<3>)");
12  "operator<<(T2as<1>)");
13 
15  std::stringstream ss("[[3,7],[13]]");
16  ss >> t2as_1;
17  test_for_zero(t2as_1(0, 1) - 3, "operator>>(T2as)(0,1)");
18  test_for_zero(t2as_1(0, 2) - 7, "operator>>(T2as)(0,2)");
19  test_for_zero(t2as_1(1, 2) - 13, "operator>>(T2as)(1,2)");
20 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
test_ostream.hpp
test_T2as
void test_T2as()
Definition: test_T2as.cpp:7
test_ostream
void test_ostream(const T &t, const std::string &expected, const std::string &test_name)
Definition: test_ostream.hpp:7
test_for_zero
void test_for_zero(const T &t, const std::string &s)
Definition: test_for_zero.hpp:7
FTensor::Tensor2_antisymmetric
Definition: Tensor2_antisymmetric_value.hpp:9
test_for_zero.hpp
std
Definition: enable_if.hpp:5