iterpc v0.3.3

0

Monthly downloads

0th

Percentile

Efficient Iterators for Permutations and Combinations

A collection of iterators for generating permutations and combinations with or without replacement; with distinct items or non-distinct items (multiset). The generated sequences are in lexicographical order (dictionary order). The algorithms to generate permutations and combinations are memory efficient. These iterative algorithms enable users to process all sequences without putting all results in the memory at the same time. The algorithms are written in C/C++ for faster performances.

Readme

Efficient Iterators for Permutations and Combinations

Build Status

Latest Documentation: http://randy3k.github.io/iterpc

Github: https://github.com/randy3k/iterpc

A collection of iterators for generating permutations and combinations with or without replacement; with distinct items or non-distinct items (multiset). The generated sequences are in lexicographical order (dictionary order). The algorithms to generate permutations and combinations are memory efficient. These iterative algorithms enable users to process all sequences without putting all results in the memory at the same time. The algorithms are written in C/C++ for faster performances.

Credit

Thank Martin Broadhurst and Alistair Israel for their algorithms. Alistair Israel has a very nice article on an algorithm to generate k-permutation.

Installation

If you want to install the latest development version, you can use devtools:

devtools::install_github("randy3k/iterpc")

or you can install the stable version via CRAN

install.packages("iterpc")

Functions in iterpc

Name Description
getall Get all permutations/combinations for a iterator
getcurrent Get the current element of a iterator
iter_wrapper Wrap iterpc objects by iterators::iter
iterpc Iterator for Permutations and Combinations
multichoose Calculate multinomial coefficient
nc_multiset Calculate the number of r-combinations of a multiset
getlength Get the length for a iterator
getnext Get the next permutation(s)/combination(s) for a iterator
np_multiset Calculate the number of r-permutations of a multiset
No Results!

Vignettes of iterpc

Name
combinations.Rmd
permutations.Rmd
No Results!

Last month downloads

Details

Type Package
Date 2017-09-12
URL https://randy3k.github.io/iterpc
License GPL-2
LinkingTo Rcpp
NeedsCompilation yes
ByteCompile yes
RoxygenNote 6.0.1
VignetteBuilder knitr
Packaged 2017-09-12 17:52:08 UTC; randy
Repository CRAN
Date/Publication 2017-09-12 20:41:15 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/iterpc)](http://www.rdocumentation.org/packages/iterpc)