31 #include <random_iterator/detail/tbb/iterators.h> 32 #include <random_iterator/detail/Engine.hpp> 33 #include <random_iterator/detail/functors/EngineCaller.hpp> 50 #if RANDOM_ITERATOR_R123_USE_AES_NI 51 typedef detail::ars ars;
115 template<
typename DistibutionType,
typename EngineType>
118 typedef detail::EngineCaller<DistibutionType,EngineType> caller_type;
119 typedef random_iterator_tbb::counting_iterator<typename EngineType::advance_type> counting_iterator;
132 typedef random_iterator_tbb::transform_iterator< caller_type, counting_iterator>
iterator;
143 Stream(distribution_type
const& distribution, seed_type seed, uint32_t stream=0):
144 distribution_(distribution),
145 engine_(seed, stream),
168 counting_iterator first( 0);
169 caller_type caller(distribution_, seed_, stream_ );
178 inline iterator
end()
const{
180 counting_iterator last(std::numeric_limits<advance_type>::max());
181 caller_type caller(distribution_, seed_, stream_ );
194 caller_type caller(distribution_, seed_, stream_ );
206 return distribution_(engine_);
215 return distribution_;
224 distribution_ = dist;
283 distribution_type distribution_;
298 template<
typename DistibutionType,
typename EngineType>
300 make_stream( DistibutionType
const& dist, EngineType eng, uint32_t stream ){
detail::squares3_64 squares3_64
squares3_64 engine
Stream< DistibutionType, EngineType > make_stream(DistibutionType const &dist, EngineType eng, uint32_t stream)
Stream.
result_type operator[](advance_type n) const
Returns the element at specified location n.
const seed_type & getSeed() const
Get the seed.
detail::threefry threefry
threefry engine
result_type operator()(void)
At each call, this function will produce a pseudorandom number and advance the engine state...
iterator end() const
Returns an iterator to the past last element of the stream.
uint32_t getStream() const
Get the object's stream number.
distribution_type::result_type result_type
type of the STL compliant distribution
engine_type::seed_type seed_type
Type of RNG state.
random_iterator is the top-level namespace which contains all RandomIterator functions and types...
detail::squares4_128 squares4_128
squares4_128 engine
representation for streams of pseudorandom numbers
engine_type::state_type state_type
Engine type.
engine_type::advance_type advance_type
Type of RNG seed.
distribution_type getDistribution() const
Get the distribution.
DistibutionType distribution_type
Type of RNG initializer.
void setDistribution(distribution_type dist)
Set the distribution.
void setStream(uint32_t stream)
Set the object's stream number.
void setEngine(engine_type engine)
Set the object's engine.
Stream(Stream< DistibutionType, EngineType > const &other)
Copy constructor.
detail::squares4_64 squares4_64
squares4_64 engine
Stream(distribution_type const &distribution, seed_type seed, uint32_t stream=0)
Constructor.
random_iterator_tbb::transform_iterator< caller_type, counting_iterator > iterator
type of the result
void setSeed(const seed_type &seed)
Set the seed.
engine_type getEngine() const
Get the associated engine.
engine_type::init_type init_type
Type of RNG displacement.
Stream()=delete
type of stream iterator
detail::philox philox
philox engine
iterator begin() const
Returns an iterator to the first element of the stream.
detail::squares3_128 squares3_128
squares3_128 engine