From 955aaf48faa6429c94d6c9afe4a974af3121445d Mon Sep 17 00:00:00 2001 From: kalmar Date: Tue, 16 May 2017 18:36:00 +0200 Subject: [PATCH] == for GroupRing and GroupRingElem --- src/GroupAlgebras.jl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/GroupAlgebras.jl b/src/GroupAlgebras.jl index 41e7fda..72bdb94 100644 --- a/src/GroupAlgebras.jl +++ b/src/GroupAlgebras.jl @@ -93,9 +93,22 @@ function show(io::IO, X::GroupRingElem) print(io, "Element of Group Algebra of $(parent(X)) over $T:\n $(X.coeffs)") end + +function (==)(X::GroupRingElem, Y::GroupRingElem) + parent(X) == parent(Y) || return false + if eltype(X.coeffs) != eltype(S.coeffs) + warn("Comparing elements with different coeffs Rings!") + end + X.coeffs == Y.coeffs || return false + return true +end + +function (==)(A::GroupRing, B::GroupRing) + return A.group == B.group +end + end -(==)(X::GroupAlgebraElement, Y::GroupAlgebraElement) = isequal(X,Y) function add{T<:Number}(X::GroupAlgebraElement{T}, Y::GroupAlgebraElement{T}) X.product_matrix == Y.product_matrix || throw(ArgumentError(