10 #include <gtest/gtest.h> 12 #include <Eigen/Dense> 14 TEST(CMatrixFixed, CtorUninit)
21 TEST(CMatrixFixed, CtorAllZeros)
24 for (
int i = 0; i < 2; i++)
25 for (
int j = 0; j < 2; j++)
EXPECT_EQ(M(i, j), .0);
28 TEST(CMatrixFixed, Identity)
32 for (
int i = 0; i < 3; i++)
40 for (
int r = 0; r < 3; r++)
41 for (
int c = 0; c < 3; c++)
EXPECT_EQ(&M(r, c), &M.
data()[c + r * 3]);
44 TEST(CMatrixFixed, asString)
51 TEST(CMatrixFixed, GetSetEigen)
57 for (
int i = 0; i < 3; i++)
EXPECT_EQ(M(i, i), 1.0);
62 for (
int i = 0; i < 3; i++)
63 for (
int j = 0; j < 3; j++)
65 const auto n = ((i + 1) * 3) + (j * 1001);
68 <<
"(i,j)=(" << i <<
"," << j <<
")\n";
A compile-time fixed-size numeric matrix container.
std::string asString() const
Returns a string representation of the vector/matrix, using Eigen's default settings.
const T * data() const
Return raw pointer to row-major data buffer.
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(CMatrixFixed, CtorUninit)