From 993622e915b1d954db95d63f7fa0fa9ee746e594 Mon Sep 17 00:00:00 2001 From: Sameer Agarwal Date: Fri, 14 Nov 2014 07:31:31 -0800 Subject: [PATCH] Minor fixes. 1. Remove an unused private member in TukeyLoss. 2. The test for RotationMatrixToAngle had an indexing error. Change-Id: I7decc9448ae0abef53aa435005f739e9e0931e80 --- include/ceres/loss_function.h | 3 +-- internal/ceres/rotation_test.cc | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/ceres/loss_function.h b/include/ceres/loss_function.h index 4408dc95f..923f4bc7c 100644 --- a/include/ceres/loss_function.h +++ b/include/ceres/loss_function.h @@ -285,11 +285,10 @@ class CERES_EXPORT TolerantLoss : public LossFunction { // At s = 0: rho = [0, 0.5, -1 / a^2] class CERES_EXPORT TukeyLoss : public ceres::LossFunction { public: - explicit TukeyLoss(double a) : a_(a), a_squared_(a * a) { } + explicit TukeyLoss(double a) : a_squared_(a * a) { } virtual void Evaluate(double, double*) const; private: - const double a_; const double a_squared_; }; diff --git a/internal/ceres/rotation_test.cc b/internal/ceres/rotation_test.cc index 27a939c0d..2764e6647 100644 --- a/internal/ceres/rotation_test.cc +++ b/internal/ceres/rotation_test.cc @@ -1108,10 +1108,11 @@ void CheckRotationMatrixToAngleAxisRoundTrip(const double theta, TEST(RotationMatrixToAngleAxis, ExhaustiveRoundTrip) { const double kMaxSmallAngle = 1e-8; - for (int i = 0; i < 1000; ++i) { - const double theta = static_cast(i) / 100.0 * 2.0 * kPi; - for (int j = 0; j < 1000; ++j) { - const double phi = static_cast(j) / 100.0 * kPi; + const int kNumSteps = 1000; + for (int i = 0; i < kNumSteps; ++i) { + const double theta = static_cast(i) / kNumSteps * 2.0 * kPi; + for (int j = 0; j < kNumSteps; ++j) { + const double phi = static_cast(j) / kNumSteps * kPi; // Rotations of angle Pi. CheckRotationMatrixToAngleAxisRoundTrip(theta, phi, kPi); // Rotation of angle approximately Pi.