10 #include <gtest/gtest.h> 12 #include <Eigen/Dense> 14 TEST(CMatrixDynamic, GetSetEigen)
18 auto em = M.asEigen();
20 for (
int i = 0; i < 3; i++) EXPECT_EQ(M(i, i), 1.0);
25 for (
int i = 0; i < 3; i++)
26 for (
int j = 0; j < 3; j++)
28 const auto n = ((i + 1) * 3) + (j * 1001);
30 EXPECT_NEAR(M(i, j), em(i, j), 1e-9)
31 <<
"(i,j)=(" << i <<
"," << j <<
")\n";
35 TEST(CMatrixDynamic, asString)
42 TEST(CMatrixDynamic, CtorFromArray)
44 const double dat_R[] = {1., 2., 3., 4., 5., 6., 7., 8., 9.};
46 for (
int r = 0;
r < 3;
r++)
48 for (
int c = 0;
c < 3;
c++)
50 EXPECT_EQ(dat_R[
c +
r * 3],
R(
r,
c))
51 <<
"(r,c)=(" <<
r <<
"," <<
c <<
")\n";
57 TEST(CMatrixDynamic, Resizes)
static CMatrixDynamic< T > Identity()
GLsizei const GLchar ** string
GLdouble GLdouble GLdouble r
EIGEN_MAP asEigen()
Get as an Eigen-compatible Eigen::Map object.
TEST(CMatrixDynamic, GetSetEigen)
CMatrixDynamic< double > CMatrixDouble
Declares a matrix of double numbers (non serializable).