NrParts: Find the number of partitions for a given total Q and number...

Description Usage Arguments Examples

View source: R/rpartitions.R

Description

This function was recoded and modified from GAP source code: www.gap-system.org. Modifications for speed were based on the proposition that the number of partitions of Q having N parts is equal to the number of partitions of Q having N parts is equal to the number of partitions of Q - N, if N > Q/2 (for odd Q) or if N >= Q/2 (for even Q)

Usage

1
  NrParts(Q, N = NULL, use_c = TRUE)

Arguments

Q

Total sum

N

Number of items to sum across, if not specified than all possible values are considered

use_c

logical, defaults to TRUE, the number of partitions is computed in c

Examples

1
2
NrParts(100)
NrParts(100, 10)

rpartitions documentation built on May 1, 2019, 8:03 p.m.