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

More type stability for GSets #4194

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
14 changes: 7 additions & 7 deletions src/Groups/gsets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The fields are
- the seeds (something iterable of eltype `S`) whose closure under the action is the G-set
- the dictionary used to store attributes (orbits, elements, ...).
"""
@attributes mutable struct GSetByElements{T,S} <: GSet{T}
@attributes mutable struct GSetByElements{T,S} <: GSet{T,S}
group::T
action_function::Function
seeds
Expand Down Expand Up @@ -229,7 +229,7 @@ end
#TODO: Compute membership without writing down all elements,
# using what is called `RepresentativeAction` in GAP.

function Base.in(omega, Omega::GSetByElements)
function Base.in(omega::S, Omega::GSetByElements{T,S}) where {T,S}
omega in Omega.seeds && return true
return omega in elements(Omega)
end
Expand All @@ -256,12 +256,12 @@ as_gset(G::T, Omega) where T<:Union{GAPGroup,FinGenAbGroup} = as_gset(G, ^, Omeg
## not via the action function stored in the G-set,
## - write something like `orbit(omega)`, `stabilizer(omega)`.

struct ElementOfGSet
gset::GSet
obj::Any
struct ElementOfGSet{T, S, G <: GSet{T, S}}
gset::G
obj::S
end

function (Omega::GSet)(obj::Any)
function (Omega::GSet{T, S})(obj::S) where {T, S}
return ElementOfGSet(Omega, obj)
end

Expand Down Expand Up @@ -509,7 +509,7 @@ The fields are
- the (left or right) transversal, of type `SubgroupTransversal{T, S, E}`,
- the dictionary used to store attributes (orbits, elements, ...).
"""
@attributes mutable struct GSetBySubgroupTransversal{T, S, E} <: GSet{T}
@attributes mutable struct GSetBySubgroupTransversal{T, S, E} <: GSet{T,GroupCoset{T, E}}
group::T
subgroup::S
side::Symbol
Expand Down
4 changes: 2 additions & 2 deletions src/Groups/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ end

################################################################################

abstract type GSet{T} end
abstract type GSet{T,S} end


################################################################################
Expand All @@ -493,7 +493,7 @@ abstract type GSet{T} end
It can be either the conjugacy class of an element or of a subgroup of type `S`
in a group `G` of type `T`.
"""
abstract type GroupConjClass{T, S} <: GSet{T} end
abstract type GroupConjClass{T,S} <: GSet{T,S} end


################################################################################
Expand Down
Loading