A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jwood000/RcppAlgos/issues/9 below:

Argument upper in combo/permuteGeneral does not work under certain constraints · Issue #9 · jwood000/RcppAlgos · GitHub

Skip to content Navigation Menu

Saved searches Use saved searches to filter your results more quickly

Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert Additional navigation options

Argument upper in combo/permuteGeneral does not work under certain constraints #9

Description

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