Update tolerances in small_blas_test.cc
Thanks to Philipp Hubner for reporting this.
Change-Id: Ia4f9dfa84edc164fa0c363381e94c929905f57b6
diff --git a/internal/ceres/small_blas_test.cc b/internal/ceres/small_blas_test.cc
index b8b5bc5..39e96af 100644
--- a/internal/ceres/small_blas_test.cc
+++ b/internal/ceres/small_blas_test.cc
@@ -30,14 +30,16 @@
#include "ceres/small_blas.h"
+#include <limits>
#include "gtest/gtest.h"
#include "ceres/internal/eigen.h"
namespace ceres {
namespace internal {
+const double kTolerance = 2.0 * std::numeric_limits<double>::epsilon();
+
TEST(BLAS, MatrixMatrixMultiply) {
- const double kTolerance = 1e-16;
const int kRowA = 3;
const int kColA = 5;
Matrix A(kRowA, kColA);
@@ -120,7 +122,6 @@
}
TEST(BLAS, MatrixTransposeMatrixMultiply) {
- const double kTolerance = 1e-16;
const int kRowA = 5;
const int kColA = 3;
Matrix A(kRowA, kColA);
@@ -202,7 +203,6 @@
}
TEST(BLAS, MatrixVectorMultiply) {
- const double kTolerance = 1e-16;
const int kRowA = 5;
const int kColA = 3;
Matrix A(kRowA, kColA);
@@ -251,7 +251,6 @@
}
TEST(BLAS, MatrixTransposeVectorMultiply) {
- const double kTolerance = 1e-16;
const int kRowA = 5;
const int kColA = 3;
Matrix A(kRowA, kColA);
@@ -282,8 +281,8 @@
c_minus_ref -= A.transpose() * b;
MatrixTransposeVectorMultiply<kRowA, kColA, -1>(A.data(), kRowA, kColA,
- b.data(),
- c_minus.data());
+ b.data(),
+ c_minus.data());
EXPECT_NEAR((c_minus_ref - c_minus).norm(), 0.0, kTolerance)
<< "c += A' * b \n"
<< "c_ref : \n" << c_minus_ref << "\n"