indentation and other trivial changes

This commit is contained in:
kalmarek 2019-06-06 17:01:50 +02:00
parent c6b557080d
commit 65d2df3a40
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
2 changed files with 74 additions and 75 deletions

View File

@ -27,8 +27,6 @@ function mul!(result::GroupRingElem, X::GroupRingElem, Y::GroupRingElem)
result = zero!(_dealias(result, X, Y))
X_nzeros_idx = findall(!iszero, X.coeffs)
Y_nzeros_idx = findall(!iszero, Y.coeffs)
# X_nzeros_idx = [i for i in eachindex(X.coeffs) if X[i] != zero(eltype(X))]
# Y_nzeros_idx = [i for i in eachindex(Y.coeffs) if Y[i] != zero(eltype(Y))]
RG = parent(X)

View File

@ -43,7 +43,7 @@ end
###############################################################################
Base.show(io::IO, RG::GroupRing) =
print(io, "Group ring of $(RG.group) with coefficients in $(base_ring(RG))")
print(io, "Group ring of $(RG.group) with coefficients in $(base_ring(RG))")
function Base.show(io::IO, X::GroupRingElem{T}) where T
RG = parent(X)
@ -93,7 +93,7 @@ end
Base.isequal(X::GroupRingElem, Y::GroupRingElem) = X == Y
_equalorzero(x,y) = x == y || x == 0 || y == 0
_equalorzero(x,y) = x == 0 || y == 0 || x == y
function ==(A::GroupRing, B::GroupRing)
A.group == B.group || return false
@ -105,8 +105,8 @@ function ==(A::GroupRing, B::GroupRing)
if bases && caches
length(A) == length(B) || return false
size(A.pm) == size(B.pm) || return false
all(A.basis[i] == B.basis[i] for i in eachindex(A.basis)) || return false
all(_equalorzero(A.pm[i], B.pm[i]) for i in eachindex(A.pm)) || return false
all(A.basis[i] == B.basis[i] for i = eachindex(A.basis)) || return false
all(_equalorzero(A.pm[i], B.pm[i]) for i=eachindex(A.pm)) || return false
return true
elseif bases # && !caches
length(A) == length(B) || return false
@ -161,6 +161,7 @@ function AbstractAlgebra.promote_rule(u::Type{U}, x::Type{GREl}) where {T, GREl<
return AbstractAlgebra.promote_rule(x, u)
end
function Base.rand(RG::GroupRing, density=0.05, args...)
l = length(RG)