You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #60 from jwood000/docs-distinct-compositions
docs: reorganize combinatorics documentation and refresh README
Add dedicated vignettes for integer partitions and integer compositions
and refactor the constraints vignette to focus on constraint-driven
enumeration.
Improve README messaging and structure to better highlight key package
features and unique algorithms (e.g. multiset partitions, comboGroups,
comboGrid, and distinct compositions).
Switch vignette output to prettydoc::html_pretty and update vignette
metadata. Regenerate documentation outputs.
Minor repository housekeeping:
* move CRAN release checklist to dev/
* ignore dev/ in .Rbuildignore
Copy file name to clipboardExpand all lines: README.md
+52-96Lines changed: 52 additions & 96 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,25 +11,39 @@
11
11
[](<https://app.codecov.io/gh/jwood000/RcppAlgos?branch=main>)
12
12
<!-- badges: end -->
13
13
14
-
A collection of highperformance functions and iterators implemented in C++ for solving problems in combinatorics and computational mathematics.
14
+
`RcppAlgos` provides high-performance algorithms for working with combinatorial objects in R. It includes efficient implementations for combinations, permutations, integer partitions, and compositions, with support for multisets, constraints, and extremely large search spaces through memory-efficient iterators.
15
15
16
-
## Featured Functions
16
+
The package also implements specialized algorithms for problems rarely supported by other combinatorics libraries, including partitions of multisets, partitions of groups, and order-invariant Cartesian products. Many routines support ranking and unranking, parallel computation, and reproducible sampling. The package also includes fast prime number utilities built on the excellent work of [Kim Walisch](https://github.com/kimwalisch).
17
17
18
-
-**`{combo|permute}General`**: Generate all combinations/permutations of a vector (including [multisets](<https://en.wikipedia.org/wiki/Multiset>)) meeting specific criteria.
19
-
-**`{partitions|compositions}General`**: Efficient algorithms for partitioning numbers under various constraints
20
-
-**`{expandGrid|comboGrid}`**: Generate traditional Cartesian product as well as the product where order does not matter.
21
-
-**`{combo|permute|partitions|compositions|expandGrid|comboGroups}Sample`**: Generate reproducible random samples
22
-
-**`{combo|permute|partitions|compositions|expandGrid|comboGroups}Iter`**: Flexible iterators allow for bidirectional iteration as well as random access.
23
-
-**`primeSieve`**: Fast prime number generator
24
-
-**`primeCount`**: Prime counting function using [Legendre's formula](<https://mathworld.wolfram.com/LegendresFormula.html>)
18
+
## Key Features
25
19
26
-
The `primeSieve` function and the `primeCount` function are both based off of the excellent work by [Kim Walisch](<https://github.com/kimwalisch>). The respective repos can be found here: [kimwalisch/primesieve](<https://github.com/kimwalisch/primesieve>); [kimwalisch/primecount](<https://github.com/kimwalisch/primecount>)
20
+
- High-performance generation of combinations and permutations
21
+
- Integer partitions and compositions under flexible constraints
22
+
- Support for multisets and restricted combinatorial structures
23
+
- Memory-efficient iterators for exploring very large combinatorial spaces
24
+
- Ranking and unranking algorithms
25
+
- Parallel computation support
26
+
- Fast prime number utilities:
27
+
-`primeSieve` for generating primes
28
+
-`primeCount` for counting primes using Legendre’s formula
29
+
-`primeFactorize` for prime factorization
30
+
31
+
RcppAlgos is designed to handle combinatorial problems ranging from small enumerations to extremely large search spaces where generating all results at once would be impractical.
27
32
28
-
Additionally, many of the sieving functions make use of the fast integer division library [libdivide](<https://github.com/ridiculousfish/libdivide>) by [ridiculousfish](<https://github.com/ridiculousfish>).
33
+
## What Makes `RcppAlgos` Unique
29
34
30
-
## Benchmarks
35
+
RcppAlgos implements several combinatorial algorithms that are uncommon or unavailable in most R libraries, including:
## If you don't want any repeats, set repetition = FALSE
237
-
comboGrid(rep(list(1:3), 3), repetition=FALSE)
238
-
#> Var1 Var2 Var3
239
-
#> [1,] 1 2 3
240
191
```
241
192
242
193
### Partitions of Groups
243
194
244
-
Efficiently partition a vector into groups with `comboGroups`. For example, the code below finds all possible pairings of groups of size 3 vs groups of size 2 (See this stackoverflow post: [Find all possible team pairing schemes](<https://stackoverflow.com/a/76068476/4408538>)).
195
+
Efficiently partition a vector into groups with `comboGroups`. For example, the code below finds all possible partitions into groups of size 2 and 3. See this Stack Overflow post:
196
+
197
+
[Find all possible team pairing schemes](<https://stackoverflow.com/a/76068476/4408538>)
*[Constraints, Partitions, and Compositions](<https://jwood000.github.io/RcppAlgos/articles/CombPermConstraints.html>)
259
+
*[Constraints in RcppAlgos: Constraint-Driven Combinatorial Enumeration](<https://jwood000.github.io/RcppAlgos/articles/CombPermConstraints.html>)
304
260
*[Attacking Problems Related to the Subset Sum Problem](<https://jwood000.github.io/RcppAlgos/articles/SubsetSum.html>)
305
261
*[Combinatorial Iterators in RcppAlgos](<https://jwood000.github.io/RcppAlgos/articles/CombinatoricsIterators.html>)
306
262
*[Cartesian Products and Partitions of Groups](<https://jwood000.github.io/RcppAlgos/articles/OtherCombinatorics.html>)
307
263
308
264
## Why **`RcppAlgos`** but no **`Rcpp`**?
309
265
310
-
Previous versions of `RcppAlgos` relied on [Rcpp](<https://github.com/RcppCore/Rcpp>) to ease the burden of exposing C++ to R. While the current version of `RcppAlgos` does not utilize `Rcpp`, it would not be possible without the myriad of excellent contributions to `Rcpp`.
266
+
Earlier versions of `RcppAlgos` relied on [Rcpp](<https://github.com/RcppCore/Rcpp>) to interface C++ with R. The current implementation uses [cpp11](<https://github.com/r-lib/cpp11>), which provides a lightweight interface to R’s C API. While the package no longer depends on `Rcpp`, the project owes much to the excellent work of the `Rcpp` community.
0 commit comments