From 42b795c769e66dacc24cbe8b13309cdfb3506fc2 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco Claraco Date: Fri, 22 Apr 2022 01:02:03 +0200 Subject: [PATCH] fix derivative Signed-off-by: Jose Luis Blanco Claraco --- gtsam/linear/LossFunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtsam/linear/LossFunctions.cpp b/gtsam/linear/LossFunctions.cpp index 7307c4a68..6573beac9 100644 --- a/gtsam/linear/LossFunctions.cpp +++ b/gtsam/linear/LossFunctions.cpp @@ -350,8 +350,8 @@ double DCS::weight(double distance) const { const double e2 = distance*distance; if (e2 > c_) { - const double w = 2.0*c_/(c_ + e2); - return w*w; + const double w = c_/(c_ + e2); + return 2.0*w*w; } return 1.0;