v0.14.0
Functions
test_T2s_iostream.cpp File Reference
#include "../../../src/FTensor.hpp"
#include "../test_for_zero.hpp"
#include "../test_ostream.hpp"

Go to the source code of this file.

Functions

void test_T2s_iostream ()
 

Function Documentation

◆ test_T2s_iostream()

void test_T2s_iostream ( )

Definition at line 7 of file test_T2s_iostream.cpp.

8 {
9  test_ostream(Tensor2_symmetric<double, 3>(3., 7., 11., 13., 17., 23.),
10  "[[3,7,11],[13,17],[23]]", "operator<<(T2s<3>)");
12  "operator<<(T2s<1>)");
13 
15  std::stringstream ss("[[3,7,11],[13,17],[23]]");
16  ss >> t2s_1;
17  test_for_zero(t2s_1(0, 0) - 3, "operator>>(T2s)(0,0)");
18  test_for_zero(t2s_1(0, 1) - 7, "operator>>(T2s)(0,1)");
19  test_for_zero(t2s_1(0, 2) - 11, "operator>>(T2s)(0,2)");
20  test_for_zero(t2s_1(1, 1) - 13, "operator>>(T2s)(1,1)");
21  test_for_zero(t2s_1(1, 2) - 17, "operator>>(T2s)(1,2)");
22  test_for_zero(t2s_1(2, 2) - 23, "operator>>(T2s)(2,2)");
23 }
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
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