1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-11-10 20:25:28 +01:00

add AbstractMatrixGroup

This commit is contained in:
Marek Kaluba 2023-03-15 17:11:22 +01:00
parent f096a869b8
commit a380959614
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
3 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
include("eltary_matrices.jl")
struct SpecialLinearGroup{N,T,R,A,S} <: MatrixGroup{N,T}
struct SpecialLinearGroup{N,T,R,A,S} <: AbstractMatrixGroup{N,T}
base_ring::R
alphabet::A
gens::S

View File

@ -1,6 +1,6 @@
include("eltary_symplectic.jl")
struct SymplecticGroup{N,T,R,A,S} <: MatrixGroup{N,T}
struct SymplecticGroup{N,T,R,A,S} <: AbstractMatrixGroup{N,T}
base_ring::R
alphabet::A
gens::S

View File

@ -1,5 +1,5 @@
abstract type MatrixGroup{N,T} <: Groups.AbstractFPGroup end
const MatrixGroupElement{N,T} = Groups.AbstractFPGroupElement{<:MatrixGroup{N,T}}
abstract type AbstractMatrixGroup{N,T} <: Groups.AbstractFPGroup end
const MatrixGroupElement{N,T} = Groups.AbstractFPGroupElement{<:AbstractMatrixGroup{N,T}}
Base.isone(g::MatrixGroupElement{N,T}) where {N,T} =
isone(word(g)) || isone(matrix(g))
@ -32,9 +32,9 @@ end
function Base.rand(
rng::Random.AbstractRNG,
rs::Random.SamplerTrivial{<:MatrixGroup},
rs::Random.SamplerTrivial{<:AbstractMatrixGroup},
)
Mgroup = rs[]
S = gens(Mgroup)
return prod(g -> rand(Bool) ? g : inv(g), rand(S, rand(1:30)))
return prod(g -> rand(rng, Bool) ? g : inv(g), rand(rng, S, rand(rng, 1:30)))
end