Add fixed_points for PermGroup and PermGroupElem#5250
Add fixed_points for PermGroup and PermGroupElem#5250lgoettgens merged 25 commits intooscar-system:masterfrom
fixed_points for PermGroup and PermGroupElem#5250Conversation
|
your commit is too large, changes to Prohejt.toml should not be there. |
|
Yes, I'll rectify them immediately.
Thankyou.
…On Fri, Aug 29, 2025 at 11:20 Claus Fieker ***@***.***> wrote:
*fieker* left a comment (oscar-system/Oscar.jl#5250)
<#5250 (comment)>
your commit is too large, changes to Prohejt.toml should not be there.
Also, as you see here, the tests are failing...
—
Reply to this email directly, view it on GitHub
<#5250 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BUWKEAP5LJBLAX4XFRCVKST3QALMZAVCNFSM6AAAAACFD4YYJOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMZWGM2DSMRQG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
You still have changes to Project.toml in |
I think I was able to rectify that , next I will look into the errors that are coming up. |
lgoettgens
left a comment
There was a problem hiding this comment.
Thanks for your contribution! I added some more comments regarding code style. The Project.toml changes and the unnecessary testfile are definitely blocking this PR from getting merged (as are the failing test).
| 4 | ||
| ``` | ||
| """ | ||
| fixed_points(G::PermGroup) = setdiff!(collect(1:degree(G)), moved_points(G)) |
There was a problem hiding this comment.
| fixed_points(G::PermGroup) = setdiff!(collect(1:degree(G)), moved_points(G)) | |
| fixed_points(G::PermGroup) = setdiff(1:degree(G), moved_points(G)) |
I did a small benchmark and it seems as if the original version of this was indeed better than my suggetsion, so this should be changed back.
julia> f1(n, x) = setdiff(1:n, x)
f1 (generic function with 1 method)
julia> f2(n, x) = setdiff(collect(1:n), x)
f2 (generic function with 1 method)
julia> f3(n, x) = setdiff!(1:n, x)
f3 (generic function with 1 method)
julia> f4(n, x) = setdiff!(collect(1:n), x)
f4 (generic function with 1 method)
julia> @b f1($(10), $([1,3,5,6]))
382.658 ns (6 allocs: 448 bytes)
julia> @b f2($(10), $([1,3,5,6]))
416.382 ns (8 allocs: 592 bytes)
julia> @b f3($(10), $([1,3,5,6]))
ERROR: CanonicalIndexError: setindex! not defined for UnitRange{Int64}
[...]
julia> @b f4($(10), $([1,3,5,6]))
398.235 ns (7 allocs: 544 bytes)|
Try to add |
Thanks, that's helpful. |
|
@varuntrehan7 please also address the other comments @lgoettgens made |
|
@varuntrehan7 that means: look over all of #5250 and https://github.com/oscar-system/Oscar.jl/pull/5250/files for the code change suggestions -- you can either apply this with a few clicks via the webinterface (and later use |
Thankyou, yes I'll make sure I do all the suggestions made so far and push again after doing so. apologies for the delay, I will do it asap. |
|
I am getting a bit tired of repeating this, but here it is one more time: |
fixed_points(::PermGroup)fixed_points for PermGroup and PermGroupElem
fingolfin
left a comment
There was a problem hiding this comment.
Thanks, it's starting to look a lot better.
fingolfin
left a comment
There was a problem hiding this comment.
Please go everything and remove any unicode. Otherwise this seems OK now
|
@varuntrehan7 If you think this is ready, please mark it as "ready to review" using the github UI. |
| Return the number of those points in `1:degree(x)` or `1:degree(G)`, | ||
| respectively, that are fixed under the action `^`. |
There was a problem hiding this comment.
| Return the number of those points in `1:degree(x)` or `1:degree(G)`, | |
| respectively, that are fixed under the action `^`. | |
| Return the number of points in `1:degree(x)` or `1:degree(G)` that are | |
| fixed by all elements (for groups) or by `x` (for elements). |
I would find it easier to understand if both docstrings use the same sentence structure
yeah, i'm not sure they were not failing before. Let me rectify them and and then mark it "ready for review". |
| @test number_of_fixed_points(y) == 0 # generator (1 2 3 4) fixes nothing | ||
|
|
||
| z = g([2, 3, 1, 4]) # permutation (1 2 3)(4) | ||
| @test number_of_fixed_points(z) == 0 |
There was a problem hiding this comment.
| @test number_of_fixed_points(z) == 0 | |
| @test number_of_fixed_points(z) == 1 |
as you write in line 463, there is a 1-cycle containing 4, and thus 4 is a fixed point.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5250 +/- ##
==========================================
- Coverage 84.91% 83.99% -0.92%
==========================================
Files 713 721 +8
Lines 96340 98483 +2143
==========================================
+ Hits 81806 82720 +914
- Misses 14534 15763 +1229
🚀 New features to boost your workflow:
|
lgoettgens
left a comment
There was a problem hiding this comment.
No more objections from my side
I was able to write a docstring in the groups/perm.jl and I was also able to write some tests in the tests/ groups.
I was successfully able to add and validate tests for the fixed points in symmetric group but while trying to do it with trivial group or subgroups generated by specific cycles I was facing some issues.