mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-11-14 21:25:28 +01:00
add baseless_warn global constant to suppress warnings
for baseless Group Rings
This commit is contained in:
parent
d14c4ca0e7
commit
df2e51128d
@ -11,6 +11,8 @@ import Base: convert, show, hash, ==, +, -, *, //, /, length, norm, rationalize,
|
|||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
baseless_warn = false
|
||||||
|
|
||||||
type GroupRing{Gr<:Group, T<:GroupElem} <: Ring
|
type GroupRing{Gr<:Group, T<:GroupElem} <: Ring
|
||||||
group::Gr
|
group::Gr
|
||||||
basis::Vector{T}
|
basis::Vector{T}
|
||||||
@ -232,7 +234,7 @@ function show(io::IO, X::GroupRingElem)
|
|||||||
end
|
end
|
||||||
print(io, str)
|
print(io, str)
|
||||||
else
|
else
|
||||||
warn("Basis of the parent Group is not defined, showing coeffs")
|
baseless_warn && warn("Basis of the parent Group is not defined, showing coeffs")
|
||||||
show(io, MIME("text/plain"), X.coeffs)
|
show(io, MIME("text/plain"), X.coeffs)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -257,7 +259,7 @@ function (==)(A::GroupRing, B::GroupRing)
|
|||||||
if isdefined(A, :basis) && isdefined(B, :basis)
|
if isdefined(A, :basis) && isdefined(B, :basis)
|
||||||
A.basis == B.basis || return false
|
A.basis == B.basis || return false
|
||||||
else
|
else
|
||||||
warn("Bases of GroupRings are not defined, comparing products mats.")
|
baseless_warn && warn("Bases of GroupRings are not defined, comparing products mats.")
|
||||||
A.pm == B.pm || return false
|
A.pm == B.pm || return false
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user