32 #ifndef VSMC_RNG_RNG_SET_HPP
33 #define VSMC_RNG_RNG_SET_HPP
46 #ifndef VSMC_RNG_SET_TYPE
47 #define VSMC_RNG_SET_TYPE ::vsmc::RngSet< ::vsmc::Threefry4x64, ::vsmc::Vector>
52 template <
typename = Threefry4x64,
typename = Vector>
class RngSet;
56 template <
typename RngType>
64 explicit RngSet (size_type N = 0) : size_(N) {seed();}
66 size_type
size ()
const {
return size_;}
72 rng_type &operator[] (size_type) {
return rng_;}
82 template <
typename RngType>
88 typedef typename std::vector<rng_type, AlignedAllocator<rng_type> >
::
91 explicit RngSet (size_type N = 0) : rng_(N, rng_type()) {seed();}
93 size_type
size ()
const {
return rng_.size();}
105 for (std::size_t i = rng_.size(); i != n; ++i) {
113 for (size_type i = 0; i != rng_.size(); ++i)
117 rng_type &operator[] (size_type
id) {
return rng_[id];}
121 std::vector<rng_type, AlignedAllocator<rng_type> > rng_;
134 #endif // VSMC_RNG_RNG_SET_HPP
static SeedGenerator< ID, ResultType > & instance()
void resize(std::size_t n)
std::vector< rng_type, AlignedAllocator< rng_type > >::size_type size_type
Class template argument used for scalar variant.
#define VSMC_DEFINE_TYPE_DISPATCH_TRAIT(Outer, Inner, Default)
#define VSMC_RNG_SET_TYPE
Default RNG set type.
Class template argument used for vector variant.