1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-12-25 18:15:29 +01:00

fix problems with importing ×

This commit is contained in:
kalmarek 2018-09-21 18:36:13 +02:00
parent 46e2dc5faf
commit fbc4d8aec7

View File

@ -1,5 +1,3 @@
import Base: ×
export DirectProductGroup, DirectProductGroupElem
export MultiplicativeGroup, MltGrp, MltGrpElem
export AdditiveGroup, AddGrp, AddGrpElem
@ -163,27 +161,23 @@ end
#
###############################################################################
function ×(G::Group, H::Group)
function pow(G::Group, H::Group)
G == H || throw(DomainError(
"Direct Powers are defined only for the same groups"))
return DirectProductGroup(G,2)
end
×(H::Group, G::DirectProductGroup) = G×H
pow(H::Group, G::DirectProductGroup) = pow(G,H)
function ×(G::DirectProductGroup, H::Group)
function pow(G::DirectProductGroup, H::Group)
G.group == H || throw(DomainError(
"Direct products are defined only for the same groups"))
return DirectProductGroup(G.group,G.n+1)
end
DirectProductGroup(R::T, n::Int) where {T<:AbstractAlgebra.Ring} =
DirectProductGroup(AdditiveGroup(R), n)
function ×(G::DirectProductGroup{T}, H::Group) where T <: Union{AdditiveGroup, MultiplicativeGroup}
G.group == T(H) || throw(DomainError(
"Direct products are defined only for the same groups"))
return DirectProductGroup(G.group,G.n+1)
function pow(R::T, n::Int) where {T<:AbstractAlgebra.Ring}
@warn "Creating DirectProduct of the multilplicative group!"
return DirectProductGroup(R, n)
end
###############################################################################