From ae97c20e62c525f9840360cd939596da7670a5a3 Mon Sep 17 00:00:00 2001 From: kalmar Date: Fri, 21 Jul 2017 13:23:16 +0200 Subject: [PATCH] update \times outer constructor --- src/DirectProducts.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/DirectProducts.jl b/src/DirectProducts.jl index d1fb3a4..b907274 100644 --- a/src/DirectProducts.jl +++ b/src/DirectProducts.jl @@ -58,7 +58,10 @@ end # ############################################################################### -×(G::Group, H::Group) = DirectProductGroup([G,H]) +function ×(G::Group, H::Group) + G == H || throw("Direct products are defined only for the same groups") + return DirectProductGroup(G,2) +end ############################################################################### # @@ -66,8 +69,6 @@ end # ############################################################################### -(G::DirectProductGroup)() = G([H() for H in G.factors]) - (G::DirectProductGroup)(g::DirectProductGroupElem) = G(g.elts) doc"""