Skip to content

Commit 05c6ffc

Browse files
authored
More type stability for GSets (#4194)
1 parent 534513f commit 05c6ffc

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/Groups/gsets.jl

+7-7
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The fields are
3636
- the seeds (something iterable of eltype `S`) whose closure under the action is the G-set
3737
- the dictionary used to store attributes (orbits, elements, ...).
3838
"""
39-
@attributes mutable struct GSetByElements{T,S} <: GSet{T}
39+
@attributes mutable struct GSetByElements{T,S} <: GSet{T,S}
4040
group::T
4141
action_function::Function
4242
seeds
@@ -229,7 +229,7 @@ end
229229
#TODO: Compute membership without writing down all elements,
230230
# using what is called `RepresentativeAction` in GAP.
231231

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

259-
struct ElementOfGSet
260-
gset::GSet
261-
obj::Any
259+
struct ElementOfGSet{T, S, G <: GSet{T, S}}
260+
gset::G
261+
obj::S
262262
end
263263

264-
function (Omega::GSet)(obj::Any)
264+
function (Omega::GSet{T, S})(obj::S) where {T, S}
265265
return ElementOfGSet(Omega, obj)
266266
end
267267

@@ -509,7 +509,7 @@ The fields are
509509
- the (left or right) transversal, of type `SubgroupTransversal{T, S, E}`,
510510
- the dictionary used to store attributes (orbits, elements, ...).
511511
"""
512-
@attributes mutable struct GSetBySubgroupTransversal{T, S, E} <: GSet{T}
512+
@attributes mutable struct GSetBySubgroupTransversal{T, S, E} <: GSet{T,GroupCoset{T, E}}
513513
group::T
514514
subgroup::S
515515
side::Symbol

src/Groups/types.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ end
478478

479479
################################################################################
480480

481-
abstract type GSet{T} end
481+
abstract type GSet{T,S} end
482482

483483

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

498498

499499
################################################################################

0 commit comments

Comments
 (0)