ProGAL.math
Class Combinatorics

java.lang.Object
  extended by ProGAL.math.Combinatorics

public class Combinatorics
extends java.lang.Object

A wrapper for static combinatorial helper functions.

Author:
rfonseca

Constructor Summary
Combinatorics()
           
 
Method Summary
static int binom(int n, int m)
          Calculate the binomial coefficient.
static java.util.List<int[]> getAllPermutations(int max)
          Generates all permutations of integers from 0 (inclusive) to max (exclusive).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Combinatorics

public Combinatorics()
Method Detail

getAllPermutations

public static java.util.List<int[]> getAllPermutations(int max)
Generates all permutations of integers from 0 (inclusive) to max (exclusive).

Parameters:
max - the length of each permutation
Returns:
a list of all permutations of length max

binom

public static int binom(int n,
                        int m)
Calculate the binomial coefficient.

Parameters:
n - a number larger than or equal 0
k - a number larger than or equal 0 but smaller than or equal n
Returns:
n choose k
See Also:
link