1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-09-13 08:25:39 +02:00

introduce evaluate function

This commit is contained in:
kalmarek 2020-03-12 18:36:17 -05:00
parent 6fd89c5a61
commit 68abfafd29
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15

View File

@ -232,6 +232,8 @@ function (F::Automorphism{N})(v::NTuple{N, T}) where {N, T}
return v return v
end end
evaluate(F::Automorphism{N}) = f(domain(parent(f)))
############################################################################### ###############################################################################
# #
# Comparison # Comparison
@ -248,7 +250,7 @@ end
function hash(g::Automorphism, h::UInt) function hash(g::Automorphism, h::UInt)
if g.modified if g.modified
g_im = reduce!.(g(domain(parent(g)))) g_im = reduce!.(evaluate(g))
g.savedhash = hash(g, g_im) g.savedhash = hash(g, g_im)
g.modified = false g.modified = false
end end
@ -265,8 +267,8 @@ function (==)(g::Automorphism{N}, h::Automorphism{N}) where N
end end
# expensive: # expensive:
g_im = reduce!.(g(domain(parent(g)))) g_im = reduce!.(evaluate(g))
h_im = reduce!.(h(domain(parent(h)))) h_im = reduce!.(evaluate(h))
# cheap: # cheap:
g.savedhash = hash(g, g_im) g.savedhash = hash(g, g_im)
g.modified = false g.modified = false