Or login with:
| std::vector<int>inverse( | int | n | |
| int* | p | ) |
#include <codecogs/maths/combinatorics/permutations/inverse.h> #include <iostream> int main() { int sigma[5] = {5, 2, 1, 4, 3}; std::vector<int> result = Maths::Combinatorics::Permutations::inverse(5, sigma); std::cout << "The inverse of the Sigma permutation is: "; std::cout << std::endl; for (int i = 0; i < 5; i++) std::cout << result[i] << " "; std::cout << std::endl; return 0; }Output:
The inverse of the Sigma permutation is: 3 2 5 4 1
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.
You must login to leave a messge