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

add parent; move GWord constructor and GSymbol -> GWord conversion

This commit is contained in:
kalmar 2017-05-11 18:01:55 +02:00
parent 4718c40bd1
commit a3db7ab92c

View File

@ -48,10 +48,12 @@ type GWord{T<:GSymbol} <: GroupElem
end
end
GWord{T<:GSymbol}(s::T) = GWord{T}([s])
convert{T<:GSymbol, W<:Word}(::Type{W}, s::T) = GWord{T}(s)
parent{T<:GSymbol}(w::GWord{T}) = w.parent
GWord{T<:GSymbol}(s::T) = GWord{T}(T[s])
convert{T<:GSymbol}(::Type{GWord{T}}, s::T) = GWord{T}(T[s])
function hash(W::GWord, h::UInt)