Rank
Computes the rank of the given permutation, as generated by Permutation Class 2.
Controller: CodeCogs
Contents
Dependents
Interface
C++
Rank
intrank( | int | n | |
int* | p | ) |
Example:
#include <codecogs/maths/combinatorics/permutations/rank.h> #include <iostream> int main() { int sigma[3] = {2, 3, 1}; std::cout << "The rank of the Sigma permutation is: "; std::cout << Maths::Combinatorics::Permutations::rank(3, sigma) << std::endl; return 0; }
Output:
The rank of the Sigma permutation is: 5
References:
SUBSET, a C++ library of combinatorial routines, http://www.csit.fsu.edu/~burkardt/cpp_src/subset/subset.htmlParameters
n the size of the permutation p the actual permutation stored as an array
Returns
- the rank of the given permutation, as generated by the <em> Permutation Class 2 </em> component
Authors
- Lucian Bentea (August 2005)
Source Code
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.