mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Minor fixes.
1. Remove an unused private member in TukeyLoss. 2. The test for RotationMatrixToAngle had an indexing error. Change-Id: I7decc9448ae0abef53aa435005f739e9e0931e80
This commit is contained in:
@@ -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_;
|
||||
};
|
||||
|
||||
|
||||
@@ -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<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.
|
||||
|
||||
Reference in New Issue
Block a user