Commit
2 years ago
gh-35053: Added kth roots to Permutation ### 📚 Description Added 3 functions that deal with k-th roots of permutations: 1) Permutation.kth_roots(k) compute a iterator of over all k-th roots of self. 2) Permutation.has_kth_root(k) determines if self has a k-th root (or several). 3) Permutation.number_of_kth_roots(k) returns the number of k-th roots of self. Added integer_partition_with_given_parts(n, parts) in partition.py (for use in k-th roots computations): it creates a iterator over all partitions of n which parts are in the variable parts. <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If it resolves an open issue, please link to the issue here. For example "Closes #1337" --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] I have made sure that the title is self-explanatory and the description concisely explains the PR. - [ ] I have linked an issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open pull requests that this PR logically depends on --> <!-- - #xyz: short description why this is a dependency - #abc: ... --> URL: https://github.com/sagemath/sage/pull/35053 Reported by: GermainPoullot Reviewer(s): Frédéric Chapoton, GermainPoullot, Martin Rubey, Travis Scrimshaw, Vincent Delecroix
Author
Release Manager
Loading