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

source

+'cljs

source

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
sourceraw 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
sourceraw docstring

count-combinationsclj/s

(count-combinations items t)

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

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

count-permutationsclj/s

(count-permutations l)

Counts the number of distinct permutations of l

Counts the number of distinct permutations of l
sourceraw docstring

count-subsetsclj/s

(count-subsets items)

(count (subsets items)) but computed more directly

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

drop-permutationsclj/s

(drop-permutations items n)

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

(drop n (permutations items)) but calculated more directly.
sourceraw 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
sourceraw docstring

nth-permutationclj/s

(nth-permutation items n)

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

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

nth-subsetclj/s

(nth-subset items n)
source

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

subsetsclj/s

(subsets items)

All the subsets of items

All the subsets of items
sourceraw docstring

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

× close