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

define isone for <:GSymbol

This commit is contained in:
kalmar 2017-05-12 19:46:59 +02:00
parent 9dafd3c09c
commit 3d944d2de2
2 changed files with 2 additions and 2 deletions

View File

@ -82,8 +82,6 @@ end
hash(s::FPSymbol, h::UInt) = hash(s.str, hash(s.pow, hash(FPSymbol, h)))
isone(s::FPSymbol) = s.pow == 0
change_pow(s::FPSymbol, n::Int) = FPSymbol(s.str, n)
length(s::FPSymbol) = abs(s.pow)

View File

@ -86,6 +86,8 @@ function deepcopy_internal{T<:GSymbol}(W::GWord{T}, dict::ObjectIdDict)
return G(GWord{T}(deepcopy(W.symbols)))
end
isone{T<:GSymbol}(s::T) = s.pow == 0
length(W::GWord) = sum([length(s) for s in W.symbols])
function free_reduce!(W::GWord)