OKlibrary  0.2.1.6
Combinatorics Namespace Reference

## Classes

struct  Error
class  Factorial
Functor for computation of the factorial function; with helper function factorial. More...
class  Descending_power
Functor for computation of descending powers; with helper function descending_power. More...
class  Binom_integer_over_integer
Functor for computing integral binomial coefficients; with helper function binom_integer_over_integer. More...

## Enumerations

enum  choose_possibilities { no_subsets = -1, no_further_subsets = 0, further_subsets = 1 }
Function for running through all k-subsets of an n-set in lexicographical order. More...

## Functions

template<typename Int >
Int factorial (const Int &n)
template<typename Num , typename Int >
Num descending_power (Num b, Int k)
template<typename Int >
Int binom_integer_over_integer (const Int z, const Int k)
template<typename Int >
Int binom (Int a, Int b)
template<typename Int , class ForwardIterator >
choose_possibilities choose_next (const Int n, const Int k, const ForwardIterator begin, const ForwardIterator end)

## Enumeration Type Documentation

Function for running through all k-subsets of an n-set in lexicographical order.

Given a subset as the range of elements, sorted in ascending order, modify the range to the next subset in lexicographical order, if possible.

See ComputerAlgebra/Combinatorics/Lisp/Enumeration/Subsets.mac for the procedural specification at Maxima/Lisp level.

Todo:
See "Iteration through lexicographical order" in ComputerAlgebra/Combinatorics/Lisp/Enumeration/plans/Subsets.hpp.
Todo:
The implementation is not very efficient; improve it.
Todo:
The design should be perhaps be iterator-based.
Enumerator:
 no_subsets no_further_subsets further_subsets

Definition at line 168 of file Combinatorics.hpp.

## Function Documentation

template<typename Int >
 Int Combinatorics::binom ( Int a, Int b ) ` [inline]`

Definition at line 139 of file Combinatorics.hpp.

template<typename Int >
 Int Combinatorics::binom_integer_over_integer ( const Int z, const Int k ) ` [inline]`

Definition at line 135 of file Combinatorics.hpp.

template<typename Int , class ForwardIterator >
 choose_possibilities Combinatorics::choose_next ( const Int n, const Int k, const ForwardIterator begin, const ForwardIterator end )
template<typename Num , typename Int >
 Num Combinatorics::descending_power ( Num b, Int k ) ` [inline]`

Definition at line 81 of file Combinatorics.hpp.

template<typename Int >
 Int Combinatorics::factorial ( const Int & n ) ` [inline]`

Definition at line 60 of file Combinatorics.hpp.