Minor fixes.
1. Remove an unused private member in TukeyLoss.
2. The test for RotationMatrixToAngle had an indexing error.
Change-Id: I7decc9448ae0abef53aa435005f739e9e0931e80
diff --git a/include/ceres/loss_function.h b/include/ceres/loss_function.h
index 4408dc9..923f4bc 100644
--- a/include/ceres/loss_function.h
+++ b/include/ceres/loss_function.h
@@ -285,11 +285,10 @@
// 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 27a939c..2764e66 100644
--- a/internal/ceres/rotation_test.cc
+++ b/internal/ceres/rotation_test.cc
@@ -1108,10 +1108,11 @@
TEST(RotationMatrixToAngleAxis, ExhaustiveRoundTrip) {
const double kMaxSmallAngle = 1e-8;
- for (int i = 0; i < 1000; ++i) {
- const double theta = static_cast<double>(i) / 100.0 * 2.0 * kPi;
- for (int j = 0; j < 1000; ++j) {
- const double phi = static_cast<double>(j) / 100.0 * kPi;
+ const int kNumSteps = 1000;
+ for (int i = 0; i < kNumSteps; ++i) {
+ const double theta = static_cast<double>(i) / kNumSteps * 2.0 * kPi;
+ for (int j = 0; j < kNumSteps; ++j) {
+ const double phi = static_cast<double>(j) / kNumSteps * kPi;
// Rotations of angle Pi.
CheckRotationMatrixToAngleAxisRoundTrip(theta, phi, kPi);
// Rotation of angle approximately Pi.