14 #include <gtest/gtest.h> 21 #include <Eigen/Dense> 28 const double dat_A[] = {4, 5, 8, -2, 1, 3};
29 const double dat_B[] = {2, 6, 9, 8};
30 const double dat_Cok[] = {53, 64, -2, 32, 29, 30};
32 #define CHECK_AND_RET_ERROR(_COND_, _MSG_) EXPECT_FALSE(_COND_) << _MSG_; 34 TEST(Matrices, DynMat_size)
42 TEST(Matrices, A_times_B_dyn)
51 <<
"A: " <<
A <<
"B: " << B <<
"A*B: " << C << endl;
54 TEST(Matrices, A_times_B_fix)
67 TEST(Matrices, SerializeCMatrixD)
90 GTEST_FAIL() <<
"Exception not launched when it was expected!";
97 TEST(Matrices, EigenVal2x2dyn)
99 const double dat_C1[] = {14.6271, 5.8133, 5.8133, 16.8805};
103 std::vector<double> C1_Ds;
118 const double dat_C[] = {14.6271, 0, 5.8133, 16.8805};
122 std::vector<double> eig_vals;
133 const double dat_C1[] = {8, 6, 1, 6, 9, 4, 1, 4, 10};
137 std::vector<double> C1_Ds;
150 const double dat_C1[] = {14.6271, 5.8133, 5.8133, 16.8805};
154 std::vector<double> C1_Ds;
167 const double dat_C1[] = {8, 6, 1, 6, 9, 4, 1, 4, 10};
171 std::vector<double> C1_Ds;
A namespace of pseudo-random numbers generators of diferent distributions.
bool eig(Derived &eVecs, std::vector< Scalar > &eVals, bool sorted=true) const
Computes the eigenvectors and eigenvalues for a square, general matrix.
A compile-time fixed-size numeric matrix container.
This class is a "CSerializable" wrapper for "CMatrixDynamic<double>".
bool eig_symmetric(Derived &eVecs, std::vector< Scalar > &eVals, bool sorted=true) const
Read: eig()
CArchiveStreamBase< STREAM > archiveFrom(STREAM &s)
Helper function to create a templatized wrapper CArchive object for a: MRPT's CStream, std::istream, std::ostream, std::stringstream.
CMatrixFixed< double, 3, 3 > CMatrixDouble33
This base provides a set of functions for maths stuff.
This CStream derived class allow using a memory buffer as a CStream.
CONTAINER::Scalar sum(const CONTAINER &v)
Computes the sum of all the elements.
uint64_t Seek(int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) override
Introduces a pure virtual method for moving to a specified position in the streamed resource...
CMatrixFixed< double, 2, 2 > CMatrixDouble22
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Scalar sum() const
Sum of all elements in matrix/vector.
This file implements matrix/vector text and binary serialization.
EXPECT_EQ(out.image_pair_was_used.size(), NUM_IMGS)
EIGEN_MAP asEigen()
Get as an Eigen-compatible Eigen::Map object.
EXPECT_NEAR(out.cam_params.rightCameraPose.x, 0.1194, 0.005)
TEST(Matrices, DynMat_size)
EIGEN_MAP asEigen()
Get as an Eigen-compatible Eigen::Map object.
void setDiagonal(const std::size_t N, const Scalar value)
Resize to NxN, set all entries to zero, except the main diagonal which is set to value ...
CMatrixDynamic< double > CMatrixDouble
Declares a matrix of double numbers (non serializable).