Skip to content

Commit

Permalink
add missing methods for AbstractGenericCharacter in Show.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
SoongNoonien committed Sep 23, 2024
1 parent 0663f72 commit c3b3eda
Showing 1 changed file with 43 additions and 12 deletions.
55 changes: 43 additions & 12 deletions src/Show.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Oscar.order
import Oscar.AbstractAlgebra: degree

export centord
export chardeg
Expand Down Expand Up @@ -307,9 +308,25 @@ function chardeg(t::Table, char::Int64)
if char > chartypes(t)
throw(DomainError(char, "Character type is out of range."))
end
t[char].degree
return degree(t[char])
end

@doc raw"""
degree(char::AbstractGenericCharacter)
Return the character degree of `char`.
# Examples
```jldoctest
julia> g=genchartab("GL2");
julia> degree(g[3])
q + 1
```
"""
degree(char::AbstractGenericCharacter) = char.degree

@doc raw"""
nrchars(t::Table, char::Int64)
Expand All @@ -326,22 +343,36 @@ q - 1
```
"""
function nrchars(t::CharTable, char::Int64)
if char > irrchartypes(t)
throw(DomainError(char, "Cannot calculate number of characters in reducible types."))
else
o=t.ring(1)
result=t[char].sum(o//o)
return shrink(result)
end
end
function nrchars(t::SimpleCharTable, char::Int64)
function nrchars(t::Table, char::Int64)
if char > chartypes(t)
throw(DomainError(char, "Character type is out of range."))
end
1
return nrchars(t[char])
end

@doc raw"""
nrchars(char::GenericCharacter)
Return the number of characters in the generic character `char`.
# Examples
```jldoctest
julia> g=genchartab("GL2");
julia> nrchars(g[1])
q - 1
```
"""
function nrchars(char::GenericCharacter)
!iszero(chartypeid(char)) || error("Cannot calculate number of characters in reducible types.")
o=parent(char).ring(1)
result=charsum(char, o//o)
return shrink(result)
end

nrchars(char::SimpleGenericCharacter) = 1

@doc raw"""
nrclasses(t::Table, class::Int64)
Expand Down

0 comments on commit c3b3eda

Please sign in to comment.