Skip to content

Commit

Permalink
Fix Noetic builds
Browse files Browse the repository at this point in the history
Signed-off-by: Nahuel Espinosa <[email protected]>
  • Loading branch information
nahueespinosa committed Jul 9, 2024
1 parent 054dd02 commit c5090df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion beluga/include/beluga/algorithm/cluster_based_estimation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,17 @@ template <class States, class Weights, class Clusters>
#endif
ranges::views::cache1 | //
ranges::views::filter([](auto subrange) {
#if RANGE_V3_MAJOR == 0 && RANGE_V3_MINOR < 11
return ranges::distance(subrange) > 1;
#else
// If there's only one sample in the cluster we can't estimate the covariance.
return subrange.size() > 1;
#endif
}) |
ranges::views::transform([](auto subrange) {
auto states = subrange | ranges::views::transform(&Particle::state);
auto weights = subrange | ranges::views::transform(&Particle::weight);
const auto [mean, covariance] = estimate(states, weights);
const auto [mean, covariance] = beluga::estimate(states, weights);
const auto total_weight = ranges::accumulate(weights, 0.0);
return Estimate{total_weight, std::move(mean), std::move(covariance)};
}) |
Expand Down

0 comments on commit c5090df

Please sign in to comment.