32 #include "detail/tbb/iterators.h" 33 #include "detail/Engine.hpp" 34 #include "detail/functors/EngineCaller.hpp" 52 #if RANDOM_ITERATOR_R123_USE_AES_NI 53 typedef detail::ars ars;
117 template<
typename DistibutionType,
typename EngineType>
120 typedef detail::EngineCaller<DistibutionType,EngineType> caller_type;
121 typedef random_iterator_tbb::counting_iterator<typename EngineType::advance_type> counting_iterator;
134 typedef random_iterator_tbb::transform_iterator< caller_type, counting_iterator>
iterator;
145 Stream(distribution_type
const& distribution, seed_type seed, uint32_t stream=0):
146 distribution_(distribution),
147 engine_(seed, stream),
170 counting_iterator first( 0);
171 caller_type caller(distribution_, seed_, stream_ );
180 inline iterator
end()
const{
182 counting_iterator last(std::numeric_limits<advance_type>::max());
183 caller_type caller(distribution_, seed_, stream_ );
196 caller_type caller(distribution_, seed_, stream_ );
208 return distribution_(engine_);
217 return distribution_;
226 distribution_ = dist;
283 friend inline std::ostream& operator<<(std::ostream& os, const Stream<DistibutionType, EngineType>& be){
284 return os <<
"engine: " << be.getEngine()
285 <<
" stream: "<< be.getStream()
286 <<
" distribution: " << be.getDistribution() ;
290 distribution_type distribution_;
305 template<
typename DistibutionType,
typename EngineType>
307 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