31 constexpr int dimensions = 3;
54 Eigen::VectorXd inValues(3);
55 inValues << 2.0, 0.0, 0.0;
57 Eigen::VectorXd outValues(9);
58 outValues = Eigen::VectorXd::Zero(9);
63 mapping.
map(inSample, outValues);
69 BOOST_TEST(outValues(0) == 2 * inSample.values(0));
70 BOOST_TEST(outValues(1) == 0);
71 BOOST_TEST(outValues(2) == 0);
74 BOOST_TEST(outValues(3) == 0.0);
75 BOOST_TEST(outValues(4) == 0.0);
76 BOOST_TEST(outValues(5) == 0.0);
79 BOOST_TEST(outValues(6) == 1.5 * inSample.values(0));
80 BOOST_TEST(outValues(7) == 0.0);
81 BOOST_TEST(outValues(8) == 0.0);
93 constexpr int dimensions = 3;
116 Eigen::VectorXd inValues(3);
117 inValues << 0.0, 0.0, 2.0;
119 Eigen::VectorXd outValues(9);
120 outValues = Eigen::VectorXd::Zero(9);
124 mapping.
map(inSample, outValues);
129 BOOST_TEST(outValues(0) == 0.0);
130 BOOST_TEST(outValues(1) == 0.0);
131 BOOST_TEST(outValues(2) == 2 * inSample.values(2));
134 BOOST_TEST(outValues(3) == 0.0);
135 BOOST_TEST(outValues(4) == 0.0);
136 BOOST_TEST(outValues(5) == 0.0);
139 BOOST_TEST(outValues(6) == 0.0);
140 BOOST_TEST(outValues(7) == 0.0);
141 BOOST_TEST(outValues(8) == 1.5 * inSample.values(2));
153 constexpr int dimensions = 3;
176 Eigen::VectorXd inValues(9);
177 inValues << 1.0, 0.0, 0.0, 2.0, 0.0, 0.0, 3.0, 0.0, 0.0;
179 Eigen::VectorXd outValues(3);
180 outValues = Eigen::VectorXd::Zero(3);
184 mapping.
map(inSample, outValues);
189 BOOST_TEST(outValues(0) == (1 / 3.0) * (inSample.values(0) + inSample.values(3) + inSample.values(6)));
190 BOOST_TEST(outValues(1) == 0.0);
191 BOOST_TEST(outValues(2) == 0.0);
203 constexpr int dimensions = 3;
226 Eigen::VectorXd inValues(9);
227 inValues << 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 0.0, 0.0, 3.0;
229 Eigen::VectorXd outValues(3);
230 outValues = Eigen::VectorXd::Zero(3);
234 mapping.
map(inSample, outValues);
239 BOOST_TEST(outValues(0) == 0.0);
240 BOOST_TEST(outValues(1) == 0.0);
241 BOOST_TEST(outValues(2) == (1 / 3.0) * (inSample.values(2) + inSample.values(5) + inSample.values(8)));
boost::test_tools::predicate_result equals(const std::vector< float > &VectorA, const std::vector< float > &VectorB, float tolerance)
equals to be used in tests. Compares two std::vectors using a given tolerance. Prints both operands o...