mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-09-27 19:40:36 +02:00
automorphisms apply in-place
This commit is contained in:
parent
dd4d23189b
commit
c8f0ee04da
@ -56,23 +56,33 @@ parent_type(::AutGroupElem) = AutGroup
|
|||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
function (ϱ::RTransvect)(v::NTuple{N, T}, pow=1::Int) where {N, T}
|
function (ϱ::RTransvect)(v, pow=1::Int)
|
||||||
return ntuple(k -> (k==ϱ.i ? v[ϱ.i]*v[ϱ.j]^pow : v[k]), N)::NTuple{N, T}
|
@inbounds Groups.r_multiply!(v[ϱ.i], (v[ϱ.j]^pow).symbols, reduced=false)
|
||||||
|
return v
|
||||||
end
|
end
|
||||||
|
|
||||||
function (λ::LTransvect)(v::NTuple{N, T}, pow=1::Int) where {N, T}
|
function (λ::LTransvect)(v, pow=1::Int)
|
||||||
return ntuple(k -> (k==λ.i ? v[λ.j]^pow*v[λ.i] : v[k]), N)::NTuple{N, T}
|
@inbounds Groups.l_multiply!(v[λ.i], (v[λ.j]^pow).symbols, reduced=false)
|
||||||
|
return v
|
||||||
end
|
end
|
||||||
|
|
||||||
function (σ::PermAut)(v::NTuple{N, T}, pow=1::Int) where {N, T}
|
function (σ::PermAut)(v, pow=1::Int)
|
||||||
return ntuple(k -> v[(σ.p^pow).d[k]], N)::NTuple{N, T}
|
w = deepcopy(v)
|
||||||
|
s = (σ.p^pow).d
|
||||||
|
@inbounds for k in eachindex(v)
|
||||||
|
v[k].symbols = w[s[k]].symbols
|
||||||
|
end
|
||||||
|
return v
|
||||||
end
|
end
|
||||||
|
|
||||||
function (ɛ::FlipAut)(v::NTuple{N, T}, pow=1::Int) where {N, T}
|
function (ɛ::FlipAut)(v, pow=1::Int)
|
||||||
return ntuple(k -> (k==ɛ.i ? v[k]^(-1^pow) : v[k]), N)::NTuple{N, T}
|
@inbounds if isodd(pow)
|
||||||
|
v[ɛ.i].symbols = inv(v[ɛ.i]).symbols
|
||||||
|
end
|
||||||
|
return v
|
||||||
end
|
end
|
||||||
|
|
||||||
(::Identity)(v::NTuple{N, T}, pow=1::Int) where {N, T} = v::NTuple{N, T}
|
(::Identity)(v, pow=1::Int) = v
|
||||||
|
|
||||||
# taken from ValidatedNumerics, under under the MIT "Expat" License:
|
# taken from ValidatedNumerics, under under the MIT "Expat" License:
|
||||||
# https://github.com/JuliaIntervals/ValidatedNumerics.jl/blob/master/LICENSE.md
|
# https://github.com/JuliaIntervals/ValidatedNumerics.jl/blob/master/LICENSE.md
|
||||||
|
Loading…
Reference in New Issue
Block a user