Go to the documentation of this file.
15 #ifndef BELUGA_POLICIES_ON_EFFECTIVE_SIZE_DROP_HPP
16 #define BELUGA_POLICIES_ON_EFFECTIVE_SIZE_DROP_HPP
18 #include <range/v3/range/concepts.hpp>
44 template <
class Range>
46 static_assert(ranges::sized_range<Range>);
47 const auto size =
static_cast<double>(ranges::size(range));
Implementation detail for a on_effective_size_drop_policy object.
constexpr detail::make_policy_fn make_policy
Make policy function objects.
constexpr auto operator()(double threshold) const
Overload that binds a specified threshold.
Implementation of an algorithm to calculate the effective sample size (ESS).
constexpr policy< detail::on_effective_size_drop_policy > on_effective_size_drop
Policy that can be used to trigger an action based on the Effective Sample Size (ESS) metric.
auto effective_sample_size(Range &&range)
Calculate the ESS of a given a range of weights.
static constexpr double kDefaultThreshold
Default percentage threshold.
Forward declaration of policy.
constexpr bool operator()(Range &&range, double threshold=kDefaultThreshold) const
Overload that implements the condition.
beluga
Author(s):
autogenerated on Tue Jul 16 2024 02:59:53