From fbc4d8aec7895152c673e439396053cd237d0068 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Fri, 21 Sep 2018 18:36:13 +0200 Subject: [PATCH] =?UTF-8?q?fix=20problems=20with=20importing=20=C3=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DirectProducts.jl | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/DirectProducts.jl b/src/DirectProducts.jl index 7ccc929..a86e227 100644 --- a/src/DirectProducts.jl +++ b/src/DirectProducts.jl @@ -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 ###############################################################################