![]() |
Hydra
4.0.1
A header-only templated C++ framework to perform data analysis on massively parallel platforms.
|
Random mumber generation and pdf sampling functionalities. More...
Files | |
| file | Random.inl |
| file | RandomUtils.h |
Functions | |
| template<typename Engine , hydra::detail::Backend BACKEND, typename Iterable , typename FUNCTOR > | |
| std::enable_if< detail::random::is_matching_iterable< Engine, FUNCTOR, Iterable >::value, void >::type | hydra::fill_random (hydra::detail::BackendPolicy< BACKEND > const &policy, Iterable &&iterable, FUNCTOR const &functor, size_t seed, size_t rng_jump) |
| Fill a range with numbers distributed according a user defined distribution. More... | |
| template<typename Engine , typename Iterable , typename FUNCTOR > | |
| std::enable_if< detail::random::is_matching_iterable< Engine, FUNCTOR, Iterable >::value, void >::type | hydra::fill_random (Iterable &&iterable, FUNCTOR const &functor, size_t seed, size_t rng_jump) |
| Fill a range with numbers distributed according a user defined distribution. More... | |
| template<typename Engine , hydra::detail::Backend BACKEND, typename Iterator , typename FUNCTOR > | |
| std::enable_if< !hydra::detail::has_rng_formula< FUNCTOR >::value, void >::type | hydra::fill_random (hydra::detail::BackendPolicy< BACKEND > const &policy, Iterator begin, Iterator end, FUNCTOR const &functor, size_t seed, size_t rng_jump) |
| Fall back function if RngFormula is not implemented for the requested functor. More... | |
| template<typename Engine , typename Iterator , typename FUNCTOR > | |
| std::enable_if< !hydra::detail::has_rng_formula< FUNCTOR >::value, void >::type | hydra::fill_random (Iterator begin, Iterator end, FUNCTOR const &functor, size_t seed, size_t rng_jump) |
| Fall back function if RngFormula is not implemented for the requested functor. More... | |
| template<typename RNG , typename IterableData , typename IterableWeight , hydra::detail::Backend BACKEND> | |
| std::enable_if< detail::random::is_iterable< IterableData >::value &&detail::random::is_iterable< IterableWeight >::value, Range< decltype(std::declval< IterableData >).begin())> >::type | hydra::unweight (hydra::detail::BackendPolicy< BACKEND > const &policy, IterableData &&data, IterableWeight &&weights, double max_pdf=-1.0, size_t rng_seed=0x8ec74d321e6b5a27, size_t rng_jump=0) |
| This functions reorder a dataset to produce a unweighted sample according to a weights. More... | |
| template<typename RNG = default_random_engine, typename DerivedPolicy , typename IteratorData , typename IteratorWeight > | |
| std::enable_if< detail::random::is_iterator< IteratorData >::value &&detail::random::is_iterator< IteratorWeight >::value, Range< IteratorData > >::type | hydra::unweight (hydra::thrust::detail::execution_policy_base< DerivedPolicy > const &policy, IteratorData data_begin, IteratorData data_end, IteratorWeight weights_begin, double max_pdf=-1.0, size_t rng_seed=0x8ec74d321e6b5a27, size_t rng_jump=0) |
| This functions reorder a dataset to produce a unweighted sample according to the weights [wbegin, wend]. More... | |
| template<typename RNG , typename Functor , typename Iterator , typename DerivedPolicy > | |
| std::enable_if< detail::random::is_callable< Functor >::value &&detail::random::is_iterator< Iterator >::value, Range< Iterator >>::type | hydra::unweight (hydra::thrust::detail::execution_policy_base< DerivedPolicy > const &policy, Iterator begin, Iterator end, Functor const &functor, double max_pdf=-1.0, size_t rng_seed=0x8ec74d321e6b5a27, size_t rng_jump=0) |
| This functions reorder a dataset to produce an unweighted sample according to. More... | |
| template<typename RNG = default_random_engine, typename IteratorData , typename IteratorWeight , hydra::detail::Backend BACKEND> | |
| std::enable_if< detail::random::is_iterator< IteratorData >::value &&detail::random::is_iterator< IteratorWeight >::value, Range< IteratorData > >::type | hydra::unweight (detail::BackendPolicy< BACKEND > const &policy, IteratorData data_begin, IteratorData data_end, IteratorWeight weights_begin, double max_pdf=-1.0, size_t rng_seed=0x8ec74d321e6b5a27, size_t rng_jump=0) |
| This functions reorder a dataset to produce a unweighted sample according to the weights [wbegin, wend]. More... | |
| template<typename RNG , typename Functor , typename Iterator , hydra::detail::Backend BACKEND> | |
| std::enable_if< detail::random::is_callable< Functor >::value &&detail::random::is_iterator< Iterator >::value, Range< Iterator >>::type | hydra::unweight (hydra::detail::BackendPolicy< BACKEND > const &policy, Iterator begin, Iterator end, Functor const &functor, double max_pdf=-1.0, size_t rng_seed=0x8ec74d321e6b5a27, size_t rng_jump=0) |
| This functions reorder a dataset to produce an unweighted sample according to. More... | |
| template<typename RNG = default_random_engine, typename IteratorData , typename IteratorWeight > | |
| std::enable_if< detail::random::is_iterator< IteratorData >::value &&detail::random::is_iterator< IteratorWeight >::value, Range< IteratorData >>::type | hydra::unweight (IteratorData data_begin, IteratorData data_end, IteratorData weights_begin, double max_pdf=-1.0, size_t rng_seed=0x8ec74d321e6b5a27, size_t rng_jump=0) |
| This functions reorder a dataset to produce a unweighted sample according to the weights [wbegin, wend]. More... | |
| template<typename RNG , typename Functor , typename Iterator > | |
| std::enable_if< detail::random::is_callable< Functor >::value &&detail::random::is_iterator< Iterator >::value, Range< Iterator >>::type | hydra::unweight (Iterator begin, Iterator end, Functor const &functor, double max_pdf=-1.0, size_t rng_seed=0x8ec74d321e6b5a27, size_t rng_jump=0) |
| This functions reorder a dataset to produce an unweighted sample according to. More... | |
| template<typename RNG , typename Functor , typename Iterable , hydra::detail::Backend BACKEND> | |
| std::enable_if< detail::random::is_callable< Functor >::value &&detail::random::is_iterable< Iterable >::value, Range< decltype(std::declval< Iterable >).begin())>>::type | hydra::unweight (hydra::detail::BackendPolicy< BACKEND > const &policy, Iterable &&iterable, Functor const &functor, double max_pdf=-1.0, size_t rng_seed=0x8ec74d321e6b5a27, size_t rng_jump=0) |
| This functions reorder a dataset to produce an unweighted sample according to. More... | |
| template<typename RNG = default_random_engine, typename IterableData , typename IterableWeight > | |
| std::enable_if< detail::random::is_iterable< IterableData >::value &&detail::random::is_iterable< IterableWeight >::value, Range< decltype(std::declval< IterableData >).begin())>>::type | hydra::unweight (IterableData data, IterableWeight weights, double max_pdf=-1.0, size_t rng_seed=0x8ec74d321e6b5a27, size_t rng_jump=0) |
| This functions reorder a dataset to produce an unweighted sample according to a weights. More... | |
| template<typename RNG = default_random_engine, typename Functor , typename Iterable > | |
| std::enable_if< detail::random::is_callable< Functor >::value &&detail::random::is_iterable< Iterable >::value,Range< decltype(std::declval< Iterable >).begin())> >::type | hydra::unweight (Iterable &&iterable, Functor const &functor, double max_pdf=-1.0, size_t rng_seed=0x8ec74d321e6b5a27, size_t rng_jump=0) |
| This functions reorder a dataset to produce an unweighted sample according to. More... | |
Variables | |
| template<typename Engine = hydra::default_random_engine, hydra::detail::Backend BACKEND, typename Iterator , typename FUNCTOR > | |
| std::enable_if< hydra::detail::has_rng_formula< FUNCTOR >::value &&std::is_convertible< decltype(std::declval< RngFormula< FUNCTOR > >).Generate(std::declval< Engine & >), std::declval< FUNCTOR const & >))), typename hydra::thrust::iterator_traits< Iterator >::value_type >::value, void >::type | hydra::fill_random (hydra::detail::BackendPolicy< BACKEND > const &policy, Iterator begin, Iterator end, FUNCTOR const &functor, size_t seed=0x254a0afcf7da74a2, size_t rng_jump=0) |
| Fill a range with numbers distributed according a user defined distribution using a RNG analytical formula. More... | |
Random mumber generation and pdf sampling functionalities.
| std::enable_if< detail::random::is_matching_iterable< Engine, FUNCTOR, Iterable >::value, void >::type hydra::fill_random | ( | hydra::detail::BackendPolicy< BACKEND > const & | policy, |
| Iterable && | iterable, | ||
| FUNCTOR const & | functor, | ||
| size_t | seed, | ||
| size_t | rng_jump | ||
| ) |
#include <RandomFill.inl>
Fill a range with numbers distributed according a user defined distribution.
| policy | backend to perform the calculation. |
| iterable | range storing the generated values |
| functor | distribution to be sampled |
| policy | backend to perform the calculation. |
| iterable | range storing the generated values |
| functor | distribution to be sampled |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| std::enable_if< detail::random::is_matching_iterable< Engine, FUNCTOR, Iterable >::value, void >::type hydra::fill_random | ( | Iterable && | iterable, |
| FUNCTOR const & | functor, | ||
| size_t | seed, | ||
| size_t | rng_jump | ||
| ) |
#include <RandomFill.inl>
Fill a range with numbers distributed according a user defined distribution.
Fall back function if the argument is not an Iterable or if itis not convertible to the Functor return value.
| iterable | range storing the generated values |
| functor | distribution to be sampled |
| iterable | range storing the generated values |
| functor | distribution to be sampled |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| std::enable_if< !hydra::detail::has_rng_formula< FUNCTOR >::value, void >::type hydra::fill_random | ( | hydra::detail::BackendPolicy< BACKEND > const & | policy, |
| Iterator | begin, | ||
| Iterator | end, | ||
| FUNCTOR const & | functor, | ||
| size_t | seed = 0x254a0afcf7da74a2, |
||
| size_t | rng_jump = 0 |
||
| ) |
#include <RandomFill.inl>
Fall back function if RngFormula is not implemented for the requested functor.
| policy | backend to perform the calculation. |
| begin | beginning of the range storing the generated values |
| end | ending of the range storing the generated values |
| functor | distribution to be sampled |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| std::enable_if< !hydra::detail::has_rng_formula< FUNCTOR >::value, void >::type hydra::fill_random | ( | Iterator | begin, |
| Iterator | end, | ||
| FUNCTOR const & | functor, | ||
| size_t | seed = 0x254a0afcf7da74a2, |
||
| size_t | rng_jump = 0 |
||
| ) |
#include <RandomFill.inl>
Fall back function if RngFormula is not implemented for the requested functor.
| begin | beginning of the range storing the generated values |
| end | ending of the range storing the generated values |
| functor | distribution to be sampled |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| std::enable_if< detail::random::is_iterable< IterableData >::value &&detail::random::is_iterable< IterableWeight >::value, Range< decltype(std::declval< IterableData >).begin())> >::type hydra::unweight | ( | hydra::detail::BackendPolicy< BACKEND > const & | policy, |
| IterableData && | data, | ||
| IterableWeight && | weights, | ||
| double | max_pdf = -1.0, |
||
| size_t | rng_seed = 0x8ec74d321e6b5a27, |
||
| size_t | rng_jump = 0 |
||
| ) |
#include <Random.inl>
This functions reorder a dataset to produce a unweighted sample according to a weights.
The length of the range
| weights | should be equal or greater than the |
| data | size. |
| policy | parallel backend to perform the unweighting |
| weights | the range of weights |
| data | the range corresponding dataset |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| std::enable_if<detail::random::is_iterator<IteratorData>::value && detail::random::is_iterator<IteratorWeight>::value,Range<IteratorData> >::type hydra::unweight | ( | hydra::thrust::detail::execution_policy_base< DerivedPolicy > const & | policy, |
| IteratorData | data_begin, | ||
| IteratorData | data_end, | ||
| IteratorWeight | weights_begin, | ||
| double | max_pdf = -1.0, |
||
| size_t | rng_seed = 0x8ec74d321e6b5a27, |
||
| size_t | rng_jump = 0 |
||
| ) |
#include <Random.h>
This functions reorder a dataset to produce a unweighted sample according to the weights [wbegin, wend].
The length of the range [wbegin, wend] should be equal or greater than the dataset size.
| policy | parallel backend to perform the unweighting |
| data_begin | iterator pointing to the begin of the range of weights |
| data_end | iterator pointing to the begin of the range of weights |
| weights_begin | iterator pointing to the begin of the range of data |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| std::enable_if< detail::random::is_callable<Functor>::value && detail::random::is_iterator<Iterator>::value, Range<Iterator>>::type hydra::unweight | ( | hydra::thrust::detail::execution_policy_base< DerivedPolicy > const & | policy, |
| Iterator | begin, | ||
| Iterator | end, | ||
| Functor const & | functor, | ||
| double | max_pdf = -1.0, |
||
| size_t | rng_seed = 0x8ec74d321e6b5a27, |
||
| size_t | rng_jump = 0 |
||
| ) |
#include <Random.inl>
This functions reorder a dataset to produce an unweighted sample according to.
| functor | . |
| policy | |
| begin | |
| end | |
| functor | |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| std::enable_if<detail::random::is_iterator<IteratorData>::value && detail::random::is_iterator<IteratorWeight>::value,Range<IteratorData> >::type hydra::unweight | ( | detail::BackendPolicy< BACKEND > const & | policy, |
| IteratorData | data_begin, | ||
| IteratorData | data_end, | ||
| IteratorWeight | weights_begin, | ||
| double | max_pdf = -1.0, |
||
| size_t | rng_seed = 0x8ec74d321e6b5a27, |
||
| size_t | rng_jump = 0 |
||
| ) |
#include <Random.h>
This functions reorder a dataset to produce a unweighted sample according to the weights [wbegin, wend].
The length of the range [wbegin, wend] should be equal or greater than the dataset size.
| policy | parallel backend to perform the unweighting |
| data_begin | iterator pointing to the begin of the range of weights |
| data_end | iterator pointing to the begin of the range of weights |
| weights_begin | iterator pointing to the begin of the range of data |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| std::enable_if< detail::random::is_callable<Functor>::value && detail::random::is_iterator<Iterator>::value, Range<Iterator>>::type hydra::unweight | ( | hydra::detail::BackendPolicy< BACKEND > const & | policy, |
| Iterator | begin, | ||
| Iterator | end, | ||
| Functor const & | functor, | ||
| double | max_pdf = -1.0, |
||
| size_t | rng_seed = 0x8ec74d321e6b5a27, |
||
| size_t | rng_jump = 0 |
||
| ) |
#include <Random.inl>
This functions reorder a dataset to produce an unweighted sample according to.
| functor | . |
| policy | |
| begin | |
| end | |
| functor | |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| std::enable_if< detail::random::is_iterator<IteratorData>::value && detail::random::is_iterator<IteratorWeight>::value, Range<IteratorData>>::type hydra::unweight | ( | IteratorData | data_begin, |
| IteratorData | data_end, | ||
| IteratorData | weights_begin, | ||
| double | max_pdf = -1.0, |
||
| size_t | rng_seed = 0x8ec74d321e6b5a27, |
||
| size_t | rng_jump = 0 |
||
| ) |
#include <Random.h>
This functions reorder a dataset to produce a unweighted sample according to the weights [wbegin, wend].
The length of the range [wbegin, wend] should be equal or greater than the dataset size.
| data_begin | iterator pointing to the begin of the range of weights |
| data_end | iterator pointing to the begin of the range of weights |
| weights_begin | iterator pointing to the begin of the range of data |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| std::enable_if< detail::random::is_callable<Functor>::value && detail::random::is_iterator<Iterator>::value, Range<Iterator>>::type hydra::unweight | ( | Iterator | begin, |
| Iterator | end, | ||
| Functor const & | functor, | ||
| double | max_pdf = -1.0, |
||
| size_t | rng_seed = 0x8ec74d321e6b5a27, |
||
| size_t | rng_jump = 0 |
||
| ) |
#include <Random.inl>
This functions reorder a dataset to produce an unweighted sample according to.
| functor | . |
| begin | |
| end | |
| functor | |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| std::enable_if< detail::random::is_callable<Functor>::value && detail::random::is_iterable<Iterable>::value , Range< decltype(std::declval<Iterable>).begin())>>::type hydra::unweight | ( | hydra::detail::BackendPolicy< BACKEND > const & | policy, |
| Iterable && | iterable, | ||
| Functor const & | functor, | ||
| double | max_pdf = -1.0, |
||
| size_t | rng_seed = 0x8ec74d321e6b5a27, |
||
| size_t | rng_jump = 0 |
||
| ) |
#include <Random.inl>
This functions reorder a dataset to produce an unweighted sample according to.
| functor | . |
| iterable | |
| functor | |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| std::enable_if< detail::random::is_iterable<IterableData>::value && detail::random::is_iterable<IterableWeight>::value, Range< decltype(std::declval<IterableData>).begin())>>::type hydra::unweight | ( | IterableData | data, |
| IterableWeight | weights, | ||
| double | max_pdf = -1.0, |
||
| size_t | rng_seed = 0x8ec74d321e6b5a27, |
||
| size_t | rng_jump = 0 |
||
| ) |
#include <Random.h>
This functions reorder a dataset to produce an unweighted sample according to a weights.
The length of the range
| weights | should be equal or greater than the |
| data | size. |
| weights | the range of weights |
| data | the range corresponding dataset |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| std::enable_if<detail::random::is_callable<Functor>::value && detail::random::is_iterable<Iterable>::value ,Range< decltype(std::declval<Iterable>).begin())> >::type hydra::unweight | ( | Iterable && | iterable, |
| Functor const & | functor, | ||
| double | max_pdf = -1.0, |
||
| size_t | rng_seed = 0x8ec74d321e6b5a27, |
||
| size_t | rng_jump = 0 |
||
| ) |
#include <Random.h>
This functions reorder a dataset to produce an unweighted sample according to.
| functor | . |
| iterable | |
| functor | |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| hydra::fill_random | ( | hydra::detail::BackendPolicy< BACKEND > const & | policy, |
| Iterator | begin, | ||
| Iterator | end, | ||
| FUNCTOR const & | functor, | ||
| size_t | seed = 0x254a0afcf7da74a2, |
||
| size_t | rng_jump = 0 |
||
| ) |
#include <Random.h>
Fill a range with numbers distributed according a user defined distribution using a RNG analytical formula.
Fall back function if RngFormula::Generate() return value is not convertible to functor return value.
| policy | backend to perform the calculation. |
| begin | beginning of the range storing the generated values |
| end | ending of the range storing the generated values |
| functor | distribution to be sampled |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |
| begin | beginning of the range storing the generated values |
| end | ending of the range storing the generated values |
| functor | distribution to be sampled |
| max_pdf | maximum pdf value for accept-reject method. If no value is set, the maximum value in the sample is used. |
| rng_seed | seed for the underlying pseudo-random number generator |
| rng_jump | sequence offset for the underlying pseudo-random number generator |