== for GroupRing and GroupRingElem

This commit is contained in:
kalmar 2017-05-16 18:36:00 +02:00
parent ad97e1fab7
commit 955aaf48fa
1 changed files with 14 additions and 1 deletions

View File

@ -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(