jwood000/RcppAlgos

function "permuteGeneral" get unexpected numbers

dodoflyy opened this issue · 1 comments

Hello, this may be a bug:

> y <- as.integer(RcppAlgos::permuteGeneral(1:4, m = 13, repetition = TRUE))
> head(y[y == 0])
integer(0)
> y <- as.integer(RcppAlgos::permuteGeneral(1:4, m = 14, repetition = TRUE))
# should not generate zeros
> head(y[y == 0])
[1] 0 0 0 0 0 0
> length(y[y == 0])
[1] 2617245696

Same problem as #38

Fixed by #43

@GuoYu-Peng,

I recently published 2.7.1 (https://cran.r-project.org/package=RcppAlgos) with these bugs fixed. There is one platform giving an error (it's the old windows release, which hopefully you don't have). It's an easy fix and you should see 2.7.2 out shortly.

If you have any issues, please let me know.

Thanks for reporting!