32 #ifndef VSMC_RESAMPLE_STRATIFIED_HPP
33 #define VSMC_RESAMPLE_STRATIFIED_HPP
41 typedef cxx11::integral_constant<ResampleScheme, Stratified>
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 for (std::size_t i = 0; i != N; ++i)
62 uptr[i] = runif(rng) * delta + i * delta;
63 inversion_(M, N, weight, uptr, replication,
true);
69 std::vector<double, AlignedAllocator<double> > u01_;
74 #endif // VSMC_RESAMPLE_STRATIFIED_HPP
Resample forward decleration.
cxx11::integral_constant< ResampleScheme, Stratified > ResampleStratified