mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-12-26 02:20:30 +01:00
make evaluate[!] a general thing for AutomorphismGroups
This commit is contained in:
parent
e7740b9716
commit
66a33e7c72
@ -18,17 +18,3 @@ function relations(G::AutomorphismGroup{<:FreeGroup})
|
|||||||
n = length(KnuthBendix.alphabet(object(G))) ÷ 2
|
n = length(KnuthBendix.alphabet(object(G))) ÷ 2
|
||||||
return last(gersten_relations(n, commutative = false))
|
return last(gersten_relations(n, commutative = false))
|
||||||
end
|
end
|
||||||
|
|
||||||
evaluate(f::FPGroupElement{<:AutomorphismGroup{<:FreeGroup}}) = evaluate!(domain(f), f)
|
|
||||||
|
|
||||||
function evaluate!(
|
|
||||||
t::NTuple{N,T},
|
|
||||||
f::FPGroupElement{<:AutomorphismGroup{<:FreeGroup}},
|
|
||||||
tmp = one(first(t)),
|
|
||||||
) where {T<:FPGroupElement,N}
|
|
||||||
A = alphabet(f)
|
|
||||||
for idx in word(f)
|
|
||||||
t = @inbounds evaluate!(t, A[idx], alphabet(object(parent(f))), tmp)::NTuple{N,T}
|
|
||||||
end
|
|
||||||
return t
|
|
||||||
end
|
|
||||||
|
@ -46,7 +46,7 @@ Base.:(==)(t::Transvection, s::Transvection) =
|
|||||||
t.id === s.id && t.ij == s.ij && t.inv == s.inv
|
t.id === s.id && t.ij == s.ij && t.inv == s.inv
|
||||||
Base.hash(t::Transvection, h::UInt) = hash(t.id, hash(t.ij, hash(t.inv, h)))
|
Base.hash(t::Transvection, h::UInt) = hash(t.id, hash(t.ij, hash(t.inv, h)))
|
||||||
|
|
||||||
Base.@propagate_inbounds function evaluate!(v::Tuple, t::Transvection, A::Alphabet, tmp=one(first(v)))
|
Base.@propagate_inbounds function evaluate!(v::NTuple{T, N}, t::Transvection, A::Alphabet, tmp=one(first(v))) where {T, N}
|
||||||
i, j = indices(t)
|
i, j = indices(t)
|
||||||
@assert i ≤ length(v) && j ≤ length(v)
|
@assert i ≤ length(v) && j ≤ length(v)
|
||||||
|
|
||||||
|
@ -89,6 +89,20 @@ Base.show(io::IO, A::AutomorphismGroup) = print(io, "automorphism group of ", ob
|
|||||||
domain(f::FPGroupElement{<:AutomorphismGroup}) = deepcopy(parent(f).domain)
|
domain(f::FPGroupElement{<:AutomorphismGroup}) = deepcopy(parent(f).domain)
|
||||||
# tuple(gens(object(parent(f)))...)
|
# tuple(gens(object(parent(f)))...)
|
||||||
|
|
||||||
evaluate(f::FPGroupElement{<:AutomorphismGroup}) = throw("you need to implement `evaluate(::typeof(f))`")
|
evaluate(f::FPGroupElement{<:AutomorphismGroup}) = evaluate!(domain(f), f)
|
||||||
|
|
||||||
|
function evaluate!(
|
||||||
|
t::NTuple{N,T},
|
||||||
|
f::FPGroupElement{<:AutomorphismGroup{<:Group}},
|
||||||
|
tmp = one(first(t)),
|
||||||
|
) where {N, T}
|
||||||
|
A = alphabet(f)
|
||||||
|
AF = alphabet(object(parent(f)))
|
||||||
|
for idx in word(f)
|
||||||
|
t = @inbounds evaluate!(t, A[idx], AF, tmp)::NTuple{N,T}
|
||||||
end
|
end
|
||||||
|
return t
|
||||||
|
end
|
||||||
|
|
||||||
|
evaluate!(t::NTuple{N, T}, s::GSymbol, A, tmp=one(first(t))) where {N, T} = throw("you need to implement `evaluate!(::$(typeof(t)), ::$(typeof(s)), ::Alphabet, tmp=one(first(t)))`")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user