Skip to content

Perm16::unrankSJT issues #61

@james-d-mitchell

Description

@james-d-mitchell

There are a number of issues with this function:

  1. Perm16::unrankSJT(m, n); returns a Perm16 padded by 0 at the end unless m is 16, which is not a permutation. I'm not sure if this is intentional, but it seems weird to me.

  2. Secondly, because the argument r is an int so if m is 16, then it isn't possible to get every permutation of degree 16 from this function (since $16! > 2 ^ {31}$.

  3. Thirdly, if negative values are input, then the input is sometimes not a permutation:

Perm16.unrankSJT(16, -2 ** 31)
Perm16([ 9,255,255,255,255,255, 0, 1, 2, 3, 4, 5, 6,12,13, 7])

(again the example comes from the python bindings, so looks a little off here).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions