v0.14.0
Loading...
Searching...
No Matches
src
ftensor
tests
conformance
T3
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
;
7
void
test_T3_iostream
()
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
12
Tensor3<double, 2, 2, 2>
t3_1;
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.hpp
Tensors class implemented by Walter Landry.
FTensor::Tensor3
Definition
Tensor3_value.hpp:13
FTensor
Tensors class implemented by Walter Landry.
Definition
FTensor.hpp:51
std
Definition
enable_if.hpp:6
test_T3_iostream
void test_T3_iostream()
Definition
test_T3_iostream.cpp:7
test_for_zero.hpp
test_for_zero
void test_for_zero(const T &t, const std::string &s)
Definition
test_for_zero.hpp:7
test_ostream.hpp
test_ostream
void test_ostream(const T &t, const std::string &expected, const std::string &test_name)
Definition
test_ostream.hpp:7
Generated by
Doxygen
1.12.0 and hosted at