Struct take_while_kld_fn

Struct Documentation

struct take_while_kld_fn

Implementation detail for a take_while_kld range adaptor object.

Public Functions

template<class Range, class Hasher, std::enable_if_t<ranges::range<Range>, int> = 0>
inline constexpr auto operator()(Range &&range, Hasher hasher, std::size_t min, std::size_t max, double epsilon, double z = beluga::detail::kDefaultKldZ) const

Overload that implements the take_while_kld algorithm.

The hasher will be called with range elements by default. If that is not possible, it will assume that the range contains particles and invoke the hasher with the state element of each particle.

Template Parameters:
  • Range – An input range with particle states.

  • Hasher – A callable object that can compute the spatial hash for a given state.

Parameters:
  • range – Source range from where to take elements.

  • hasher – Hasher instance used to compute the spatial hash for a given state.

  • min – Minimum samples to take.

  • max – Maximum samples to take.

  • epsilon – See beluga::kld_condition() for details.

  • z – See beluga::kld_condition() for details.

template<class Hasher>
inline constexpr auto operator()(Hasher hasher, std::size_t min, std::size_t max, double epsilon, double z = beluga::detail::kDefaultKldZ) const

Overload that returns a view closure to compose with other views.

Template Parameters:

Hasher – A callable object that can compute the spatial hash for a given state.

Parameters:
  • hasher – Hasher instance used to compute the spatial hash for a given state.

  • min – Minimum samples to take.

  • max – Maximum samples to take.

  • epsilon – See beluga::kld_condition() for details.

  • z – See beluga::kld_condition() for details.