Package: RcppAlgos 2.8.5

Joseph Wood

RcppAlgos: High Performance Tools for Combinatorics and Computational Mathematics

Provides optimized functions and flexible combinatorial iterators implemented in C++ for solving problems in combinatorics and computational mathematics. Utilizes the RMatrix class from 'RcppParallel' for thread safety. There are combination/permutation functions with constraint parameters that allow for generation of all results of a vector meeting specific criteria (e.g. generating integer partitions/compositions or finding all combinations such that the sum is between two bounds). Capable of generating specific combinations/permutations (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.

Authors:Joseph Wood [aut, cre]

RcppAlgos_2.8.5.tar.gz
RcppAlgos_2.8.5.tar.gz(r-4.5-noble)RcppAlgos_2.8.5.tar.gz(r-4.4-noble)
RcppAlgos_2.8.5.tgz(r-4.4-emscripten)RcppAlgos_2.8.5.tgz(r-4.3-emscripten)
RcppAlgos.pdf |RcppAlgos.html
RcppAlgos/json (API)
NEWS

# Install 'RcppAlgos' in R:
install.packages('RcppAlgos', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/jwood000/rcppalgos/issues

Uses libs:
  • gmp– Multiprecision arithmetic library
  • c++– GNU Standard C++ Library v3

6.72 score 12 packages 151 scripts 1.2k downloads 35 exports 2 dependencies

Last updated 15 days agofrom:3384972e32. Checks:OK: 2. Indexed: no.

TargetResultDate
Doc / VignettesOKOct 12 2024
R-4.5-linux-x86_64OKOct 12 2024

Exports:comboCountcomboGeneralcomboGridcomboGroupscomboGroupsCountcomboGroupsItercomboGroupsSamplecomboItercomboRankcomboSamplecompositionsCountcompositionsGeneralcompositionsItercompositionsRankcompositionsSampledivisorsRcppdivisorsSieveeulerPhiSieveisPrimeRcppnumDivisorSievepartitionsCountpartitionsGeneralpartitionsIterpartitionsRankpartitionsSamplepermuteCountpermuteGeneralpermuteIterpermuteRankpermuteSampleprimeCountprimeFactorizeprimeFactorizeSieveprimeSievestdThreadMax

Dependencies:cpp11gmp

Attacking Problems Related to the Subset Sum Problem

Rendered fromSubsetSum.Rmdusingknitr::rmarkdownon Oct 12 2024.

Last update: 2023-12-10
Started: 2020-01-26

Cartesian Products and Partitions of Groups

Rendered fromOtherCombinatorics.Rmdusingknitr::rmarkdownon Oct 12 2024.

Last update: 2023-12-10
Started: 2022-03-16

Combination and Permutation Basics

Rendered fromGeneralCombinatorics.Rmdusingknitr::rmarkdownon Oct 12 2024.

Last update: 2023-12-10
Started: 2020-01-26

Combinatorial Iterators in RcppAlgos

Rendered fromCombinatoricsIterators.Rmdusingknitr::rmarkdownon Oct 12 2024.

Last update: 2023-12-10
Started: 2020-03-24

Combinatorial Sampling and Ranking

Rendered fromCombinatorialSampling.Rmdusingknitr::rmarkdownon Oct 12 2024.

Last update: 2023-12-10
Started: 2020-01-26

Computational Mathematics Overview

Rendered fromComputationalMathematics.Rmdusingknitr::rmarkdownon Oct 12 2024.

Last update: 2023-12-10
Started: 2020-01-26

Constraints, Partitions, and Compositions

Rendered fromCombPermConstraints.Rmdusingknitr::rmarkdownon Oct 12 2024.

Last update: 2023-12-10
Started: 2020-01-26

High Performance Benchmarks

Rendered fromHighPerformanceBenchmarks.Rmdusingknitr::rmarkdownon Oct 12 2024.

Last update: 2023-12-10
Started: 2020-03-24

Readme and manuals

Help Manual

Help pageTopics
High Performance Tools for Combinatorics and Computational MathematicsRcppAlgos-package RcppAlgos
S4-classes for Exposing C++ Combinatorial Classes$,Combo-method $,ComboApply-method $,ComboRes-method Combo-class ComboApply-class ComboRes-class
Number of combinations/permutationscomboCount comboCount.default comboCount.list comboCount.table permuteCount permuteCount.default permuteCount.list permuteCount.table
Generate Combinations and Permutations of a Vector with/without ConstraintscomboGeneral comboGeneral.default comboGeneral.factor comboGeneral.integer comboGeneral.list comboGeneral.logical comboGeneral.numeric comboGeneral.table permuteGeneral permuteGeneral.default permuteGeneral.factor permuteGeneral.integer permuteGeneral.list permuteGeneral.logical permuteGeneral.numeric permuteGeneral.table
Efficient Version of 'expand.grid' Where order Does Not MattercomboGrid
Partition a Vector into GroupscomboGroups
S4-class for Exposing C++ ComboGroups Class$,ComboGroups-method ComboGroups-class
Number of Partitions of a Vector into GroupscomboGroupsCount
comboGroups IteratorcomboGroupsIter
Sample Partitions of a Vector into GroupscomboGroupsSample
Combination and Permutation IteratorcomboIter comboIter.default comboIter.factor comboIter.integer comboIter.list comboIter.logical comboIter.numeric comboIter.table permuteIter permuteIter.default permuteIter.factor permuteIter.integer permuteIter.list permuteIter.logical permuteIter.numeric permuteIter.table
Rank Combinations and PermutationscomboRank permuteRank
Sample Combinations and PermutationscomboSample comboSample.default comboSample.factor comboSample.integer comboSample.list comboSample.logical comboSample.numeric comboSample.table permuteSample permuteSample.default permuteSample.factor permuteSample.integer permuteSample.list permuteSample.logical permuteSample.numeric permuteSample.table
S4-class for Exposing C++ Constraints Class$,Constraints-method Constraints-class
Vectorized Factorization (Complete)divisorsRcpp
Generate Complete Factorization for Numbers in a RangedivisorsSieve
Apply Euler's Phi Function to Every Element in a RangeeulerPhiSieve
Vectorized Primality TestisPrimeRcpp
Apply Divisor Function to Every Element in a RangenumDivisorSieve
S4-class for Exposing C++ Partitions Class$,Partitions-method Partitions-class
Number of Partitions/CompositionscompositionsCount compositionsCount.default compositionsCount.table partitionsCount partitionsCount.default partitionsCount.table
Generate Partitions/CompositionscompositionsGeneral compositionsGeneral.default compositionsGeneral.table partitionsGeneral partitionsGeneral.default partitionsGeneral.table
Partition/Composition IteratorcompositionsIter compositionsIter.default compositionsIter.table partitionsIter partitionsIter.default partitionsIter.table
Rank Partitions/CompositionscompositionsRank partitionsRank
Sample Partitions/CompositionscompositionsSample compositionsSample.default compositionsSample.table partitionsSample partitionsSample.default partitionsSample.table
Prime Counting Function pi(x)primeCount
Vectorized Prime FactorizationprimeFactorize
Generate Prime Factorization for Numbers in a RangeprimeFactorizeSieve
Generate Prime NumbersprimeSieve
Max Number of Concurrent ThreadsstdThreadMax