Delete forcing compare eigenvector in unittest
parent
4ee4014d7a
commit
f604a9784d
|
|
@ -76,11 +76,6 @@ TEST(AcceleratedPowerMethod, useFactorGraph) {
|
||||||
auto L = fg.hessian();
|
auto L = fg.hessian();
|
||||||
Eigen::EigenSolver<Matrix> solver(L.first);
|
Eigen::EigenSolver<Matrix> solver(L.first);
|
||||||
|
|
||||||
// Check that we get zero eigenvalue and "constant" eigenvector
|
|
||||||
EXPECT_DOUBLES_EQUAL(0.0, solver.eigenvalues()[0].real(), 1e-9);
|
|
||||||
auto v0 = solver.eigenvectors().col(0);
|
|
||||||
for (size_t j = 0; j < 3; j++) EXPECT_DOUBLES_EQUAL(-0.5, v0[j].real(), 1e-9);
|
|
||||||
|
|
||||||
// find the index of the max eigenvalue
|
// find the index of the max eigenvalue
|
||||||
size_t maxIdx = 0;
|
size_t maxIdx = 0;
|
||||||
for (auto i = 0; i < solver.eigenvalues().rows(); ++i) {
|
for (auto i = 0; i < solver.eigenvalues().rows(); ++i) {
|
||||||
|
|
@ -105,7 +100,6 @@ TEST(AcceleratedPowerMethod, useFactorGraph) {
|
||||||
const double ritzValue = actual1.dot(L.first * actual1);
|
const double ritzValue = actual1.dot(L.first * actual1);
|
||||||
const double ritzResidual = (L.first * actual1 - ritzValue * actual1).norm();
|
const double ritzResidual = (L.first * actual1 - ritzValue * actual1).norm();
|
||||||
EXPECT_DOUBLES_EQUAL(0, ritzResidual, 1e-5);
|
EXPECT_DOUBLES_EQUAL(0, ritzResidual, 1e-5);
|
||||||
// Check
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
|
||||||
|
|
@ -74,11 +74,6 @@ TEST(PowerMethod, useFactorGraph) {
|
||||||
auto L = fg.hessian();
|
auto L = fg.hessian();
|
||||||
Eigen::EigenSolver<Matrix> solver(L.first);
|
Eigen::EigenSolver<Matrix> solver(L.first);
|
||||||
|
|
||||||
// Check that we get zero eigenvalue and "constant" eigenvector
|
|
||||||
EXPECT_DOUBLES_EQUAL(0.0, solver.eigenvalues()[0].real(), 1e-9);
|
|
||||||
auto v0 = solver.eigenvectors().col(0);
|
|
||||||
for (size_t j = 0; j < 3; j++) EXPECT_DOUBLES_EQUAL(-0.5, v0[j].real(), 1e-9);
|
|
||||||
|
|
||||||
// find the index of the max eigenvalue
|
// find the index of the max eigenvalue
|
||||||
size_t maxIdx = 0;
|
size_t maxIdx = 0;
|
||||||
for (auto i = 0; i < solver.eigenvalues().rows(); ++i) {
|
for (auto i = 0; i < solver.eigenvalues().rows(); ++i) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue