From fc837ff481ff73fce26c58de3868322a6aa3f570 Mon Sep 17 00:00:00 2001 From: kalmar Date: Tue, 16 May 2017 18:45:31 +0200 Subject: [PATCH] length, norm, augmentation --- src/GroupAlgebras.jl | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/GroupAlgebras.jl b/src/GroupAlgebras.jl index 4d806db..265a5e7 100644 --- a/src/GroupAlgebras.jl +++ b/src/GroupAlgebras.jl @@ -179,22 +179,15 @@ end (*)(X::GroupRingElem, Y::GroupRingElem) = group_star_multiplication(X,Y) +length(X::GroupRingElem) = length(X.coeffs) + +norm(X::GroupRingElem, p=2) = norm(X.coeffs, p) + +augmentation(X::GroupRingElem) = sum(X.coeffs) - -length(X::GroupAlgebraElement) = length(X.coefficients) - -function norm(X::GroupAlgebraElement, p=2) - if p == 1 - return sum(abs(X.coefficients)) - elseif p == Inf - return max(abs(X.coefficients)) - else - return norm(X.coefficients, p) - end end -ɛ(X::GroupAlgebraElement) = sum(X.coefficients) function rationalize{T<:Integer, S<:Number}( ::Type{T}, X::GroupAlgebraElement{S}; tol=eps(S))