1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-09-27 19:40:36 +02:00

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) 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 == t.pow || return false
s.pow == 0 && return true
s.str == t.str || return false
return true return true
end end

View File

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