1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-12-04 18:11:26 +01:00

fine tuned elem_type, parent_type

This commit is contained in:
kalmar 2017-07-21 13:20:31 +02:00
parent d02c5afc65
commit 7f1b6f61d0

View File

@ -29,9 +29,11 @@ end
#
###############################################################################
elem_type{T<:Group}(G::DirectProductGroup{T}) = DirectProductGroupElem{elem_type(first(G.factors))}
elem_type{T<:Group}(G::DirectProductGroup{T}) =
DirectProductGroupElem{elem_type(G.group)}
parent_type(::Type{DirectProductGroupElem}) = DirectProductGroup
parent_type{T<:GroupElem}(::Type{DirectProductGroupElem{T}}) =
DirectProductGroup{parent_type(T)}
parent(g::DirectProductGroupElem) = DirectProductGroup([parent(h) for h in g.elts])