|
1 | 1 | #!/usr/bin/r -t |
2 | 2 | ## |
3 | | -## Copyright (C) 2013 Romain Francois |
4 | | -## Copyright (C) 2014 - 2019 Christian Gunning and Dirk Eddelbuettel |
5 | | -## Copyright (C) 2019 Dirk Eddelbuettel |
| 3 | +## Copyright (C) 2013-2026 Romain Francois |
| 4 | +## Copyright (C) 2014-2026 Christian Gunning and Dirk Eddelbuettel |
| 5 | +## Copyright (C) 2019-2026 Dirk Eddelbuettel |
6 | 6 | ## |
7 | 7 | ## This file is part of RcppArmadillo. |
8 | 8 | ## |
@@ -32,17 +32,19 @@ Rcpp::sourceCpp("cpp/rmultinom.cpp") |
32 | 32 |
|
33 | 33 | ## test cases |
34 | 34 | ## should be indentical between R and C++ |
35 | | -tests <- list( |
36 | | - vanilla=list( n=5, size=100, prob=rep(1/10,10)), |
37 | | - big=list( n=5, size=1e6, prob=rep(1/1e3,1e3)), |
38 | | - fixup.prob=list( n=10, size=1e5, prob=1:10), |
39 | | - n0=list( n=0, size=5, prob=1:10), |
40 | | - size0=list( n=10, size=0, prob=1:10) |
| 35 | +tests <- list(vanilla=list( n=5, size=100, prob=rep(1/10,10)), |
| 36 | + fixup.prob=list( n=10, size=1e5, prob=1:10), |
| 37 | + n0=list( n=0, size=5, prob=1:10), |
| 38 | + size0=list( n=10, size=0, prob=1:10) |
41 | 39 | ) |
| 40 | +## In April 2026, R-devel improved rmultinom() vai a more precise calculation |
| 41 | +## Our calculation here corresponds to the prior version and this test is affected |
| 42 | +if (getRversion() < "4.7.0") |
| 43 | + tests[["big"]] <- list(n=5, size=1e6, prob=rep(1/1e3,1e3)) |
42 | 44 |
|
43 | | -fail.tests <- list( |
44 | | - na.prob=list( n=7, size=100, prob=c(1:10,NA)), |
45 | | - prob0=list( n=10, size=100, prob=0) |
| 45 | + |
| 46 | +fail.tests <- list(na.prob=list( n=7, size=100, prob=c(1:10,NA)), |
| 47 | + prob0=list( n=10, size=100, prob=0) |
46 | 48 | ) |
47 | 49 |
|
48 | 50 | ## these give errors |
|
0 commit comments