1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-12-25 18:15:29 +01:00

periodically reduce words in automorphism evaluation

to avoid exponential explosion in length (when possible)
This commit is contained in:
kalmarek 2020-03-12 00:18:33 -05:00
parent eb15593c21
commit 5414988e98
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15

View File

@ -150,7 +150,7 @@ end
function domain(G::AutGroup{N}) where N
F = G.objectGroup
gg = gens(F)
return ntuple(i->gg[i], Val(N))
return ntuple(i->gg[i], N)
end
###############################################################################
@ -223,8 +223,9 @@ function (f::AutSymbol)(v::NTuple{N, T}) where {N, T}
end
function (F::Automorphism{N})(v::NTuple{N, T}) where {N, T}
for f in F.symbols
for (i, f) in enumerate(F.symbols)
v = f(v)::NTuple{N, T}
i % 5 == 0 && reduce!.(v)
end
return v
end