18 #include <gtest/gtest.h> 27 TEST(Matrices, loadFromArray)
30 const double nums[3 * 4] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
35 for (
int r = 0;
r < 3;
r++)
36 for (
int c = 0;
c < 4;
c++) EXPECT_EQ(nums[4 *
r +
c], mat(
r,
c));
39 TEST(Matrices, CMatrixFixedNumeric_loadWithEigenMap)
41 alignas(16)
double nums[3 * 4] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
45 Eigen::Map<CMatrixFixedNumeric<double, 3, 4>::Base, Eigen::Aligned>(
48 for (
int r = 0;
r < 3;
r++)
49 for (
int c = 0;
c < 4;
c++) EXPECT_EQ(nums[4 *
r +
c], mat(
r,
c));
52 TEST(Matrices, EigenMatrix_loadWithEigenMap)
54 alignas(16)
double nums[3 * 4] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
56 const Eigen::Matrix<double, 3, 4> mat =
57 Eigen::Map<Eigen::Matrix<double, 3, 4>, Eigen::Aligned>(nums);
59 for (
int r = 0;
r < 3;
r++)
60 for (
int c = 0;
c < 4;
c++) EXPECT_EQ(nums[3 *
c +
r], mat(
r,
c));
A namespace of pseudo-random numbers genrators of diferent distributions.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
A numeric matrix of compile-time fixed size.
This base provides a set of functions for maths stuff.
void loadFromArray(const T *vals)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLdouble GLdouble GLdouble r
TEST(Matrices, loadFromArray)