diff --git a/src/matrix_groups/SLn.jl b/src/matrix_groups/SLn.jl index d95107e..57e4f22 100644 --- a/src/matrix_groups/SLn.jl +++ b/src/matrix_groups/SLn.jl @@ -1,25 +1,26 @@ include("eltary_matrices.jl") -struct SpecialLinearGroup{N,T,R,A,S} <: AbstractMatrixGroup{N,T} +struct SpecialLinearGroup{N,T,R,S} <: AbstractMatrixGroup{N,T} base_ring::R - alphabet::A - gens::S + alphabet::Alphabet{S} + gens::Vector{S} function SpecialLinearGroup{N}(base_ring) where {N} - S = [ElementaryMatrix{N}(i, j, one(base_ring)) for i in 1:N for j in 1:N if i ≠ j] + S = [ + ElementaryMatrix{N}(i, j, one(base_ring)) for i in 1:N for + j in 1:N if i ≠ j + ] alphabet = Alphabet(S) - return new{ - N, - eltype(base_ring), - typeof(base_ring), - typeof(alphabet), - typeof(S) - }(base_ring, alphabet, S) + T = eltype(base_ring) + R = typeof(base_ring) + St = eltype(S) + + return new{N,T,R,St}(base_ring, alphabet, S) end end -GroupsCore.ngens(SL::SpecialLinearGroup{N}) where {N} = N^2 - N +GroupsCore.ngens(SL::SpecialLinearGroup) = length(SL.gens) function Base.show(io::IO, ::SpecialLinearGroup{N,T}) where {N,T} return print(io, "SL{$N,$T}") diff --git a/src/matrix_groups/Spn.jl b/src/matrix_groups/Spn.jl index d66c0af..2361050 100644 --- a/src/matrix_groups/Spn.jl +++ b/src/matrix_groups/Spn.jl @@ -1,21 +1,19 @@ include("eltary_symplectic.jl") -struct SymplecticGroup{N,T,R,A,S} <: AbstractMatrixGroup{N,T} +struct SymplecticGroup{N,T,R,S} <: AbstractMatrixGroup{N,T} base_ring::R - alphabet::A - gens::S + alphabet::Alphabet{S} + gens::Vector{S} function SymplecticGroup{N}(base_ring) where {N} S = symplectic_gens(N, eltype(base_ring)) alphabet = Alphabet(S) - return new{ - N, - eltype(base_ring), - typeof(base_ring), - typeof(alphabet), - typeof(S) - }(base_ring, alphabet, S) + T = eltype(base_ring) + R = typeof(base_ring) + St = eltype(S) + + return new{N,T,R,St}(base_ring, alphabet, S) end end