mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-10-17 00:15:35 +02:00
small tweaks to printing
This commit is contained in:
parent
63b4a0594f
commit
9f6287382d
@ -208,9 +208,9 @@ function show(io::IO, X::GroupRingElem)
|
||||
elseif isdefined(RG, :basis)
|
||||
non_zeros = ((X.coeffs[i], RG.basis[i]) for i in findn(X.coeffs))
|
||||
elts = ("$(sign(c)> 0? " + ": " - ")$(abs(c))*$g" for (c,g) in non_zeros)
|
||||
str = join(elts, "")
|
||||
str = join(elts, "")[2:end]
|
||||
if sign(first(non_zeros)[1]) > 0
|
||||
str = str[4:end]
|
||||
str = str[3:end]
|
||||
end
|
||||
print(io, str)
|
||||
else
|
||||
|
@ -77,7 +77,8 @@ using Nemo
|
||||
@test a[5] == 1
|
||||
@test a[p] == 1
|
||||
|
||||
@test string(a) == " + 1*[2, 3, 1]"
|
||||
@test string(a) == "1*[2, 3, 1]"
|
||||
@test string(-a) == "- 1*[2, 3, 1]"
|
||||
|
||||
@test RG([0,0,0,0,1,0]) == a
|
||||
|
||||
@ -89,7 +90,8 @@ using Nemo
|
||||
@test a[1] == 2
|
||||
@test a[s] == 2
|
||||
|
||||
@test string(a) == " + 2*[1, 2, 3] + 1*[2, 3, 1]"
|
||||
@test string(a) == "2*[1, 2, 3] + 1*[2, 3, 1]"
|
||||
@test string(-a) == "- 2*[1, 2, 3] - 1*[2, 3, 1]"
|
||||
|
||||
@test length(a) == 2
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user