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:
parent
eb15593c21
commit
5414988e98
@ -150,7 +150,7 @@ end
|
|||||||
function domain(G::AutGroup{N}) where N
|
function domain(G::AutGroup{N}) where N
|
||||||
F = G.objectGroup
|
F = G.objectGroup
|
||||||
gg = gens(F)
|
gg = gens(F)
|
||||||
return ntuple(i->gg[i], Val(N))
|
return ntuple(i->gg[i], N)
|
||||||
end
|
end
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -223,8 +223,9 @@ function (f::AutSymbol)(v::NTuple{N, T}) where {N, T}
|
|||||||
end
|
end
|
||||||
|
|
||||||
function (F::Automorphism{N})(v::NTuple{N, T}) where {N, T}
|
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}
|
v = f(v)::NTuple{N, T}
|
||||||
|
i % 5 == 0 && reduce!.(v)
|
||||||
end
|
end
|
||||||
return v
|
return v
|
||||||
end
|
end
|
||||||
@ -248,7 +249,7 @@ function hash(g::Automorphism, h::UInt)
|
|||||||
g_im = reduce!.(g(domain(parent(g))))
|
g_im = reduce!.(g(domain(parent(g))))
|
||||||
g.savedhash = hash(g, g_im)
|
g.savedhash = hash(g, g_im)
|
||||||
g.modified = false
|
g.modified = false
|
||||||
end
|
end
|
||||||
return xor(g.savedhash, h)
|
return xor(g.savedhash, h)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user