Module snowcap::permutators[][src]

Expand description

Permutators

This module contains all different iterators which iterate over all permutations. The iterators differ from each other by the order in which the permutations are yielded.

Different Permutators

  • HeapsPermutator: Simple permutator, implemented using the Heaps algorithm. This permutator does not re-implement fail_pos, and thus does not make use of the feedback functionality for permutators. The HeapsPermutaor is implemented for any type, which implements the Copy trait.

  • LexicographicPermutator: Simple permutator, which returns all permutations in a lexicographic ordering. It is implemented for any type, which implements the Copy trait, and requires a CompleteOrdering for the chosen type. This permutator does not re-implement fail_pos, and thus does not make use of the feedback functionality for permutators.

  • SJTPermutator: Permutator implementing the Steinhaus-Johnson-Trotter algorithm. It is implemented for any type, which implements the Copy trait. This permutator does not re-implement fail_pos, and thus, does not make use of the feedback functionality for permutators.

  • MultipleSwapPermutator: This is a meta-permutator that consists of a different permutator. Every time next is called, it in terms calls next multiple times on the specified permutator, resulting in multiple swaps at once. The numebr of times to call next is chosen such that every permutation is created exactly once (by choosing the smallest prime number larger than the number of elements in the permutation series). It does not re-implement fail_pos, and thus, does not make use of the feedback functionality for permutators.

  • TreePermutator: This permutator is based on the TreeStrategy. The permutator generates a sequence identical to the LexicographicPermutator, but it does not require a CompleteOrdering. Instead, it builds a datastructure which does not require the comparison of single elements. Additionally, this permutator re-implements fail_pos, and makes use of the fallback funcitonality to reduce the number of permutations for dependencies with an immediate effect.

  • RandomTreePermutator: This permutator is very similar to the TreePermutator. However, the main difference is that the ordering of the remaining elements is always shuffled, every time a new branch in the tree is entered. As for the TreePermutator, this permutator re-implements fail_pos to reduce the number of permutations for dependencies with an immediate effect.

Structs

Heaps Permutator

Ordered Permutator

Multiple-Swap Permutator

Random Tree Permutator

Steinhaus-Johnson-Trotter Permutator

Tree Permutator

Traits

Permutator trait

This is an empty trait to tell the compiler which types can be returned by the Permutator Iterator.