#include <Permutation.h>
List of all members.
Detailed Description
This class implements the permutation of any type T.
Constructor & Destructor Documentation
| TPermutation::TPermutation |
( |
Int |
iNum ) |
|
creates a permutation object
- Parameters:
-
| iNum | : number of permutations |
| TPermutation::~TPermutation |
( |
) |
[virtual] |
Destroys the permutation object
Member Function Documentation
| Int64 zeus::TPermutation::getCount |
( |
) |
const [inline] |
Returns the number of permutations
| IList< Int > & TPermutation::getNextPerm |
( |
) |
|
returns a permutation instance. We use the following algorithm to perform the iteration:
perm:= getNextPerm()
begin
i:= 0;
repeat
it <- source.iterator[i];
if it.hasNextUnmarkedItem then
begin
item <- it.nextUnmarkedItem;
mark item;
perm.push( item );
i++;
end
else
begin
i--
item = perm.pop
unmark item
end
until( i = source.length and i >= 0)
end
| bool zeus::TPermutation::hasNextPerm |
( |
) |
const [inline] |
Checks if there are more permutations to return
- Return values:
-
| false,: | No more permutations |
| true,: | There are more permutations |
| void TPermutation::reset |
( |
) |
|
resets the internal iterator over all permutations
The documentation for this class was generated from the following files: