From 8248039d63bd6d7741fc747e2b63c08cc1ce81cd Mon Sep 17 00:00:00 2001 From: kalmarek Date: Wed, 25 Mar 2020 00:51:53 +0100 Subject: [PATCH] simplify actions of PermAut and FlipAut --- src/AutGroup.jl | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/AutGroup.jl b/src/AutGroup.jl index 18c7af7..accbd26 100644 --- a/src/AutGroup.jl +++ b/src/AutGroup.jl @@ -77,25 +77,19 @@ function (λ::LTransvect)(v, pow::Integer=1) end function (σ::PermAut)(v, pow::Integer=1) - w = deepcopy(v) - if pow == 1 - @inbounds for k in eachindex(v) - v[k].symbols = w[σ.perm.d[k]].symbols - end - else - s = (σ.perm^pow).d - @inbounds for k in eachindex(v) - v[k].symbols = w[s[k]].symbols - end - end - return v + w = deepcopy(v) + s = (σ.perm^pow).d + @inbounds for k in eachindex(v) + v[k].symbols = w[s[k]].symbols + end + return v end function (ɛ::FlipAut)(v, pow::Integer=1) - @inbounds if isodd(pow) - v[ɛ.i].symbols = inv(v[ɛ.i]).symbols - end - return v + @inbounds if isodd(pow) + v[ɛ.i].symbols = inv(v[ɛ.i]).symbols + end + return v end (::Identity)(v, pow::Integer=1) = v