32 #ifndef VSMC_RESAMPLE_SYSTEMATIC_HPP
33 #define VSMC_RESAMPLE_SYSTEMATIC_HPP
41 typedef cxx11::integral_constant<ResampleScheme, Systematic>
53 template <
typename IntType,
typename RngType>
54 void operator() (std::size_t M, std::size_t N, RngType &rng,
55 const double *weight, IntType *replication)
58 double *
const uptr = &u01_[0];
59 cxx11::uniform_real_distribution<double> runif(0, 1);
60 const double delta = 1.0 / N;
61 const double u = runif(rng) * delta;
62 for (std::size_t i = 0; i != N; ++i)
63 uptr[i] = u + i * delta;
64 inversion_(M, N, weight, uptr, replication,
true);
70 std::vector<double, AlignedAllocator<double> > u01_;
75 #endif // VSMC_RESAMPLE_SYSTEMATIC_HPP
Resample forward decleration.
cxx11::integral_constant< ResampleScheme, Systematic > ResampleSystematic