18 #include <gtest/gtest.h> 27 #define CHECK_AND_RET_ERROR(_COND_, _MSG_) EXPECT_FALSE(_COND_) << _MSG_; 33 EXPECT_TRUE((M.array() == 0).all());
37 EXPECT_TRUE((M.array() == 0).all());
42 EXPECT_TRUE((M.array() == 0).all());
47 EXPECT_TRUE((M.array() == 0).all());
52 EXPECT_TRUE((M.array() == 0).all());
57 EXPECT_TRUE((M.array() == 0).all());
62 EXPECT_TRUE((M.array() == 0).all());
69 const double vals[] = {
70 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15,
71 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15,
72 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15,
73 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15};
76 std::vector<size_t> vs;
81 M.extractSubmatrixSymmetricalBlocks(2, vs, E);
83 const double valsE[] = {3, 4, 7, 8, 10, 11, 14, 15,
84 3, 4, 7, 8, 10, 11, 14, 15};
87 EXPECT_TRUE(E_expected == E);
94 const double vals[] = {
95 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15,
96 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15,
97 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15,
98 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15};
101 std::vector<size_t> vs;
108 M.extractSubmatrixSymmetrical(vs, E);
110 const double valsE[] = {3, 4, 7, 8, 10, 11, 14, 15,
111 3, 4, 7, 8, 10, 11, 14, 15};
114 EXPECT_TRUE(E_expected == E);
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.
void extractSubmatrixSymmetricalBlocks(const size_t block_size, const std::vector< size_t > &block_indices, MATRIX &out) const
Get a submatrix from a square matrix, by collecting the elements M(idxs,idxs), where idxs is a sequen...
A numeric matrix of compile-time fixed size.
This base provides a set of functions for maths stuff.
EIGEN_STRONG_INLINE void setSize(size_t row, size_t col)
Changes the size of matrix, maintaining its previous content as possible and padding with zeros where...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void extractSubmatrixSymmetrical(const std::vector< size_t > &indices, MATRIX &out) const
Get a submatrix from a square matrix, by collecting the elements M(idxs,idxs), where idxs is the sequ...