48 const std::vector<std::string> compute = {
49 "mean",
"min",
"max",
"sum",
"stddev",
"stderr",
"ratio",
"norm2",
"median"};
52 const std::vector<Real>
x = {6, 1, 7, 3, 4, 5, 2};
53 const std::vector<Real> expect = {
54 4, 1, 7, 28, 2.1602468994692869408, 0.81649658092772603446, 7, 11.832159566199232259, 4};
56 auto result = calculate<std::vector<Real>,
Real>(
x, compute);
57 for (
unsigned int i = 0; i < expect.size(); ++i)
59 EXPECT_EQ(result.first[i], expect[i]);
60 EXPECT_EQ(result.second[i], expect[i]);
65 const std::vector<int>
x = {6, 1, 7, 3, 4, 5, 2};
66 const std::vector<Real> expect = {
67 4, 1, 7, 28, 2.1602468994692869408, 0.81649658092772603446, 7, 11.832159566199232259, 4};
69 auto result = calculate<std::vector<int>,
Real>(
x, compute);
70 for (
unsigned int i = 0; i < expect.size(); ++i)
72 EXPECT_EQ(result.first[i], expect[i]);
73 EXPECT_EQ(result.second[i], expect[i]);
78 const std::vector<std::vector<Real>>
x = {{6, 1, 7, 3, 4, 5, 2},
79 {1, 7, 3, 4, 5, 2, 6},
80 {7, 3, 4, 5, 2, 6, 1},
81 {3, 4, 5, 2, 6, 1, 7},
82 {4, 5, 2, 6, 1, 7, 3},
83 {5, 2, 6, 1, 7, 3, 4},
84 {2, 6, 1, 7, 3, 4, 5}};
85 const std::vector<Real> expect = {
86 4, 1, 7, 28, 2.1602468994692869408, 0.81649658092772603446, 7, 11.832159566199232259, 4};
88 auto result = calculate<std::vector<std::vector<Real>>, std::vector<Real>>(
x, compute);
89 for (
unsigned int i = 0; i < expect.size(); ++i)
90 for (
unsigned int j = 0;
j <
x[0].size(); ++
j)
92 EXPECT_EQ(result.first[i][
j], expect[i]);
93 EXPECT_EQ(result.second[i][
j], expect[i]);
const std::vector< double > x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")