From 68763ca37b3145af2cbae733d0e966e638efb1bf Mon Sep 17 00:00:00 2001 From: kalmarek Date: Fri, 21 Sep 2018 18:47:02 +0200 Subject: [PATCH] fix warnings with ^(..., n::Integer) --- src/DirectProducts.jl | 4 +++- src/WreathProducts.jl | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/DirectProducts.jl b/src/DirectProducts.jl index e390ccf..2d30fcb 100644 --- a/src/DirectProducts.jl +++ b/src/DirectProducts.jl @@ -271,7 +271,7 @@ end > Return the direct-product group operation of elements, i.e. component-wise > operation as defined by `operations` field of the parent object. """ -function *(g::DirectProductGroupElem{T}, h::DirectProductGroupElem{T}, check::Bool=true) where {T} +function *(g::DirectProductGroupElem, h::DirectProductGroupElem, check::Bool=true) if check parent(g) == parent(h) || throw(DomainError( "Can not multiply elements of different groups!")) @@ -279,6 +279,8 @@ function *(g::DirectProductGroupElem{T}, h::DirectProductGroupElem{T}, check::Bo return DirectProductGroupElem([a*b for (a,b) in zip(g.elts,h.elts)]) end +^(g::DirectProductGroupElem, n::Integer) = Base.power_by_squaring(g, n) + @doc doc""" inv(g::DirectProductGroupElem) > Return the inverse of the given element in the direct product group. diff --git a/src/WreathProducts.jl b/src/WreathProducts.jl index ec985cd..a383b32 100644 --- a/src/WreathProducts.jl +++ b/src/WreathProducts.jl @@ -182,6 +182,8 @@ function *(g::WreathProductElem, h::WreathProductElem) return WreathProductElem(g.n*g.p(h.n), g.p*h.p, false) end +^(g::WreathProductElem, n::Integer) = Base.power_by_squaring(g, n) + @doc doc""" inv(g::WreathProductElem) > Returns the inverse of element of a wreath product, according to the formula