45 #include "detail/tbb/iterators.h"
46 #include "detail/Engine.hpp"
47 #include "detail/functors/EngineCaller.hpp"
65 #if RANDOM_ITERATOR_R123_USE_AES_NI
67 typedef detail::ars ars;
130 template<
typename DistibutionType,
typename EngineType>
133 typedef detail::EngineCaller<DistibutionType,EngineType> caller_type;
134 typedef random_iterator_tbb::counting_iterator<typename EngineType::advance_type> counting_iterator;
147 typedef random_iterator_tbb::transform_iterator< caller_type, counting_iterator>
iterator;
159 distribution_(distribution),
160 engine_(seed, stream),
164 distribution_.reset();
185 counting_iterator first( 0);
186 caller_type caller(distribution_, seed_, stream_ );
197 counting_iterator last(std::numeric_limits<advance_type>::max());
198 caller_type caller(distribution_, seed_, stream_ );
211 counting_iterator first( 0);
212 caller_type caller(distribution_, seed_, stream_ );
224 return distribution_(engine_);
233 return distribution_;
242 distribution_ = dist;
300 return os <<
"engine: " << be.
getEngine()
321 template<
typename DistibutionType,
typename EngineType>
322 Stream<DistibutionType, EngineType>
323 make_stream( DistibutionType
const& dist, EngineType
const& eng, uint32_t stream ){
representation for streams of pseudorandom numbers
const seed_type & getSeed() const
Get the seed.
result_type operator[](advance_type n) const
Returns the element at specified location n.
void setStream(uint32_t stream)
Set the object's stream number.
void setEngine(engine_type engine)
Set the object's engine.
void setSeed(const seed_type &seed)
Set the seed.
iterator end() const
Returns an iterator to the past last element of the stream.
distribution_type getDistribution() const
Get the distribution.
distribution_type::result_type result_type
type of the STL compliant distribution
Stream()=delete
type of stream iterator
engine_type::seed_type seed_type
Type of RNG state.
random_iterator_tbb::transform_iterator< caller_type, counting_iterator > iterator
type of the result
engine_type::init_type init_type
Type of RNG displacement.
result_type operator()(void)
At each call, this function will produce a pseudorandom number and advance the engine state.
void setDistribution(distribution_type dist)
Set the distribution.
engine_type const & getEngine() const
Get the associated engine.
Stream(distribution_type const &distribution, seed_type seed, uint32_t stream=0)
Constructor.
DistibutionType distribution_type
Type of RNG initializer.
friend std::ostream & operator<<(std::ostream &os, const Stream< DistibutionType, EngineType > &be)
iterator begin() const
Returns an iterator to the first element of the stream.
engine_type::advance_type advance_type
Type of RNG seed.
Stream(Stream< DistibutionType, EngineType > const &other)
Copy constructor.
engine_type::state_type state_type
Engine type.
uint32_t getStream() const
Get the object's stream number.
random_iterator is the top-level namespace which contains all RandomIterator functions and types.
detail::squares3_128 squares3_128
squares3_128 engine
detail::squares3_64 squares3_64
squares3_64 engine
detail::squares4_128 squares4_128
squares4_128 engine
detail::philox philox
philox engine
detail::squares4_64 squares4_64
squares4_64 engine
Stream< DistibutionType, EngineType > make_stream(DistibutionType const &dist, EngineType const &eng, uint32_t stream)
Stream.
detail::threefry threefry
threefry engine