mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-12-26 02:20:30 +01:00
add PermAut(omorphisms)
This commit is contained in:
parent
939d231bbe
commit
15a737bfa5
@ -81,3 +81,26 @@ Base.@propagate_inbounds function evaluate!(v::NTuple{T, N}, t::Transvection, A:
|
|||||||
|
|
||||||
return v
|
return v
|
||||||
end
|
end
|
||||||
|
|
||||||
|
struct PermAut <: GSymbol
|
||||||
|
perm::Vector{UInt8}
|
||||||
|
|
||||||
|
function PermAut(p::AbstractVector{<:Integer})
|
||||||
|
@assert sort(p) == 1:length(p)
|
||||||
|
return new(p)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Base.show(io::IO, p::PermAut)
|
||||||
|
print(io, 'σ')
|
||||||
|
join(io, (subscriptify(Int(i)) for i in p.perm))
|
||||||
|
end
|
||||||
|
|
||||||
|
Base.inv(p::PermAut) = PermAut(invperm(p.perm))
|
||||||
|
|
||||||
|
Base.:(==)(p::PermAut, q::PermAut) = p.perm == q.perm
|
||||||
|
Base.hash(p::PermAut, h::UInt) = hash(p.perm, hash(PermAut, h))
|
||||||
|
|
||||||
|
Base.@propagate_inbounds function evaluate!(v::NTuple{T, N}, p::PermAut, ::Alphabet, tmp=one(first(v))) where {T, N}
|
||||||
|
return v[p.perm]
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user