The argument upper
works properly on standard combinations/permutations however when a constraint is applied and the total number of results exceeds 2^31 - 1
, it does not have the proper affect. Observe:
Working examples:
## Example 1
a1 <- permuteGeneral(0:100, 25, T, upper = 1e5)
dim(a1)
[1] 100000 25
permuteCount(0:100, 25, T)
Big Integer ('bigz') :
[1] 128243199501723361359275202929838997632567303002501
## Example 2
a2 <- permuteGeneral(0:100, 25, T,
constraintFun = "sum",
comparisonFun = "==",
limitConstraints = 200,
upper = 1e5)
dim(a2)
[1] 100000 25
all(rowSums(a2) == 200)
[1] TRUE
And now the special case when we have an integer partition set up (i.e. limitConstraints = 100
in the above):
a3 <- permuteGeneral(0:100, 25, T,
constraintFun = "sum",
comparisonFun = "==",
limitConstraints = 100,
upper = 1e5)
Error in CombinatoricsRcpp(v, m, repetition, freqs, lower, upper, constraintFun, :
The number of rows cannot exceed 2^31 - 1.
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4