import back LeastSquares into eigen2support. Pass most of eigen2's 'regression' test, except for regression_4 which is about complex numbers.

This commit is contained in:
Benoit Jacob
2011-01-26 11:05:41 -05:00
parent 98285ba81c
commit 162cb8ff42
3 changed files with 215 additions and 1 deletions

View File

@@ -88,6 +88,7 @@ void check_fitHyperplane(int numPoints,
fitHyperplane(numPoints, points, &result);
result.coeffs() *= original.coeffs().coeff(size)/result.coeffs().coeff(size);
typename VectorType::Scalar error = (result.coeffs() - original.coeffs()).norm() / original.coeffs().norm();
std::cout << ei_abs(error) << " xxx " << ei_abs(tolerance) << std::endl;
VERIFY(ei_abs(error) < ei_abs(tolerance));
}
@@ -109,7 +110,7 @@ void test_eigen2_regression()
CALL_SUBTEST(check_linearRegression(100, points2f_ptrs, coeffs2f, 0.01f));
CALL_SUBTEST(check_linearRegression(1000, points2f_ptrs, coeffs2f, 0.002f));
}
#endif
#endif
#ifdef EIGEN_TEST_PART_2
{
Vector2f points2f [1000];