mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-10-19 08:05:36 +02:00
remove rels from FPGroup making it effecively FreeGroup
This commit is contained in:
parent
83e40972a7
commit
84830f0d3a
@ -13,14 +13,11 @@ typealias FPGroupElem GWord{FPSymbol}
|
|||||||
|
|
||||||
type FPGroup <: Group
|
type FPGroup <: Group
|
||||||
gens::Vector{FPSymbol}
|
gens::Vector{FPSymbol}
|
||||||
rels::Vector{FPGroupElem}
|
|
||||||
# order::Vector{T}
|
# order::Vector{T}
|
||||||
# fastmult_table::Array{Int,2}
|
# fastmult_table::Array{Int,2}
|
||||||
function FPGroup{T<:GSymbol}(gens::Vector{T}, rels::Vector{GWord{T}})
|
function FPGroup{T<:GSymbol}(gens::Vector{T})
|
||||||
G = new(gens, rels)
|
G = new(gens)
|
||||||
G.gens = gens
|
G.gens = gens
|
||||||
rels = [G(r) for r in rels]
|
|
||||||
G.rels = rels
|
|
||||||
return G
|
return G
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -45,7 +42,7 @@ elem_type(::FPGroup) = FPGroupElem
|
|||||||
|
|
||||||
FPSymbol(s::String) = FPSymbol(s,1)
|
FPSymbol(s::String) = FPSymbol(s,1)
|
||||||
|
|
||||||
FPGroup(a::Vector{String}) = FPGroup([FPSymbol(i) for i in a], FPGroupElem[])
|
FPGroup(a::Vector{String}) = FPGroup([FPSymbol(i) for i in a])
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
@ -95,11 +92,8 @@ generators(G::FPGroup) = [G(FPGroupElem(g)) for g in G.gens]
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
function show(io::IO, G::FPGroup)
|
function show(io::IO, G::FPGroup)
|
||||||
print(io, "Finitely presented group on $(length(G.gens)) generators and $(length(G.rels)) relations:\n")
|
print(io, "Finitely presented group on $(length(G.gens)) generators:\n")
|
||||||
print(io, "gens:\t", join([g.str for g in G.gens], ", "),"\n")
|
print(io, "gens:\t", join([g.str for g in G.gens], ", "))
|
||||||
print(io, "rels:\t", join([rel for rel in G.rels], ", "))
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -129,10 +123,6 @@ inv(s::FPSymbol) = change_pow(s, -s.pow)
|
|||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
FreeGroup(n::Int, f::String=f) = FPGroup(["$f$i" for i in 1:n])
|
|
||||||
|
|
||||||
FreeGroup(a::Vector{String}) = FPGroup(a)
|
|
||||||
|
|
||||||
# function add_rel!{T<:FPSymbol}(G::FPGroup, w::GWord{T})
|
# function add_rel!{T<:FPSymbol}(G::FPGroup, w::GWord{T})
|
||||||
# if !(w in G.rels)
|
# if !(w in G.rels)
|
||||||
# w = G(w)
|
# w = G(w)
|
||||||
|
Loading…
Reference in New Issue
Block a user