Skip to content
Open
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
23 changes: 14 additions & 9 deletions src/Groups/GAPGroups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ function (G::GAPGroup)(x::BasicGAPGroupElem{T}) where T<:GAPGroup
return group_element(G, GapObj(x))
end

function ensure_efficient_setup_is_done(_::Group)
# currently a groups in general
return
end

function ensure_efficient_setup_is_done(G::MatrixGroup)
if is_infinite(base_ring(G))
is_finite(G) # force computation of a nice mono
end
return
end

"""
is_finite(G::GAPGroup) -> Bool

Expand Down Expand Up @@ -684,12 +696,7 @@ julia> length(small_generating_set(abelian_group(PermGroup, [2,3,4])))
```
"""
@gapattribute function small_generating_set(G::GAPGroup)
# We claim that the finiteness check is cheap in Oscar.
# This does not hold in GAP,
# and GAP's method selection benefits from the known finiteness flag.
if G isa MatrixGroup && is_infinite(base_ring(G))
is_finite(G)
end
ensure_efficient_setup_is_done(G)

L = GAP.Globals.SmallGeneratingSet(GapObj(G))::GapObj
res = Vector{elem_type(G)}(undef, length(L))
Expand Down Expand Up @@ -2664,9 +2671,7 @@ function describe(G::GAPGroup)
is_finitely_generated(G) || return "a non-finitely generated group"

# force some checks in some cases
if G isa MatrixGroup && is_infinite(base_ring(G))
is_finite(G)
end
ensure_efficient_setup_is_done(G)

# handle groups whose finiteness is known
if has_is_finite(G)
Expand Down
Loading