setMaxProblemSize: Set the maximum problem size

View source: R/feasible.R

setMaxProblemSizeR Documentation

Set the maximum problem size


Helper function to ease setting the largest problem size to be accepted by pairmatch or fullmatch.


setMaxProblemSize(size = Inf)



Positive integer, or Inf


The function sets the optmatch_max_problem_size global option. The option ships with the option pre-set to a value that's relatively small, smaller than what most modern computers can handle. Invoking this function with no argument re-sets the optmatch_max_problem_size option to Inf, effectively disabling checks on problem size. Unless you're working with an older computer, it probably makes sense for most users to do this, at least until they determine what problem sizes are too large for their machines. (You'll know that when your R crashes, or simply takes too long for your taste.)

To determine the size of a problem without subproblems, i.e. exact matching categories, use match_on to set up and store the problem distance, then apply length to the result. If there were exact matching constraints imposed during the creation of the distance, then you'll want to look at the largest size of a subproblem. Apply findSubproblems to your distance, creating a list, say dlist, of your distances; then do sapply(dlist, length) to determine the sizes of the subproblems.


Ben B. Hansen

See Also


optmatch documentation built on Nov. 16, 2023, 5:06 p.m.