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)))
|
hash(s::AutSymbol, h::UInt) = hash(s.str, hash(s.pow, hash(:AutSymbol, h)))
|
||||||
|
|
||||||
function hash(g::AutGroupElem, h::UInt)
|
function hash(g::AutGroupElem, h::UInt)
|
||||||
gs = gens(parent(g).objectGroup)
|
if g.modified
|
||||||
return hash(g(gs), hash(typeof(g), hash(parent(g), h)))
|
g.savedhash = hash(g(gens(parent(g).objectGroup)), hash(typeof(g), hash(parent(g), h)))
|
||||||
|
g.modified = false
|
||||||
|
end
|
||||||
|
return g.savedhash
|
||||||
end
|
end
|
||||||
|
|
||||||
function change_pow(s::AutSymbol, n::Int)
|
function change_pow(s::AutSymbol, n::Int)
|
||||||
|
@ -316,7 +319,7 @@ function reduce!(W::AutGroupElem)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
W.modified = false
|
W.modified = true
|
||||||
W.savedhash = hash(W.symbols,hash(typeof(W)))
|
|
||||||
return W
|
return W
|
||||||
end
|
end
|
||||||
|
|
|
@ -149,6 +149,16 @@
|
||||||
b = Groups.flip_autsymbol(2)*A(inv(Groups.rmul_autsymbol(1,2)))
|
b = Groups.flip_autsymbol(2)*A(inv(Groups.rmul_autsymbol(1,2)))
|
||||||
@test a*b == b*a
|
@test a*b == b*a
|
||||||
@test a^3 * b^3 == 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
|
end
|
||||||
|
|
||||||
@testset "specific Aut(F4) tests" begin
|
@testset "specific Aut(F4) tests" begin
|
||||||
|
|
Loading…
Reference in New Issue