mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-07-30 06:05:31 +02:00
formatting
This commit is contained in:
parent
0dd23532ac
commit
15af76f068
@ -160,11 +160,11 @@ end
|
|||||||
|
|
||||||
function show(io::IO, X::GroupRingElem)
|
function show(io::IO, X::GroupRingElem)
|
||||||
T = eltype(X.coeffs)
|
T = eltype(X.coeffs)
|
||||||
if X == parent(X)(T)
|
RG = parent(X)
|
||||||
print(io, "0*$((parent(X).group)())")
|
if X == RG(T)
|
||||||
|
print(io, "$(zero(T))*$((RG.group)())")
|
||||||
else
|
else
|
||||||
|
elts = ("$(X[i])*$(RG.basis[i])" for i in 1:length(X) if X[i] != zero(T))
|
||||||
elts = ("$(X[i])*$(parent(X).basis[i])" for i in 1:length(X) if X[i] != zero(T))
|
|
||||||
join(io, elts, " + ")
|
join(io, elts, " + ")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -198,10 +198,8 @@ end
|
|||||||
|
|
||||||
(*){T<:Number}(a::T, X::GroupRingElem{T}) = GroupRingElem(a*X.coeffs, parent(X))
|
(*){T<:Number}(a::T, X::GroupRingElem{T}) = GroupRingElem(a*X.coeffs, parent(X))
|
||||||
|
|
||||||
function scalar_multiplication{T<:Number, S<:Number}(a::T,
|
function scalar_mult{T<:Number, S<:Number}(a::T, X::GroupRingElem{S})
|
||||||
X::GroupRingElem{S})
|
promote_type(T,S) == S || warn("Scalar and coeffs are in different rings! Promoting result to $(promote_type(T,S))")
|
||||||
promote_type(T,S) == S || warn("Scalar and coeffs are in different rings!
|
|
||||||
Promoting result to $(promote_type(T,S))")
|
|
||||||
return GroupRingElem(a*X.coeffs, parent(X))
|
return GroupRingElem(a*X.coeffs, parent(X))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user