Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Permutation Class Reference

The class Permutation defines a method to calculate permutations. More...

#include <Permutation.h>

List of all members.

Static Public Member Functions

bool perm (int data[], const int &length)
 Calculates the next permutation to a given one.


Static Private Member Functions

void sort (int data[], const int &start, const int &end)
 Sort the part of the array between the positions start and end (inclusive) via a quicksort algorithm.


Detailed Description

The class Permutation defines a method to calculate permutations.

Definition at line 15 of file Permutation.h.


Member Function Documentation

bool Permutation::perm int  data[],
const int &  length
[static]
 

Calculates the next permutation to a given one.

To get all permutations the data-array in the first call should be sorted ascending.

Parameters:
data The given permutation as input and the next permutation after return. When returned false the array-data is invalid.
length The number of elements
Returns:
A bool wether a next permutation could be calculated.

Definition at line 10 of file Permutation.cpp.

References max, min, and sort().

Here is the call graph for this function:

void Permutation::sort int  data[],
const int &  start,
const int &  end
[static, private]
 

Sort the part of the array between the positions start and end (inclusive) via a quicksort algorithm.

Parameters:
data The array
start The first position of the arraypart to sort.
end The last position of the arraypart to sort.

Definition at line 40 of file Permutation.cpp.

Referenced by perm().


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:10:36 2004 for GT2004 by doxygen 1.3.6