remove .func field from autsymbol
This commit is contained in:
parent
30f44cca71
commit
54e8eb0b43
|
@ -8,7 +8,6 @@ immutable AutSymbol <: GSymbol
|
||||||
str::String
|
str::String
|
||||||
pow::Int
|
pow::Int
|
||||||
ex::Expr
|
ex::Expr
|
||||||
func::Function
|
|
||||||
end
|
end
|
||||||
|
|
||||||
typealias AutGroupElem GWord{AutSymbol}
|
typealias AutGroupElem GWord{AutSymbol}
|
||||||
|
@ -60,23 +59,23 @@ function subscriptify(n::Int)
|
||||||
end
|
end
|
||||||
|
|
||||||
function id_autsymbol()
|
function id_autsymbol()
|
||||||
return AutSymbol("(id)", 0, :(id()), identity)
|
return AutSymbol("(id)", 0, :(id()))
|
||||||
end
|
end
|
||||||
|
|
||||||
function rmul_autsymbol(i, j; pow::Int=1)
|
function rmul_autsymbol(i, j; pow::Int=1)
|
||||||
str = "ϱ"*subscriptify(i)*subscriptify(j)
|
str = "ϱ"*subscriptify(i)*subscriptify(j)
|
||||||
return AutSymbol(str, pow, :(ϱ($i, $j, $pow)), ϱ(i, j, pow))
|
return AutSymbol(str, pow, :(ϱ($i, $j, $pow)))
|
||||||
end
|
end
|
||||||
|
|
||||||
function lmul_autsymbol(i, j; pow::Int=1)
|
function lmul_autsymbol(i, j; pow::Int=1)
|
||||||
str = "λ"*subscriptify(i)*subscriptify(j)
|
str = "λ"*subscriptify(i)*subscriptify(j)
|
||||||
return AutSymbol(str, pow, :(λ($i, $j, $pow)), λ(i, j, pow))
|
return AutSymbol(str, pow, :(λ($i, $j, $pow)))
|
||||||
end
|
end
|
||||||
|
|
||||||
function flip_autsymbol(i; pow::Int=1)
|
function flip_autsymbol(i; pow::Int=1)
|
||||||
str = "ɛ"*subscriptify(i)
|
str = "ɛ"*subscriptify(i)
|
||||||
pow = (2+pow%2)%2
|
pow = (2+pow%2)%2
|
||||||
return AutSymbol(str, pow, :(ɛ($i, $pow)), ɛ(i, pow))
|
return AutSymbol(str, pow, :(ɛ($i, $pow)))
|
||||||
end
|
end
|
||||||
|
|
||||||
function perm_autsymbol(p::perm; pow::Int=1)
|
function perm_autsymbol(p::perm; pow::Int=1)
|
||||||
|
@ -85,7 +84,7 @@ function perm_autsymbol(p::perm; pow::Int=1)
|
||||||
else
|
else
|
||||||
p = p^pow
|
p = p^pow
|
||||||
str = "σ"*join([subscriptify(i) for i in p.d])
|
str = "σ"*join([subscriptify(i) for i in p.d])
|
||||||
return AutSymbol(str, 1, :(σ($(p.d), 1)), σ(p, 1))
|
return AutSymbol(str, 1, :(σ($(p.d), 1)))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -200,7 +199,7 @@ function change_pow(s::AutSymbol, n::Int)
|
||||||
return s
|
return s
|
||||||
else
|
else
|
||||||
warn("Changing power of an unknown type of symbol! $s")
|
warn("Changing power of an unknown type of symbol! $s")
|
||||||
return AutSymbol(s.str, n, s.ex, s.func)
|
return AutSymbol(s.str, n, s.ex)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
@testset "AutSymbol" begin
|
@testset "AutSymbol" begin
|
||||||
@test_throws MethodError Groups.AutSymbol("a")
|
@test_throws MethodError Groups.AutSymbol("a")
|
||||||
@test_throws MethodError Groups.AutSymbol("a", 1)
|
@test_throws MethodError Groups.AutSymbol("a", 1)
|
||||||
f = Groups.AutSymbol("a", 1, :(a()), v -> v)
|
f = Groups.AutSymbol("a", 1, :(a()))
|
||||||
@test isa(f, Groups.GSymbol)
|
@test isa(f, Groups.GSymbol)
|
||||||
@test isa(f, Groups.AutSymbol)
|
@test isa(f, Groups.AutSymbol)
|
||||||
@test isa(Groups.perm_autsymbol(G([1,2,3,4])), Groups.AutSymbol)
|
@test isa(Groups.perm_autsymbol(G([1,2,3,4])), Groups.AutSymbol)
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
end
|
end
|
||||||
|
|
||||||
@testset "AutGroup/AutGroupElem constructors" begin
|
@testset "AutGroup/AutGroupElem constructors" begin
|
||||||
f = Groups.AutSymbol("a", 1, :(a()), v -> v)
|
f = Groups.AutSymbol("a", 1, :(a()))
|
||||||
@test isa(AutGroupElem(f), Groups.GWord)
|
@test isa(AutGroupElem(f), Groups.GWord)
|
||||||
@test isa(AutGroupElem(f), AutGroupElem)
|
@test isa(AutGroupElem(f), AutGroupElem)
|
||||||
@test isa(AutGroup(FreeGroup(3)), Nemo.Group)
|
@test isa(AutGroup(FreeGroup(3)), Nemo.Group)
|
||||||
|
|
Loading…
Reference in New Issue