Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid some direct member access #200

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/GenericCharacter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function tensor_product(char1::GenericCharacter, char2::GenericCharacter)
char2id=chartypeid(char2)
char1id !== nothing || error("Characters are not both irreducible.")
char2id !== nothing || error("Characters are not both irreducible.")
new_char_degree=char1.degree*char2.degree
new_char_degree=degree(char1)*degree(char2)
new_char_values=Vector{GenericCyclo}(undef, number_of_conjugacy_class_types(t))
for class in 1:number_of_conjugacy_class_types(t)
# The first 4 variable sets are reserved for the computations in Ortho.jl
Expand Down Expand Up @@ -73,7 +73,7 @@ function tensor_product(char1::SimpleGenericCharacter{T}, char2::SimpleGenericCh
char2id=chartypeid(char2)
char1id !== nothing || error("Characters are not both irreducible.")
char2id !== nothing || error("Characters are not both irreducible.")
new_char_degree=char1.degree*char2.degree
new_char_degree=degree(char1)*degree(char2)
new_char_values=Vector{T}(undef, number_of_conjugacy_class_types(t))
for class in 1:number_of_conjugacy_class_types(t)
new_char_values[class]=char1[class]*char2[class]
Expand Down Expand Up @@ -112,7 +112,7 @@ function omega(char::GenericCharacter)
new_char_degree=base_ring(t.ring)(1)
new_char_values=Vector{GenericCyclo}(undef, number_of_conjugacy_class_types(t))
for class in 1:number_of_conjugacy_class_types(t)
new_char_values[class]=divexact(t.classlength[class]*char[class], char.degree)
new_char_values[class]=divexact(t.classlength[class]*char[class], degree(char))
end
return GenericCharacter(t, new_char_values, ["Omega of type $charid"], new_char_degree, nothing, char.params)
end
Expand Down Expand Up @@ -141,7 +141,7 @@ function omega(char::SimpleGenericCharacter{T}) where T <: NfPoly
new_char_degree=t.ring(1)
new_char_values=Vector{T}(undef, number_of_conjugacy_class_types(t))
for class in 1:number_of_conjugacy_class_types(t)
new_char_values[class]=divexact(t.classlength[class]*char[class], char.degree)
new_char_values[class]=divexact(t.classlength[class]*char[class], degree(char))
end
return SimpleGenericCharacter{T}(t, new_char_values, ["Omega of type $charid"], new_char_degree)
end
Expand Down Expand Up @@ -189,7 +189,7 @@ function lincomb(coeffs::Vector{Int64}, chars::Vector{<:GenericCharacter})
gens(S, vars.*string(extra_var_batches+i))
end
end
degrees=map(x -> x.degree, chars)
degrees=map(degree, chars)
new_char_degree=sum(coeffs.*degrees)
new_char_values=Vector{GenericCyclo}(undef, number_of_conjugacy_class_types(t))
for class in 1:number_of_conjugacy_class_types(t)
Expand Down Expand Up @@ -238,7 +238,7 @@ function lincomb(coeffs::Vector{Int64}, chars::Vector{SimpleGenericCharacter{T}}
charids[i] !== nothing || error("Characters are not all irreducible.")
end
coeffs=map(x -> t.ring(x), coeffs) # TODO ring needed?
degrees=map(x -> x.degree, chars)
degrees=map(degree, chars)
new_char_degree=sum(coeffs.*degrees)
new_char_values=Vector{T}(undef, number_of_conjugacy_class_types(t))
for class in 1:number_of_conjugacy_class_types(t)
Expand Down Expand Up @@ -271,7 +271,7 @@ function norm(char::GenericCharacter)
val=char[class]
sum+=t.classlength[class]*classsum(t, class, val*conj(val))
end
return shrink(sum//t.order)
return shrink(sum//order(t))
end

@doc raw"""
Expand All @@ -293,7 +293,7 @@ function norm(char::SimpleGenericCharacter{T}) where T <: NfPoly
for class in 1:number_of_conjugacy_class_types(t)
sum+=char[class]^2*t.classlength[class]*t.classtypeorder[class]
end
return sum//t.order
return sum//order(t)
end

@doc raw"""
Expand Down Expand Up @@ -322,7 +322,7 @@ function scalar_product(char1::GenericCharacter, char2::GenericCharacter)
val2=shift_char_parameters(t, char2[class], 2)
sum+=t.classlength[class]*classsum(t, class, val1*conj(val2))
end
return shrink(sum//t.order)
return shrink(sum//order(t))
end

@doc raw"""
Expand All @@ -345,7 +345,7 @@ function scalar_product(char1::SimpleGenericCharacter{T}, char2::SimpleGenericCh
for class in 1:number_of_conjugacy_class_types(t)
sum+=char1[class]*char2[class]*t.classlength[class]*t.classtypeorder[class]
end
return sum//t.order
return sum//order(t)
end

@doc raw"""
Expand Down Expand Up @@ -392,7 +392,7 @@ function specialize(char::GenericCharacter, var::UPoly, expr::RingElement)
new_params=deepcopy(char.params)
push!(new_params.substitutions, ParameterSubstitution(var, base_ring(t.ring)(expr)))
# TODO: What about the sum function here?
return GenericCharacter(t, new_char_values, char.info, char.degree, nothing, new_params)
return GenericCharacter(t, new_char_values, char.info, degree(char), nothing, new_params)

end

Expand Down
16 changes: 8 additions & 8 deletions src/Ortho.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ function class_multiplication_coefficient(t::CharTable, class1::Int64, class2::I
val1=shift_class_parameters(t, char[class1], 1)
val2=shift_class_parameters(t, char[class2], 2)
val3=shift_class_parameters(t, char[class3], 3)
sum+=t.order*charsum(char, val1*val2*conj(val3))//char.degree # TODO move t.order* to the end of the function
sum+=order(t)*charsum(char, val1*val2*conj(val3))//degree(char) # TODO move order(t)* to the end of the function
end
return shrink((t.classlength[class1]*t.classlength[class2])*sum//(t.order^2))
return shrink((t.classlength[class1]*t.classlength[class2])*sum//(order(t)^2))
end

@doc raw"""
Expand All @@ -43,9 +43,9 @@ function class_multiplication_coefficient(t::SimpleCharTable{T}, class1::Int64,
sum=0
for char in t
sum1=char[class1]*char[class2]*char[class3]
sum+=t.order*sum1//char.degree # TODO move t.order* to the end of the function
sum+=order(t)*sum1//degree(char) # TODO move order(t)* to the end of the function
end
return (t.classlength[class1]*t.classlength[class2])*sum//(t.order^2)
return (t.classlength[class1]*t.classlength[class2])*sum//(order(t)^2)
end

@doc raw"""
Expand All @@ -67,7 +67,7 @@ function norm(t::CharTable, class::Int64)
val=char[class]
sum+=charsum(char, val*conj(val))
end
return shrink(t.classlength[class]*sum//t.order)
return shrink(t.classlength[class]*sum//order(t))
end

@doc raw"""
Expand All @@ -88,7 +88,7 @@ function norm(t::SimpleCharTable{T}, class::Int64) where T <: NfPoly # TODO is
for char in t
sum+=char[class]^2
end
return t.classlength[class]*sum//t.order
return t.classlength[class]*sum//order(t)
end

@doc raw"""
Expand All @@ -115,7 +115,7 @@ function scalar_product(t::CharTable, class1::Int64, class2::Int64)
val2=shift_class_parameters(t, char[class2], 2)
sum+=charsum(char, val1*conj(val2))
end
return shrink(t.classlength[class1]*sum//t.order)
return shrink(t.classlength[class1]*sum//order(t))
end

@doc raw"""
Expand All @@ -136,5 +136,5 @@ function scalar_product(t::SimpleCharTable{T}, class1::Int64, class2::Int64) whe
for char in t
sum+=char[class1]*char[class2]
end
return t.classlength[class1]*sum//t.order
return t.classlength[class1]*sum//order(t)
end
6 changes: 3 additions & 3 deletions src/Show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ julia> [g]
function show(io::IO, ::MIME"text/plain", t::Table)
io = pretty(io)
println(io, "Generic character table ", t.importname, Indent())
println(io, "of order ", t.order)
println(io, "of order ", order(t))
c = congruence(t)
if c !== nothing
println(io, "restricted to ", gens(base_ring(t.ring))[1], " congruent to ", c[1], " modulo ", c[2])
Expand Down Expand Up @@ -77,7 +77,7 @@ function show(io::IO, ::MIME"text/plain", c::AbstractGenericCharacter)
println(io, "with parameters ", Indent())
println(io, c.params, Dedent())
end
println(io, "of degree ", c.degree)
println(io, "of degree ", degree(c))
print(io, "with values", Indent())
for val in c.values
print(io, "\n", val)
Expand Down Expand Up @@ -193,7 +193,7 @@ q^4 - q^3 - q^2 + q

```
"""
centralizer_order(t::Table, class::Int64) = div(t.order, t.classlength[class])
centralizer_order(t::Table, class::Int64) = div(order(t), t.classlength[class])

@doc raw"""
number_of_conjugacy_classes(t::CharTable, class::Int64)
Expand Down
Loading