Skip to content

RcppAlgos

2.10.2Package record

High Performance Tools for Combinatorics and Computational Mathematics

16packages dependsuggested by 2
20Kdownloads / year
–test coverage
13/13flavors OK

Overview

About

Provides optimized functions and flexible iterators implemented in C++ for solving problems in combinatorics and computational mathematics. Handles various combinatorial objects including combinations, permutations, integer partitions and compositions, Cartesian products, unordered Cartesian products, and partition of groups. Utilizes the RMatrix class from 'RcppParallel' for thread safety. The combination and permutation functions contain constraint parameters that allow for generation of all results of a vector meeting specific criteria (e.g. finding all combinations such that the sum is between two bounds). Capable of ranking/unranking combinatorial objects efficiently (e.g. retrieve only the nth lexicographical result) which sets up nicely for parallelization as well as random sampling. Gmp support permits exploration where the total number of results is large (e.g. comboSample(10000, 500, n = 4)). Additionally, there are several high performance number theoretic functions that are useful for problems common in computational mathematics. Some of these functions make use of the fast integer division library 'libdivide'. The primeSieve function is based on the segmented sieve of Eratosthenes implementation by Kim Walisch. It is also efficient for large numbers by using the cache friendly improvements originally developed by Tomás Oliveira. Finally, there is a prime counting function that implements Legendre's formula based on the work of Kim Walisch.

Changes in 2.10.2

New Features

  • Added exact dynamic-programming counting for multiset partitions and compositions, including weak compositions and non-weak compositions with zero padding. Large counts use GMP-backed bigz arithmetic where needed.

Bug Fixes

  • Fixed overflow in large multiset permutation counts. For example, permuteCount(2, 2000, freqs = c(1000, 1000)) now returns the correct bigz result (Issue #72, PR #74).
  • Fixed FUN being ignored for factor inputs in comboGeneral() and permuteGeneral(). Factors passed to FUN retain their levels and class, including ordered-factor status (Issue #71, PR #75).
  • Fixed incomplete or unsupported generation of certain multiset compositions with positive input values. When the minimum input value maps internally to zero, it is now correctly treated as an actual part rather than zero padding. This also fixes related iterator, random-access, ranking, and sampling behavior.

Additional Bug Fixes

The following five fixes are covered by Issue #70 and PR #73:

  • Fixed product constraints involving negative values: explicitly supplying lower = 1 now correctly restricts testing to the requested candidate range. Without lower, generation searches for the requested number of matching results and remains serial, even when multiple threads are requested.
  • Fixed parallel iterator batches starting from an incorrect position when constraintFun is supplied without filtering.
  • Corrected iterator positioning after oversized batch requests and exhaustion reporting for constrained iterators.
  • Multi-index access to partition and composition iterators no longer alters subsequent traversal.
Show all changes in 2.10.2Hide the rest of the changes in 2.10.2
  • Improved handling of non-finite count estimates by switching to arbitrary-precision arithmetic. Invalid non-finite numeric arguments are rejected before conversion.

Improvements

  • Updated partition_type labels returned by design functions to use clearer names, such as DistinctNoZero and CompRepZero. Multiset composition designs now distinguish weak and zero-padded cases.
  • Multiset partition generation now validates upper against the computed result count.
  • Improved errors for unsupported partition and composition ranking or sampling, and for cases with no solution.
  • Clarified threading restrictions for special constraints and documented calling startOver() before reusing an iterator after a generation error.
  • Improved handling of unsupported multiset compositions. Counting remains available where supported, while generation now provides clearer errors and guidance about permutation-based alternatives.
  • Enhanced compositionsDesign() and partitionsDesign() diagnostics. Unknown counts are now reported as NA rather than preventing design inspection. Design output also includes additional classification metadata, improved GMP count formatting, and NA for unavailable equation checks.

Performance

  • Replaced enumeration-based multiset partition and composition counting with dynamic programming.
  • Improved GMP-backed multiset counting with specialized partition and composition implementations that reduce intermediate allocation and arbitrary-precision arithmetic overhead.
  • Reduced intermediate allocation and copying when generating multiset partitions and sum-constrained multiset permutations.

From inst/NEWS.Rd in the release

Install

Health

CRAN checks
13OK
Slowest check: 14.6 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-09-08
  • ERROR12 OK, 1 ERROR2026-09-07
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-05-10
Show 3 earlier changesHide 3 earlier changes
  • WARNING12 OK, 1 WARNING2026-05-09
  • OK12 OK2026-04-25
  • NOTE11 OK, 3 NOTE2026-03-10
Advisories

none known

Documentation

In release 2.10.2
READMEYes · 436 wordsVignettesYes · 10 · staticNEWSYes · mentions 2.10.2Citation fileYes · software entry onlyWebsiteYes · pkgdown
Help pages
35includes a package overview page
Examples that run
100%34 run in a plain check
Exported functions with examples
100%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
57%

Downloads

20K
CRAN downloads in the past year
Rank #3,329 · ~55/day · ~1.7K/mo
Daily download trend is not available in this view yet.
1.4K30 days
3.3K90 days
20K1 year
Compare downloads with other packages →
Also on612 r2u18 autocran5.4K conda_forge161 c2d4u

Repository

51Stars
5Forks
8Open issues
0Open PRs
6Releases
1,740Commits
5Commit identities
permutationprimesievecombinatoricscombinationsfactorizationparallelprime-factorizationsnumber-theory
License file reads as GPL-2.0 · 1,740 commits · Last activity 2026-10-17 · 0% stars, 30d
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
22
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2025-09-23 · 462026-09-03 · 51
PracticesBeta

7 development-tooling and community-health practices detected across 4 families in the upstream repository

Checks run against github.com/jwood000/rcppalgos on 2026-10-11.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-10-06 · The repository has a site deploy workflow

pkgdown site last built 2026-10-06, before release 2.10.2 (2026-10-17)

Coverage (1)
Coverage reporting (Codecov)
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
11 external dependencies (excludes base and recommended)

Installing RcppAlgos adds 2 packages (1 with compiled code, 461 KB of source tarballs). Heaviest: cpp11 298 KB, gmp 163 KB.

Depends (0)
none
Imports (2)
gmpmethods
LinkingTo (1)
Enhances (0)
none
Reverse dependencies
16direct
2indirect
Depends 1 · Imports 15
Suggested by 2
Show all 18 packagesHide all 18 packages
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

People & History

People (2)
Author, Maintainer since 0.1.0 (2017)
Contributor · added in 2.10.2
Original author of RMatrix.h, copied from RcppParallel
Releases (40)

Pick two releases to compare their code metrics.

  • 2.10.2Latest
    record
    2026-10-17 · current release · diff ↗ ·
    listed once in CRAN's queue
    Seen in one reading of CRAN's incoming queue, at 2026-10-17 21:55 UTC, so it stayed less than the time between readings.
  • 2.10.1
    record
    2026-06-08 · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • 2.10.0
    record
    2026-03-08 · diff ↗
  • 2.9.5
    record
    2026-01-29 · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • 2.9.3
    record
    2025-02-03 · diff ↗
  • 2.9.1
    record
    2025-01-27 · diff ↗ ·
    added 4 exports
    expandGrid, expandGridCount, expandGridSample, expandGridIter
  • 2.8.5
    record
    2024-10-11 · diff ↗
  • R
    R 4.4.0 released · 2024-04-24
  • 2.8.3
    record
    2023-12-10 · diff ↗
  • 2.8.2
    record
    2023-10-03 · diff ↗ ·
    added 1 export
    comboGroupsIter
  • 2.8.1
    record
    2023-08-14 · diff ↗
  • 2.8.0
    record
    2023-07-11 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • 2.7.2
    record
    2023-02-11 · diff ↗
Show 34 earlier eventsHide 34 earlier events
  • 2.7.1
    record
    2023-02-06 · diff ↗
  • 2.6.0
    record
    2022-08-15 · diff ↗ ·
    added 8 exports
    compositionsGeneral, compositionsCount, compositionsSample, comboRank, permuteRank, partitionsRank, compositionsRank, compositionsIter
  • R
    R 4.2.0 released · 2022-04-22
  • 2.5.3
    record
    2022-03-31 · diff ↗
  • 2.5.0
    record
    2022-03-16 · diff ↗ ·
    added 4 exports
    partitionsGeneral, partitionsCount, partitionsSample, partitionsIter
  • 2.4.3
    record
    2021-05-30 · diff ↗ ·
    added 1 export
    comboGrid
  • R
    R 4.1.0 released · 2021-05-18
  • R
    R 4.0.0 released · 2020-04-24
  • 2.4.1
    record
    2020-03-24 · diff ↗ ·
    added 2 exports
    comboIter, permuteIter
  • 2.3.6
    record
    2020-01-29 · diff ↗
  • 2.3.5
    record
    2020-01-26 · diff ↗ ·
    added 3 exports
    comboGroups, comboGroupsCount, comboGroupsSample
  • 2.3.4
    record
    2019-07-03 · diff ↗
  • 2.3.3
    record
    2019-06-30 · diff ↗
  • R
    R 3.6.0 released · 2019-04-26
  • 2.3.2
    record
    2019-04-14 · diff ↗
  • 2.3.1
    record
    2019-03-21 · diff ↗
  • 2.3.0
    record
    2019-03-17 · diff ↗ ·
    added 1 export
    stdThreadMax
  • 2.2.0
    record
    2018-09-15 · diff ↗
  • 2.1.0
    record
    2018-09-11 · diff ↗
  • 2.0.3
    record
    2018-06-30 · diff ↗
  • 2.0.2
    record
    2018-06-14 · diff ↗
  • 2.0.1
    record
    2018-06-10 · diff ↗ ·
    added 4 exports
    comboCount, permuteCount, comboSample, permuteSample
  • R
    R 3.5.0 released · 2018-04-23
  • 1.0.1
    record
    2018-03-10 · diff ↗
  • 1.0.0
    record
    2018-03-07 · diff ↗ ·
    removed 2 exports
    primeFactorizationList, divisorsList
    added 6 exports
    primeFactorizeSieve, divisorsSieve, primeFactorize, divisorsRcpp, isPrimeRcpp, primeCount
  • 0.2.5
    record
    2018-01-04 · diff ↗
  • 0.2.4
    record
    2017-12-18 · diff ↗
  • 0.2.2
    record
    2017-12-15 · diff ↗
  • 0.2.1
    record
    2017-11-30 · diff ↗
  • 0.2.0
    record
    2017-11-28 · diff ↗ ·
    added 1 export
    permuteGeneral
  • 0.1.2
    record
    2017-11-03 · diff ↗
  • 0.1.1
    record
    2017-11-03 · diff ↗
  • 0.1.0
    record
    2017-10-26
  • R
    R 3.4.0 released · 2017-04-21
Across CRAN, the median accepted release of the past year spent 19 hours in the queue, 90% under 11 days.How queue time is measured

Package metadata

First published
2017-10-26
Total releases
40 / 9 yrs
License
GPL (>= 2) OSI
Download size
1.6 MB
Appears in task views

Cite

Cite this package

Run in R for the authors' entry:

citation("RcppAlgos")

The package provides a citation file, so citation() returns the authors' own entry.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for RcppAlgos version 2.10.2 [Data set]. HJJB, LLC. Data release v2026-10-18. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy