Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
RcppArmadillo sample with different probabilities #275
I've found a problem with RcppArmadillo sample function when the sampling probabilities are not constant.
and the output when the function is called in R:
Apparently the function is sampling from a discrete distribution with uniform probabilities.
Ouch. Thanks for @emanuelegdepaoli for the lovely bug report.
The input prob vector is now passed as const and copied inside sample_main.