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

add check argument to WreathProductElem constructor

This commit is contained in:
kalmar 2017-07-21 16:00:19 +02:00
parent 36a0e8593d
commit 0519d06baa

View File

@ -33,8 +33,11 @@ immutable WreathProductElem{T<:GroupElem} <: GroupElem
p::perm p::perm
# parent::WreathProduct # parent::WreathProduct
function WreathProductElem(n::DirectProductGroupElem, p::perm) function WreathProductElem(n::DirectProductGroupElem, p::perm,
check::Bool=true)
if check
length(n.elts) == parent(p).n || throw("Can't form WreathProductElem: lengths differ") length(n.elts) == parent(p).n || throw("Can't form WreathProductElem: lengths differ")
end
return new(n, p) return new(n, p)
end end
end end
@ -62,7 +65,7 @@ parent(g::WreathProductElem) = WreathProduct(parent(g.n[1]), parent(g.p))
WreathProduct{T<:Group}(G::T, P::PermGroup) = WreathProduct{T}(G, P) WreathProduct{T<:Group}(G::T, P::PermGroup) = WreathProduct{T}(G, P)
WreathProductElem{T<:GroupElem}(n::DirectProductGroupElem{T}, WreathProductElem{T<:GroupElem}(n::DirectProductGroupElem{T},
p::perm) = WreathProductElem{T}(n, p) p::perm, check::Bool=true) = WreathProductElem{T}(n, p, check)
############################################################################### ###############################################################################
# #
@ -98,7 +101,7 @@ function (G::WreathProduct)(n::DirectProductGroupElem, p::perm)
return result return result
end end
(G::WreathProduct)() = G(G.N(), G.P()) (G::WreathProduct)() = WreathProductElem(G.N(), G.P(), false)
doc""" doc"""
(G::WreathProduct)(p::perm) (G::WreathProduct)(p::perm)
@ -122,7 +125,7 @@ doc"""
############################################################################### ###############################################################################
function deepcopy_internal(g::WreathProductElem, dict::ObjectIdDict) function deepcopy_internal(g::WreathProductElem, dict::ObjectIdDict)
return WreathProductElem(deepcopy(g.n), deepcopy(g.p)) return WreathProductElem(deepcopy(g.n), deepcopy(g.p), false)
end end
function hash(G::WreathProduct, h::UInt) function hash(G::WreathProduct, h::UInt)
@ -182,7 +185,7 @@ doc"""
""" """
function *(g::WreathProductElem, h::WreathProductElem) function *(g::WreathProductElem, h::WreathProductElem)
w = DirectProductGroupElem((h.n).elts[inv(g.p).d]) w = DirectProductGroupElem((h.n).elts[inv(g.p).d])
return WreathProductElem(g.n*w, g.p*h.p) return WreathProductElem(g.n*w, g.p*h.p, false)
end end
doc""" doc"""