API for combinatorics
(master branch)
by
Mark Engelberg
Usage:
(ns your-namespace
(:require clojure.contrib.combinatorics))
Overview
Efficient, functional algorithms for generating lazy
sequences for common combinatorial functions. (See the source code
for a longer description.)
Public Variables and Functions
cartesian-product
function
Usage: (cartesian-product & seqs)
All the ways to take one item from each sequence
combinations
function
Usage: (combinations items n)
All the unique ways of taking n different elements from items
lex-permutations
function
Usage: (lex-permutations c)
Fast lexicographic permutation generator for a sequence of numbers
permutations
function
Usage: (permutations items)
All the permutations of items, lexicographic by index
selections
function
Usage: (selections items n)
All the ways of taking n (possibly the same) elements from the sequence of items
subsets
function
Usage: (subsets items)
All the subsets of items