Skip to content

Commit

Permalink
Fix passing different types to std::min in cost_functions.hpp (#3244) (
Browse files Browse the repository at this point in the history
…#3245)

(cherry picked from commit 415a4a2)

Co-authored-by: Silvio Traversaro <[email protected]>
  • Loading branch information
mergify[bot] and traversaro authored Jan 14, 2025
1 parent b1c45fd commit 65b5532
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ CostFn getCostFunctionFromStateValidator(const StateValidatorFn& state_validator
const long kernel_start = mu - static_cast<long>(sigma) * 4;
const long kernel_end = mu + static_cast<long>(sigma) * 4;
const long bounded_kernel_start = std::max(0l, kernel_start);
const long bounded_kernel_end = std::min(values.cols() - 1, kernel_end);
const long bounded_kernel_end = std::min(static_cast<long>(values.cols()) - 1, kernel_end);
for (auto j = bounded_kernel_start; j <= bounded_kernel_end; ++j)
{
costs(j) = std::exp(-std::pow(j - mu, 2) / (2 * std::pow(sigma, 2))) / (sigma * std::sqrt(2 * M_PI));
Expand Down

0 comments on commit 65b5532

Please sign in to comment.