remove isone(::GSymbol)

This commit is contained in:
kalmarek 2018-03-29 19:37:32 +02:00
parent d1db939a63
commit c880b51346
2 changed files with 4 additions and 7 deletions

View File

@ -102,9 +102,10 @@ end
###############################################################################
function (==)(s::FreeSymbol, t::FreeSymbol)
isone(s) && isone(t) && return true
s.str == t.str || return false
s.pow == t.pow || return false
s.pow == 0 && return true
s.str == t.str || return false
return true
end

View File

@ -103,8 +103,6 @@ function deepcopy_internal(W::T, dict::ObjectIdDict) where {T<:GWord}
return G(T(deepcopy(W.symbols)))
end
isone(s::GSymbol) = s.pow == 0
length(W::GWord) = sum([length(s) for s in W.symbols])
function delete_ids!(W::GWord)
@ -189,9 +187,7 @@ function show(io::IO, W::GWord)
end
function show(io::IO, s::T) where {T<:GSymbol}
if isone(s)
print(io, "(id)")
elseif s.pow == 1
if s.pow == 1
print(io, s.str)
else
print(io, (s.str)*"^$(s.pow)")