diff --git a/src/OrbitDecomposition.jl b/src/OrbitDecomposition.jl index 2cd28ec..c1d82f2 100644 --- a/src/OrbitDecomposition.jl +++ b/src/OrbitDecomposition.jl @@ -6,15 +6,15 @@ include("Projections.jl") # ############################################################################### -type FFEltsIter{T<:Nemo.FinField} +mutable struct FFEltsIter{T<:Generic.FinField} all::Int field::T - function FFEltsIter(F::T) + function FFEltsIter{T}(F::T) where {T} return new(Int(characteristic(F)^degree(F)), F) end end -FFEltsIter{T<:Nemo.FinField}(F::T) = FFEltsIter{T}(F) +FFEltsIter(F::T) where {T<:Nemo.FinField} = FFEltsIter{T}(F) import Base: start, next, done, eltype, length diff --git a/src/Projections.jl b/src/Projections.jl index 06c0b8a..538a66e 100644 --- a/src/Projections.jl +++ b/src/Projections.jl @@ -4,13 +4,13 @@ # ############################################################################### -abstract AbstractCharacter <: Function +abstract type AbstractCharacter <: Function end -immutable PermCharacter <: AbstractCharacter +struct PermCharacter <: AbstractCharacter p::Partition end -immutable DirectProdCharacter <: AbstractCharacter +struct DirectProdCharacter <: AbstractCharacter i::Int end @@ -90,19 +90,21 @@ function idempotents(RG::GroupRing{PermGroup}, T::Type=Rational{Int}) return unique(idems) end -function rankOne_projection{S}(chi::PropertyT.PermCharacter, idems::Vector{GroupRingElem{S}}) +function rankOne_projection(chi::PropertyT.PermCharacter, idems::Vector{S}) where {S<:GroupRingElem} RG = parent(first(idems)) - ids = [[one(RG, S)]; idems] + T = eltype(first(idems)) + + ids = [[one(RG, T)]; idems] for (i,j,k) in Base.product(ids, ids, ids) - if chi(i) == zero(S) || chi(j) == zero(S) || chi(k) == zero(S) + if chi(i) == zero(T) || chi(j) == zero(T) || chi(k) == zero(T) continue end elt = i*j*k elt^2 == elt || continue - if chi(elt) == one(S) + if chi(elt) == one(T) return elt # return (i,j,k) end