Hydra  4.0.1
A header-only templated C++ framework to perform data analysis on massively parallel platforms.
Random.h File Reference
#include <hydra/detail/Config.h>
#include <hydra/detail/BackendPolicy.h>
#include <hydra/Types.h>
#include <hydra/detail/functors/RandomUtils.h>
#include <hydra/detail/functors/DistributionSampler.h>
#include <hydra/detail/TypeTraits.h>
#include <hydra/detail/Iterable_traits.h>
#include <hydra/detail/FunctorTraits.h>
#include <hydra/detail/CompositeTraits.h>
#include <hydra/detail/utility/Utility_Tuple.h>
#include <hydra/detail/ArgumentTraits.h>
#include <hydra/detail/PRNGTypedefs.h>
#include <hydra/Range.h>
#include <hydra/detail/external/hydra_thrust/copy.h>
#include <hydra/detail/external/hydra_thrust/tabulate.h>
#include <hydra/detail/external/hydra_thrust/random.h>
#include <hydra/detail/external/hydra_thrust/distance.h>
#include <hydra/detail/external/hydra_thrust/extrema.h>
#include <hydra/detail/external/hydra_thrust/functional.h>
#include <hydra/detail/external/hydra_thrust/iterator/iterator_traits.h>
#include <hydra/detail/external/hydra_thrust/system/detail/generic/select_system.h>
#include <hydra/detail/external/hydra_thrust/partition.h>
#include <array>
#include <utility>
#include <hydra/detail/Random.inl>
#include <hydra/detail/RandomFill.inl>
Include dependency graph for Random.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  hydra::detail::random::is_callable< T >
 
struct  hydra::detail::random::is_iterable< T >
 
struct  hydra::detail::random::is_iterator< T >
 
struct  hydra::detail::random::is_matching_iterable< Engine, Functor, Iterable >
 

Namespaces

 hydra
 Generic policies definition.
 
 hydra::detail
 
 hydra::detail::random
 

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 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)
 Fall back function if the argument is not an Iterable or if it is not convertible to the Functor return value. More...
 
template<typename Engine = hydra::default_random_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=0x254a0afcf7da74a2, size_t rng_jump=0)
 Fall back function if the argument is not an Iterable or if itis not convertible to the Functor return value. More...
 
template<typename RNG , typename DerivedPolicy , typename Functor , typename Iterator >
std::enable_if< detail::random::is_callable< Functor >::value &&detail::random::is_iterator< Iterator >::value, Range< Iterator > >::type hydra::sample (hydra::thrust::detail::execution_policy_base< DerivedPolicy > const &policy, Iterator begin, Iterator end, double min, double max, Functor const &functor, size_t seed=0xb56c4feeef1b, size_t rng_jump=0)
 Fill a range with numbers distributed according a user defined distribution. 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::sample (hydra::detail::BackendPolicy< BACKEND > const &policy, Iterator begin, Iterator end, double min, double max, Functor const &functor, size_t seed=0xb56c4feeef1b, size_t rng_jump=0)
 Fill a range with numbers distributed according a user defined distribution. 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::sample (Iterator begin, Iterator end, double min, double max, Functor const &functor, size_t seed=0xb56c4feeef1b, size_t rng_jump=0)
 Fill a range with numbers distributed according a user defined distribution. More...
 
template<typename RNG , 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::sample (Iterable &&output, double min, double max, Functor const &functor, size_t seed=0xb56c4feeef1b, size_t rng_jump=0)
 Fill a range with numbers distributed according a user defined distribution. More...
 
template<typename RNG , typename Functor , typename Iterator , hydra::detail::Backend BACKEND, size_t N>
std::enable_if< detail::random::is_callable< Functor >::value &&detail::random::is_iterator< Iterator >::value, Range< Iterator > >::type hydra::sample (hydra::detail::BackendPolicy< BACKEND > const &policy, Iterator begin, Iterator end, std::array< double, N >const &min, std::array< double, N >const &max, Functor const &functor, size_t seed=0xb56c4feeef1b, size_t rng_jump=0)
 Fill a range with numbers distributed according a user defined distribution. More...
 
template<typename RNG = default_random_engine, typename Functor , typename Iterator , size_t N>
std::enable_if< detail::random::is_callable< Functor >::value &&detail::random::is_iterator< Iterator >::value, Range< Iterator > >::type hydra::sample (Iterator begin, Iterator end, std::array< double, N >const &min, std::array< double, N >const &max, Functor const &functor, size_t seed=0xb56c4feeef1b, size_t rng_jump=0)
 Fill a range with numbers distributed according a user defined distribution. More...
 
template<typename RNG = default_random_engine, typename DerivedPolicy , typename Functor , typename Iterator , size_t N>
std::enable_if< detail::random::is_callable< Functor >::value &&detail::random::is_iterator< Iterator >::value, Range< Iterator > >::type hydra::sample (hydra::thrust::detail::execution_policy_base< DerivedPolicy > const &policy, Iterator begin, Iterator end, std::array< double, N >const &min, std::array< double, N >const &max, Functor const &functor, size_t seed=0xb56c4feeef1b, size_t rng_jump=0)
 Fill a range with numbers distributed according a user defined distribution. More...
 
template<typename RNG = default_random_engine, typename Functor , typename Iterable , size_t N>
std::enable_if< detail::random::is_callable< Functor >::value &&detail::random::is_iterable< Iterable >::value,Range< decltype(std::declval< Iterable >).begin())> >::type hydra::sample (Iterable &&output, std::array< double, N >const &min, std::array< double, N >const &max, Functor const &functor, size_t seed=0xb56c4feeef1b, size_t rng_jump=0)
 Fill a range with numbers distributed according a user defined distribution. 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...
 
template<typename RNG = default_random_engine, typename Functor , typename Iterator >
std::enable_if< detail::random::is_callable< Functor >::value &&detail::random::is_iterator< Iterator >::value &&detail::is_tuple_type< decltype(*std::declval< Iterator >))>::value, Range< Iterator > >::type hydra::sample (Iterator begin, Iterator end, typename Functor::argument_type const &min, typename Functor::argument_type const &max, Functor const &functor, size_t seed=0xb56c4feeef1b, size_t rng_jump=0)
 Fill a range with numbers distributed according a user defined distribution. More...