From 3760b02d8ecc946db9283db90176c339a47397e7 Mon Sep 17 00:00:00 2001 From: MagnusAagaard <37117207+MagnusAagaard@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:28:28 +0100 Subject: [PATCH] Use std::abs to avoid implicit conversion of double input to int --- gtsam/sfm/TranslationFactor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtsam/sfm/TranslationFactor.h b/gtsam/sfm/TranslationFactor.h index 20bf005c17..fe06fbaaed 100644 --- a/gtsam/sfm/TranslationFactor.h +++ b/gtsam/sfm/TranslationFactor.h @@ -134,7 +134,7 @@ class BilinearAngleTranslationFactor OptionalMatrixType H1, OptionalMatrixType H2, OptionalMatrixType H3) const override { // Ideally we should use a positive real valued scalar datatype for scale. - const double abs_scale = abs(scale[0]); + const double abs_scale = std::abs(scale[0]); const Point3 predicted = (Tb - Ta) * abs_scale; if (H1) { *H1 = -Matrix3::Identity() * abs_scale;