Efficient, functional algorithms for generating lazy sequences for common combinatorial functions. (See the source code for a longer description.)
Efficient, functional algorithms for generating lazy sequences for common combinatorial functions. (See the source code for a longer description.)
(cartesian-product & seqs)
All the ways to take one item from each sequence
All the ways to take one item from each sequence
(combinations items t)
All the unique ways of taking t different elements from items
All the unique ways of taking t different elements from items
(count-combinations items t)
(count (combinations items t)) but computed more directly
(count (combinations items t)) but computed more directly
(count-permutations l)
Counts the number of distinct permutations of l
Counts the number of distinct permutations of l
(count-subsets items)
(count (subsets items)) but computed more directly
(count (subsets items)) but computed more directly
(drop-permutations items n)
(drop n (permutations items)) but calculated more directly.
(drop n (permutations items)) but calculated more directly.
(nth-combination items t n)
The nth element of the sequence of t-combinations of items
The nth element of the sequence of t-combinations of items
(nth-permutation items n)
(nth (permutations items)) but calculated more directly.
(nth (permutations items)) but calculated more directly.
(nth-subset items n)
(partitions items & args)
All the lexicographic distinct partitions of items. Optionally pass in :min and/or :max to specify inclusive bounds on the number of parts the items can be split into.
All the lexicographic distinct partitions of items. Optionally pass in :min and/or :max to specify inclusive bounds on the number of parts the items can be split into.
(permutation-index items)
Input must be a sortable collection of items. Returns the n such that (nth-permutation (sort items) n) is items.
Input must be a sortable collection of items. Returns the n such that (nth-permutation (sort items) n) is items.
(permutations items)
All the distinct permutations of items, lexicographic by index (special handling for duplicate items).
All the distinct permutations of items, lexicographic by index (special handling for duplicate items).
(permuted-combinations items t)
Every permutation of every combination of t elements from items
Every permutation of every combination of t elements from items
(selections items n)
All the ways of taking n (possibly the same) elements from the sequence of items
All the ways of taking n (possibly the same) elements from the sequence of items
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close