From d954cab8849b18c43dd1b50bb0a465749df170e1 Mon Sep 17 00:00:00 2001 From: cbeall3 Date: Wed, 22 Jan 2014 12:17:31 -0500 Subject: [PATCH] fix compiler error on Mac OS 10.9/clang 5. --- gtsam/geometry/Sphere2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtsam/geometry/Sphere2.cpp b/gtsam/geometry/Sphere2.cpp index e7562e234..ce386ac17 100644 --- a/gtsam/geometry/Sphere2.cpp +++ b/gtsam/geometry/Sphere2.cpp @@ -112,7 +112,7 @@ Sphere2 Sphere2::retract(const Vector& v, Sphere2::CoordinatesMode mode) const { double xi_hat_norm = xi_hat.norm(); // Avoid nan - if ((xi_hat_norm == 0.0)) { + if (xi_hat_norm == 0.0) { if (v.norm () == 0.0) return Sphere2 (point3 ()); else @@ -147,7 +147,7 @@ Sphere2 Sphere2::retract(const Vector& v, Sphere2::CoordinatesMode mode) const { // the below will be nan if theta == 0.0 if (p == q) return (Vector (2) << 0, 0); - else if (p == -q) + else if (p == (Vector)-q) return (Vector (2) << M_PI, 0); Vector result_hat = (theta / sin(theta)) * (q - p * cos(theta));