32 #ifndef VSMC_RESAMPLE_RESIDUAL_STRATIFIED_HPP 33 #define VSMC_RESAMPLE_RESIDUAL_STRATIFIED_HPP 46 template <
typename IntType,
typename RNGType>
47 void operator()(std::size_t M, std::size_t N, RNGType &rng,
48 const double *weight, IntType *replication)
56 add(M, replication, integ.data(), replication);
71 #endif // VSMC_RESAMPLE_RESIDUAL_STRATIFIED_HPP Residual stratified resampling.
void resample_trans_u01_rep(std::size_t M, std::size_t N, const double *weight, U01SeqType &&u01seq, IntType *replication)
Transform uniform [0, 1] sequence into replication numbers.
Generate a fixed length sequence of uniform random variates by stratified sampling.
typename std::conditional< std::is_scalar< T >::value, std::vector< T, AlignedAllocator< T >>, std::vector< T >>::type Vector
AlignedVector for scalar type and std::vector for others.
Stratified resampling on residuals.
void operator()(std::size_t M, std::size_t N, RNGType &rng, const double *weight, IntType *replication)
std::size_t resample_trans_residual(std::size_t M, std::size_t N, const double *weight, double *resid, IntType *integ)
Transform normalized weights to normalized residual and integrals, and return the number of remaining...
void add(std::size_t n, const float *a, const float *b, float *y)
Type trait of ResampleScheme parameter.