mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-12-04 10:06:27 +01:00
fix elem_types: they dispatch on TYPE of parent
This commit is contained in:
parent
1783ba5065
commit
78abdc3181
@ -102,8 +102,8 @@ end
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
elem_type(G::DirectProductGroup{T}) where {T} =
|
||||
DirectProductGroupElem{elem_type(G.group)}
|
||||
elem_type(::Type{DirectProductGroup{T}}) where {T} =
|
||||
DirectProductGroupElem{elem_type(T)}
|
||||
|
||||
parent_type(::Type{DirectProductGroupElem{T}}) where {T} =
|
||||
DirectProductGroup{parent_type(T)}
|
||||
|
@ -13,8 +13,7 @@ FreeGroupElem = GroupWord{FreeSymbol}
|
||||
|
||||
mutable struct FreeGroup <: AbstractFPGroup
|
||||
gens::Vector{FreeSymbol}
|
||||
# order::Vector{T}
|
||||
# fastmult_table::Array{Int,2}
|
||||
|
||||
function FreeGroup{T<:GSymbol}(gens::Vector{T})
|
||||
G = new(gens)
|
||||
G.gens = gens
|
||||
@ -30,9 +29,9 @@ export FreeGroupElem, FreeGroup
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
parent_type(::Type{FreeGroupElem}) = FreeGroup
|
||||
elem_type(::Type{FreeGroup}) = FreeGroupElem
|
||||
|
||||
elem_type(::FreeGroup) = FreeGroupElem
|
||||
parent_type(::Type{FreeGroupElem}) = FreeGroup
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
|
@ -49,7 +49,7 @@ end
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
elem_type(::WreathProduct{T, I}) where {T, I} = WreathProductElem{elem_type(T), I}
|
||||
elem_type(::Type{WreathProduct{T, I}}) where {T, I} = WreathProductElem{elem_type(T), I}
|
||||
|
||||
parent_type(::Type{WreathProductElem{T, I}}) where {T, I} =
|
||||
WreathProduct{parent_type(T), I}
|
||||
|
Loading…
Reference in New Issue
Block a user