Learn R Programming

⚠️There's a newer version (0.4.2) of this package.Take me there.

iterpc (version 0.2.2)

Efficient iterator for permutations and combinations

Description

This package helps in 1) generating permutations and combinations with or without replacement; 2) with distinct items or non-distinct items (multiset); 3) calculating number of combinations or permutations in various situations. All generated sequences are in lexicographical order (AKA, dictionary order). The algorithms to generate permutations and combinations are memory efficient, only previous sequence is required to generate next sequence. These iteratively 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++ and hence very computational efficient.

Copy Link

Version

Install

install.packages('iterpc')

Monthly Downloads

1,907

Version

0.2.2

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Randy Lai

Last Published

March 29th, 2014

Functions in iterpc (0.2.2)

multichoose

Calculate mulinomial coefficient
getcurrent

Get the current element of a iterator
getall

Get all permutation/combination for a iterator
iterpc

Iterator for Permutations and Combinations
nc_multiset

Calcuate the number of combinations of a multiset
getnext

Get the next permutation(s)/combination(s) for a iterator
np_multiset

Calcuate the number of r-permutations of a multiset
getlength

Get the length for a iterator