fix error function

release/4.3a0
Varun Agrawal 2024-09-16 18:43:07 -04:00
parent 094db1eb79
commit f9031f53b4
1 changed files with 2 additions and 2 deletions

View File

@ -140,7 +140,7 @@ class HybridNonlinearFactor : public HybridFactor {
auto errorFunc =
[continuousValues](const std::pair<sharedFactor, double>& f) {
auto [factor, val] = f;
return factor->error(continuousValues) + (0.5 * val * val);
return factor->error(continuousValues) + (0.5 * val);
};
DecisionTree<Key, double> result(factors_, errorFunc);
return result;
@ -159,7 +159,7 @@ class HybridNonlinearFactor : public HybridFactor {
auto [factor, val] = factors_(discreteValues);
// Compute the error for the selected factor
const double factorError = factor->error(continuousValues);
return factorError + (0.5 * val * val);
return factorError + (0.5 * val);
}
/**