RcppAlgos2.9.3 package

High Performance Tools for Combinatorics and Computational Mathematics

Cartesian-Class

S4-class for Exposing C++ Cartesian Class

combinatoricsCount

Number of combinations/permutations

combinatoricsGeneral

Generate Combinations and Permutations of a Vector with/without Constr...

combinatoricsIterator

Combination and Permutation Iterator

combinatoricsRank

Rank Combinations and Permutations

combinatoricsSample

Sample Combinations and Permutations

Combo-Class

S4-classes for Exposing C++ Combinatorial Classes

comboGrid

Unordered Cartesian Product

ComboGroups-Class

S4-class for Exposing C++ ComboGroups Class

comboGroups

Partition a Vector into Groups

comboGroupsCount

Number of Partitions of a Vector into Groups

comboGroupsIterator

comboGroups Iterator

comboGroupsSample

Sample Partitions of a Vector into Groups

Constraints-Class

S4-class for Exposing C++ Constraints Class

divisorsRcpp

Vectorized Factorization (Complete)

divisorsSieve

Generate Complete Factorization for Numbers in a Range

eulerPhiSieve

Apply Euler's Phi Function to Every Element in a Range

expandGrid

Cartesian Product

expandGridCount

Count of the Cartesian Product

expandGridIterator

expandGrid Iterator

expandGridSample

Sample the Cartesian Product

isPrimeRcpp

Vectorized Primality Test

numDivisorSieve

Apply Divisor Function to Every Element in a Range

Partitions-Class

S4-class for Exposing C++ Partitions Class

partitionsCount

Number of Partitions/Compositions

partitionsGeneral

Generate Partitions/Compositions

partitionsIterator

Partition/Composition Iterator

partitionsRank

Rank Partitions/Compositions

partitionsSample

Sample Partitions/Compositions

primeCount

Prime Counting Function π(x)\pi(x)

primeFactorize

Vectorized Prime Factorization

primeFactorizeSieve

Generate Prime Factorization for Numbers in a Range

primeSieve

Generate Prime Numbers

RcppAlgos-package

High Performance Tools for Combinatorics and Computational Mathematics

stdThreadMax

Max Number of Concurrent Threads

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.

  • Maintainer: Joseph Wood
  • License: GPL (>= 2)
  • Last published: 2025-02-03