Skip to content

Commit

Permalink
Use std::abs to avoid implicit conversion of double input to int
Browse files Browse the repository at this point in the history
  • Loading branch information
MagnusAagaard authored Jan 8, 2025
1 parent 82d0ebc commit 3760b02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gtsam/sfm/TranslationFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3760b02

Please sign in to comment.