Home | Trees | Indices | Help |
---|
|
object --+ | EnumerativeCombinatorics
class EnumerativeCombinatorics() - basic EC functionality
This class implements basic enumerative combinatorics functionality, such as permutations, combinations and partitions, since they are necessary for my optimization investigations of data structures.
Most methods are static (class) methods. Basically, this class is used to encapsulated conjoined functions.
|
|||
Inherited from |
|
|||
permutation_list |
|
||
permutation_list |
|
||
permutation |
|
||
|
|||
|
|||
variation_list |
|
||
|
|
|||
Inherited from |
|
element_list ... list of elements which are used permutation_list ... all possible permutations of elements Generates the PERMUTATION WITHOUT REPETITION of all elements given in the element_list, which are used once. The resulting permutation_list is a list including the n = len(element_list)! different sequences. ATTENTION: This permutation implementation delivers a different order than permute and get_permutation!
|
element_list -- list of elements which are used permutation_list -- all possible permutations of elements Generates the PERMUTATION WITHOUT REPETITION of all elements given in the element_list, which are used once. The resulting permutation_list is a list including the n = len(element_list)! different sequences. Obtains the same ordering of permutations as the get_permutation method.
|
element_list -- list of elements which are used number -- number of permutation (implementation inherent order) permutation -- resulting permutation of elements Generates the PERMUTATION WITHOUT REPETITION of the elements given in the element_list, which are used once. The number of all possible permutations is fak(len(element_list)), thus the range of number should be: 0 <= number < fak(len(element_list)). Validity of number is not tested. This should be done in the calling function (e.g., assert(number) < fak(len(element_list))), otherwise this test would be executed in every recursion step. Result equal to: permute(element_list)[number]
|
element_list ... list of elements which are used variation_length ... length of resulting variation variation_list ... result of variation Generates the VARIATION WITH REPETITION of the given length. Therefore on every place every given element can be used. The order is important. Finaly, the variation_list contains len(element_list)**variation_length variations.
|
Generate variation and return the specified element. element_list - list of elements which are used variation_length - length of resulting variation number - number of wanted variation variation - resulting variation Generates one VARIATION WITH REPETITION of the given length and elements at position number. Result equal to: vary(element_list, variation_length)[number]. |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Apr 27 17:47:09 2011 | http://epydoc.sourceforge.net |