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