Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cycle_length for PermGroupElem #4359

Merged
merged 2 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/GAP/wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ GAP.@wrap ConjugateSubgroup(x::GapObj, y::GapObj)::GapObj
GAP.@wrap Core(x::GapObj, y::GapObj)::GapObj
GAP.@wrap CycleFromList(x::GapObj)::GapObj
GAP.@wrap CycleStructurePerm(x::GapObj)::GapObj
GAP.@wrap CYCLE_LENGTH_PERM_INT(x::GapObj, y::Int)::Int
GAP.@wrap CycList(x::GapObj)::GapInt
GAP.@wrap CyclotomicPol(x::Int)::GapObj
GAP.@wrap DecomposeTensorProduct(x::GapObj, y::GapObj, z::GapObj)::GapObj
Expand Down
21 changes: 21 additions & 0 deletions src/Groups/perm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,27 @@ function cycles(g::PermGroupElem)
return cycles
end

@doc raw"""
cycle_length(g::PermGroupElem, i::IntegerUnion)

Return the length of the cycle of `i` under the action of the permutation `g`.

# Examples
```jldoctest
julia> g = cperm(1:3, 6:7, 8:10, 11:15)
(1,2,3)(6,7)(8,9,10)(11,12,13,14,15)

julia> cycle_length(g, 1)
3

julia> cycle_length(g, 4)
1
```
"""
function cycle_length(g::PermGroupElem, i::IntegerUnion)
return GAPWrap.CYCLE_LENGTH_PERM_INT(GapObj(g), GapObj(i))
end

################################################################################
#
# _perm_helper
Expand Down
1 change: 1 addition & 0 deletions src/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ export cox_variety
export cperm
export cross_polytope
export cube
export cycle_length
export cycle_matroid
export cycle_structure
export cycle_structures
Expand Down
Loading