mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-11-19 06:30:29 +01:00
periodically reduce words in automorphism evaluation
to avoid exponential explosion in length (when possible)
This commit is contained in:
parent
eb15593c21
commit
5414988e98
@ -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
|
||||
@ -248,7 +249,7 @@ function hash(g::Automorphism, h::UInt)
|
||||
g_im = reduce!.(g(domain(parent(g))))
|
||||
g.savedhash = hash(g, g_im)
|
||||
g.modified = false
|
||||
end
|
||||
end
|
||||
return xor(g.savedhash, h)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user