Use std::abs to avoid implicit conversion of double input to int

release/4.3a0
MagnusAagaard 2025-01-08 10:28:28 +01:00 committed by GitHub
parent 82d0ebc8fe
commit 3760b02d8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -134,7 +134,7 @@ class BilinearAngleTranslationFactor
OptionalMatrixType H1, OptionalMatrixType H2, OptionalMatrixType H1, OptionalMatrixType H2,
OptionalMatrixType H3) const override { OptionalMatrixType H3) const override {
// Ideally we should use a positive real valued scalar datatype for scale. // 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; const Point3 predicted = (Tb - Ta) * abs_scale;
if (H1) { if (H1) {
*H1 = -Matrix3::Identity() * abs_scale; *H1 = -Matrix3::Identity() * abs_scale;