mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-10-20 16:20:36 +02:00
remove isone(::GSymbol)
This commit is contained in:
parent
d1db939a63
commit
c880b51346
@ -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
|
||||||
|
|
||||||
|
@ -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)")
|
||||||
|
Loading…
Reference in New Issue
Block a user