From 6a297975576000ac984f921109fac22c4c1bdeac Mon Sep 17 00:00:00 2001 From: kalmar Date: Thu, 11 May 2017 18:16:21 +0200 Subject: [PATCH] the new definition of FPGroup <: Group --- src/FPGroups.jl | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/FPGroups.jl b/src/FPGroups.jl index 25b0064..47e4e70 100644 --- a/src/FPGroups.jl +++ b/src/FPGroups.jl @@ -7,22 +7,24 @@ end typealias FPGroupElem GWord{FPSymbol} +type FPGroup <: Group + gens::Vector{FPSymbol} + rels::Vector{FPGroupElem} + # order::Vector{T} + # fastmult_table::Array{Int,2} + function FPGroup{T<:GSymbol}(gens::Vector{T}, rels::Vector{GWord{T}}) + G = new(gens, rels) + G.gens = gens + rels = [G(r) for r in rels] + G.rels = rels + return G + end end # FPSymbol(x::String, G::Group) = FPSymbol(x,1,G) # FPSymbol(s::GSymbol, G::Group) = FPSymbol(s.gen, s.pow, G) -immutable FPGroup <: Group - gens::Vector{FPSymbol} - rels::Vector{FPGroupElem} -# order::Vector{T} -# fast_multable::Array{Int,2} - function FPGroup{T<:GSymbol}(gens::Vector{T}, rels::GWord{T}) - G = new() - gens = [FPSymbol{G}(g.gen, G) for g in gens] - rels = [] - end end FPGroup() = FPGroup(Vector{FPSymbol}(), Vector{GWord{FPSymbol}}())