Liking cljdoc? Tell your friends :D

clojure.math.combinatorics

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.)
raw docstring

*'cljs


+'cljs


cartesian-productclj/s

(cartesian-product & seqs)

All the ways to take one item from each sequence

All the ways to take one item from each sequence
raw docstring

combinationsclj/s

(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
raw docstring

count-combinationsclj/s

(count-combinations items t)

(count (combinations items t)) but computed more directly

(count (combinations items t)) but computed more directly
raw docstring

count-permutationsclj/s

(count-permutations l)

Counts the number of distinct permutations of l

Counts the number of distinct permutations of l
raw docstring

count-subsetsclj/s

(count-subsets items)

(count (subsets items)) but computed more directly

(count (subsets items)) but computed more directly
raw docstring

drop-permutationsclj/s

(drop-permutations items n)

(drop n (permutations items)) but calculated more directly.

(drop n (permutations items)) but calculated more directly.
raw docstring

nth-combinationclj/s

(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
raw docstring

nth-permutationclj/s

(nth-permutation items n)

(nth (permutations items)) but calculated more directly.

(nth (permutations items)) but calculated more directly.
raw docstring

nth-subsetclj/s

(nth-subset items n)

partitionsclj/s

(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.
raw docstring

permutation-indexclj/s

(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.
raw docstring

permutationsclj/s

(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).
raw docstring

permuted-combinationsclj/s

(permuted-combinations items t)

Every permutation of every combination of t elements from items

Every permutation of every combination of t elements from items
raw docstring

selectionsclj/s

(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
raw docstring

subsetsclj/s

(subsets items)

All the subsets of items

All the subsets of items
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close