#include <PermutationEnumerator.h>
Inheritance diagram for PermutationEnumerator:
Public Member Functions | |
PermutationEnumerator (int L) | |
Constructor. | |
PermutationEnumerator | operator= (const PermutationEnumerator &) |
No assignment operator. | |
PermutationEnumerator (const PermutationEnumerator &) | |
No copy constructor. | |
Permutation | getPermutation () const |
virtual bool | seqOK () const |
Check if the currently constructed sequence is legitimate. | |
virtual bool | seqLimit () const |
Returns true if the length-limit on the sequence is passed. | |
virtual bool | seqComplete () const |
Returns true if the current sequence is complete. | |
virtual int | start () const |
Returns the initial value for the current element of the sequence (usually 0). | |
virtual int | next (int cur) const |
Returns the next value for the current element of the sequence (usually cur+1). | |
virtual bool | finish (int cur) const |
virtual void | stepTo () |
Function is invoked when the current value of the current element of the sequence is accepted and we go for the next element. | |
virtual void | stepBack (int cur) |
Function is invoked when we go backward from the current element to the previous element. | |
Private Attributes | |
int | theLength |
The length of a permutation. | |
vector< bool > | theUsedElements |
Array of flags - elements used in already constructed part of a permutation. |
Definition at line 14 of file PermutationEnumerator.h.
|
Constructor.
Definition at line 26 of file PermutationEnumerator.h. |
|
No copy constructor.
|
|
Implements VectorEnumerator. Definition at line 64 of file PermutationEnumerator.h. References theLength. |
|
Definition at line 44 of file PermutationEnumerator.h. References VectorEnumerator::getSeq(), and theLength. |
|
Returns the next value for the current element of the sequence (usually cur+1).
Implements VectorEnumerator. Definition at line 61 of file PermutationEnumerator.h. |
|
No assignment operator.
|
|
Returns true if the current sequence is complete.
Implements VectorEnumerator. Definition at line 54 of file PermutationEnumerator.h. References VectorEnumerator::getLength(), and theLength. |
|
Returns true if the length-limit on the sequence is passed.
Implements VectorEnumerator. Definition at line 51 of file PermutationEnumerator.h. References VectorEnumerator::getLength(), and theLength. |
|
Check if the currently constructed sequence is legitimate.
Implements VectorEnumerator. Definition at line 46 of file PermutationEnumerator.h. References VectorEnumerator::getLength(), VectorEnumerator::getSeq(), theLength, and theUsedElements. |
|
Returns the initial value for the current element of the sequence (usually 0).
Implements VectorEnumerator. Definition at line 58 of file PermutationEnumerator.h. |
|
Function is invoked when we go backward from the current element to the previous element. The value of curElement is already decreased, so you are at the previous element Reimplemented from VectorEnumerator. Definition at line 72 of file PermutationEnumerator.h. References VectorEnumerator::getLength(), VectorEnumerator::getSeq(), and theUsedElements. |
|
Function is invoked when the current value of the current element of the sequence is accepted and we go for the next element. The value of curElement is already increased, so you are at the next element. Reimplemented from VectorEnumerator. Definition at line 68 of file PermutationEnumerator.h. References VectorEnumerator::getLength(), VectorEnumerator::getSeq(), and theUsedElements. |
|
The length of a permutation.
Definition at line 87 of file PermutationEnumerator.h. Referenced by finish(), getPermutation(), seqComplete(), seqLimit(), and seqOK(). |
|
Array of flags - elements used in already constructed part of a permutation.
Definition at line 90 of file PermutationEnumerator.h. Referenced by seqOK(), stepBack(), and stepTo(). |