small tweaks to printing
This commit is contained in:
parent
f852a6ca8e
commit
4cb4d299de
|
@ -214,9 +214,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
|
||||
|
|
|
@ -83,7 +83,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
|
||||
|
||||
|
@ -95,7 +96,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