Checks whether an array represents a permutation.
bool | check (int n, int *p)
|
Finds the longest ascending subsequence of a permutation.
std::vector<int> | ascending_subsequence (int n, int *a)
|
Counts the number of breaks in a permutation.
int | break_count (int n, int *p)
|
Counts the number of cycles in a permutation.
int | cycles (int n, int *p)
|
Verifies if a given permutation is a derangement.
bool | derangement_check (int n, int *a)[inline]
|
Calculates the inverse of the given permutation.
std::vector<int> | inverse (int n, int *p)
|
Calculates the inverse of the given permutation.
std::vector<int> | inverse_large (int n, int *p)
|
Computes the inversion sequence of a permutation.
std::vector<int> | inversion_sequence (int n, int *p)
|
Computes the product of two permutations.
std::vector<int> | multiplication (int n, int *p1, int *p2)
|
Computes the partition generated by the given permutation.
std::vector<int> | partition (int n, int *p)
|
Computes the rank of the given permutation, as generated by Permutation Class 2.
Calculates the sign of the given permutation.
Computes the Ulam metric distance of two permutations.
int | ulam_distance (int n, int *a, int *b)[inline]
|
Returns the permutation of the given rank, as generated by the Permutation Class 2 component.
std::vector<int> unrank | unknown (int n, int rank)
|
Reports the unused items in a partial permutation.
std::vector<int> unused_items | unknown (int n, int npart, int *part)
|
Progressively generates all the permutations of the given size.
Progressively generates all the permutations of the given size.
Progressively generates all the permutations of the given size.
Progressively generates all the permutations of the given size, in lexicographic order.