Skip to content

Commit

Permalink
Add show method for character tables (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored Mar 5, 2024
1 parent dc18448 commit 8ff8943
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/CharTable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,12 @@ Omitting `x` will return the names of all importable character tables.
# Examples
```jldoctest
julia> g=genchartab(\"GL2\");
julia> g = genchartab("GL2")
Generic character table
of order q^4 - q^3 - q^2 + q
with 4 irreducible character types
with 4 class types
with parameters (i, j, l, k)
```
"""
genchartab(x::String) = gentab(x, "Tables")
Expand All @@ -118,8 +122,12 @@ Omitting `x` will return the names of all importable greenfunctions.
# Examples
```jldoctest
julia> g=greenfuntab(\"GL2\");
julia> g = greenfuntab("GL2")
Generic character table
of order q^4 - q^3 - q^2 + q
with 2 irreducible character types
with 2 class types
without parameters
```
"""
greenfuntab(x::String) = gentab(x, "Greenfunctions")
Expand Down
23 changes: 23 additions & 0 deletions src/Show.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
export chartypes, irrchartypes, classtypes, status, printinfotab, printval, printinfoclass, printinfochar, printclassparam, printcharparam, centord, chardeg, nrchars, nrclasses, nrparams, params
# TODO PrintValPhi, PrintToTex?

import Oscar: pretty, Indent

function Base.show(io::IO, t::Table)
io = pretty(io)
println(io, "Generic character table", Indent())
println(io, "of order ", t.order)
c = congruence(t)
if c !== nothing
println(io, "restricted to q congruent to ", c[1], " modulo ", c[2])
end
println(io, "with ", irrchartypes(t)," irreducible character types")
println(io, "with ", classtypes(t)," class types")
if t isa SimpleCharTable
print(io, "without parameters")
else
print(io, "with parameters ", params(t)[2])
end
end

"""
chartypes(t::Table)
Expand Down Expand Up @@ -48,6 +67,10 @@ function classtypes(t::Table)
size(t.table, 2)
end

# TODO: document (and export) this?
congruence(x::CharTable) = x.congruence
congruence(x::SimpleCharTable) = nothing

"""
status(t::Table)
Expand Down

0 comments on commit 8ff8943

Please sign in to comment.