mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2025-01-03 12:15:27 +01:00
actually cache and use savedhash + tests
This commit is contained in:
parent
5945462d45
commit
04d1591c7d
@ -201,8 +201,11 @@ end
|
||||
hash(s::AutSymbol, h::UInt) = hash(s.str, hash(s.pow, hash(:AutSymbol, h)))
|
||||
|
||||
function hash(g::AutGroupElem, h::UInt)
|
||||
gs = gens(parent(g).objectGroup)
|
||||
return hash(g(gs), hash(typeof(g), hash(parent(g), h)))
|
||||
if g.modified
|
||||
g.savedhash = hash(g(gens(parent(g).objectGroup)), hash(typeof(g), hash(parent(g), h)))
|
||||
g.modified = false
|
||||
end
|
||||
return g.savedhash
|
||||
end
|
||||
|
||||
function change_pow(s::AutSymbol, n::Int)
|
||||
@ -316,7 +319,7 @@ function reduce!(W::AutGroupElem)
|
||||
end
|
||||
end
|
||||
|
||||
W.modified = false
|
||||
W.savedhash = hash(W.symbols,hash(typeof(W)))
|
||||
W.modified = true
|
||||
|
||||
return W
|
||||
end
|
||||
|
@ -149,6 +149,16 @@
|
||||
b = Groups.flip_autsymbol(2)*A(inv(Groups.rmul_autsymbol(1,2)))
|
||||
@test a*b == b*a
|
||||
@test a^3 * b^3 == A()
|
||||
g,h = Nemo.gens(A)[[1,8]]
|
||||
domain = Nemo.gens(A.objectGroup)
|
||||
@test (g*h)(domain) == (h*g)(domain)
|
||||
@test (g*h).savedhash != (h*g).savedhash
|
||||
a = g*h
|
||||
b = h*g
|
||||
@test hash(a) == hash(b)
|
||||
@test a.savedhash == b.savedhash
|
||||
@test length(unique([a,b])) == 1
|
||||
@test length(unique([g*h, h*g])) == 1
|
||||
end
|
||||
|
||||
@testset "specific Aut(F4) tests" begin
|
||||
|
Loading…
Reference in New Issue
Block a user