From f6b31ec2c9c1b623858b13cf861ccb0695899324 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Mon, 13 Aug 2018 19:34:24 +0200 Subject: [PATCH] don't compare bases when ==(::GroupRing, ::GroupRing) comparing pm should be enough --- src/GroupRings.jl | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/GroupRings.jl b/src/GroupRings.jl index dc6960c..b3c7220 100644 --- a/src/GroupRings.jl +++ b/src/GroupRings.jl @@ -250,22 +250,24 @@ end ############################################################################### function (==)(X::GroupRingElem, Y::GroupRingElem) - parent(X) == parent(Y) || return false if eltype(X.coeffs) != eltype(Y.coeffs) warn("Comparing elements with different coeffs Rings!") end - all(X.coeffs .== Y.coeffs) || return false + suppX = supp(X) + suppX == supp(Y) || return false + + for g in suppX + X[g] == Y[g] || return false + end + return true end function (==)(A::GroupRing, B::GroupRing) A.group == B.group || return false - if isdefined(A, :basis) && isdefined(B, :basis) - A.basis == B.basis || return false - else - baseless_warn && warn("Bases of GroupRings are not defined, comparing products mats.") - A.pm == B.pm || return false - end + complete!(A) + complete!(B) + A.pm == B.pm || return false return true end