1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-11-19 06:30:29 +01:00

add minimal internal arithmetic for Freesymbols

This commit is contained in:
kalmar 2017-07-23 17:08:32 +02:00
parent 2e6372576e
commit 8335001397

View File

@ -1,7 +1,9 @@
@testset "Groups.FreeSymbols" begin @testset "Groups.FreeSymbols" begin
s = Groups.FreeSymbol("s") s = Groups.FreeSymbol("s")
t = Groups.FreeSymbol("t") t = Groups.FreeSymbol("t")
@testset "defines" begin
@testset "constructors" begin
@test isa(Groups.FreeSymbol("aaaaaaaaaaaaaaaa"), Groups.GSymbol) @test isa(Groups.FreeSymbol("aaaaaaaaaaaaaaaa"), Groups.GSymbol)
@test Groups.FreeSymbol("abc").pow == 1 @test Groups.FreeSymbol("abc").pow == 1
@test isa(s, Groups.FreeSymbol) @test isa(s, Groups.FreeSymbol)
@ -53,6 +55,11 @@ end
s, t = Nemo.gens(G) s, t = Nemo.gens(G)
@testset "internal arithmetic" begin @testset "internal arithmetic" begin
@test Vector{Groups.GWord}([s,t]) == [Groups.GWord(s), Groups.GWord(t)]
@test (s*s).symbols == (s^2).symbols
@test hash([t^1,s^1]) == hash([t^2*inv(t),s*inv(s)*s])
t_symb = Groups.FreeSymbol("t") t_symb = Groups.FreeSymbol("t")
tt = deepcopy(t) tt = deepcopy(t)
@test string(Groups.r_multiply!(tt,[inv(t_symb)]; reduced=true)) == @test string(Groups.r_multiply!(tt,[inv(t_symb)]; reduced=true)) ==
@ -85,7 +92,7 @@ end
@test Groups.reduce!(w).symbols ==Vector{Groups.FreeSymbol}([]) @test Groups.reduce!(w).symbols ==Vector{Groups.FreeSymbol}([])
end end
@testset "binary/inv operations" begin @testset "Group operations" begin
@test parent(s) == G @test parent(s) == G
@test parent(s) === parent(deepcopy(s)) @test parent(s) === parent(deepcopy(s))
@test isa(s*t, FreeGroupElem) @test isa(s*t, FreeGroupElem)