Protected Member Functions | List of all members
beluga::views::detail::sample_base_fn Struct Reference

Implementation detail for a sample algorithm. More...

#include <sample.hpp>

Inheritance diagram for beluga::views::detail::sample_base_fn:
Inheritance graph
[legend]

Protected Member Functions

template<class Distribution , class URNG >
constexpr auto sample_from_distribution (Distribution distribution, URNG &engine) const
 Sample from random distributions. More...
 
template<class Range , class URNG >
constexpr auto sample_from_range (Range &&range, URNG &engine) const
 Sample from any range. More...
 
template<class Range , class Weights , class URNG >
constexpr auto sample_from_range (Range &&range, Weights &&weights, URNG &engine) const
 Sample from weighted ranges. More...
 

Detailed Description

Implementation detail for a sample algorithm.

Definition at line 124 of file sample.hpp.

Member Function Documentation

◆ sample_from_distribution()

template<class Distribution , class URNG >
constexpr auto beluga::views::detail::sample_base_fn::sample_from_distribution ( Distribution  distribution,
URNG &  engine 
) const
inlineconstexprprotected

Sample from random distributions.

Definition at line 163 of file sample.hpp.

◆ sample_from_range() [1/2]

template<class Range , class URNG >
constexpr auto beluga::views::detail::sample_base_fn::sample_from_range ( Range &&  range,
URNG &  engine 
) const
inlineconstexprprotected

Sample from any range.

If the input range is a particle range, it will extract the weights and treat it as a weighted range. The new particles will all have a weight equal to 1, since, after resampling, the probability will be represented by the number of particles rather than their individual weight.

If the input range is not a particle range, it will assume a uniform distribution.

Definition at line 147 of file sample.hpp.

◆ sample_from_range() [2/2]

template<class Range , class Weights , class URNG >
constexpr auto beluga::views::detail::sample_base_fn::sample_from_range ( Range &&  range,
Weights &&  weights,
URNG &  engine 
) const
inlineconstexprprotected

Sample from weighted ranges.

Definition at line 128 of file sample.hpp.


The documentation for this struct was generated from the following file:


beluga
Author(s):
autogenerated on Tue Jul 16 2024 02:59:54