MCPcopy Create free account
hub / github.com/abess-team/abess / test_0d

Function test_0d

python/include/unsupported/test/cxx11_tensor_map.cpp:17–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15using Eigen::RowMajor;
16
17static void test_0d()
18{
19 Tensor<int, 0> scalar1;
20 Tensor<int, 0, RowMajor> scalar2;
21
22 TensorMap<Tensor<const int, 0> > scalar3(scalar1.data());
23 TensorMap<Tensor<const int, 0, RowMajor> > scalar4(scalar2.data());
24
25 scalar1() = 7;
26 scalar2() = 13;
27
28 VERIFY_IS_EQUAL(scalar1.rank(), 0);
29 VERIFY_IS_EQUAL(scalar1.size(), 1);
30
31 VERIFY_IS_EQUAL(scalar3(), 7);
32 VERIFY_IS_EQUAL(scalar4(), 13);
33}
34
35static void test_1d()
36{

Callers 1

test_cxx11_tensor_mapFunction · 0.70

Calls 3

dataMethod · 0.45
rankMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected