Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
This is a linear time ranking algorithm that does not
enforce lexicographic order [3].


Examples
========

>>> from sympy.combinatorics.permutations import Permutation
>>> p = Permutation([0,1,2,3])
>>> p.rank_nonlex()(more...)

src/s/y/sympy-HEAD/sympy/combinatorics/tests/test_permutations.py   sympy(Download)
    assert prank == 1600
    assert Permutation.unrank_nonlex(7, 1600) == p
    qrank = q.rank_nonlex()
    assert qrank == 41
    assert Permutation.unrank_nonlex(7, 41) == Permutation(q.array_form)

src/s/y/sympy-0.7.5/sympy/combinatorics/tests/test_permutations.py   sympy(Download)
    assert prank == 1600
    assert Permutation.unrank_nonlex(7, 1600) == p
    qrank = q.rank_nonlex()
    assert qrank == 41
    assert Permutation.unrank_nonlex(7, 41) == Permutation(q.array_form)