Skip to content

Commit

Permalink
Fix show method for FreeMod_dec (oscar-system#4254)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored Oct 30, 2024
1 parent 852b6d1 commit 5ee96e7
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions src/Modules/ModulesGraded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2046,7 +2046,7 @@ julia> R, (x,y) = graded_polynomial_ring(QQ, [:x, :y])
(Graded multivariate polynomial ring in 2 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y])
julia> free_module_dec(R,3)
Decorated free module of rank 3 over RR^3([0])
Decorated free module of rank 3 over R
```
"""
Expand Down Expand Up @@ -2107,23 +2107,9 @@ function show(io::IO, F::FreeMod_dec)
@show_special(io, F)

io = terse(io)
io = pretty(io)
print(io, "Decorated free module of rank $(rank(F)) over ")
print(IOContext(io, :compact => true), base_ring(F))

i = 1
while i < dim(F)
d = F.d[i]
j = 1
while i+j <= dim(F) && d == F.d[i+j]
j += 1
end
print(IOContext(io, :compact => true), base_ring(F), "^$j")
print(IOContext(io, :compact => true), "(", -d, ")")
if i+j < dim(F)
print(io, " + ")
end
i += j
end
print(IOContext(io, :compact => true), Lowercase(), base_ring(F))
end

# Generic specialized show methods (formerly in Hecke)
Expand Down

0 comments on commit 5ee96e7

Please sign in to comment.