From 2ef67b51956dab849d91460ec2d0c8b800601c59 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Mon, 20 Aug 2018 03:35:34 +0200 Subject: [PATCH] fix the G() <-> one(G) dispatch dillema --- src/PropertyT.jl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/PropertyT.jl b/src/PropertyT.jl index 794a299..b35d64f 100644 --- a/src/PropertyT.jl +++ b/src/PropertyT.jl @@ -44,10 +44,19 @@ function Laplacian(name::String, G::Group) return Δ end -function Laplacian{T<:GroupElem}(S::Vector{T}, Id::T; radius::Int=2) +function computeLaplacian(S::Vector{E}, radius) where E<:AbstractAlgebra.RingElem + R = parent(first(S)) + return computeLaplacian(S, one(R), radius) +end +function computeLaplacian(S::Vector{E}, radius) where E<:AbstractAlgebra.GroupElem + G = parent(first(S)) + return computeLaplacian(S, G(), radius) +end + +function computeLaplacian(S, Id, radius) info("Generating metric ball of radius $radius...") - @time E_R, sizes = Groups.generate_balls(S, Id, radius=2*radius) + @time E_R, sizes = Groups.generate_balls(S, Id, radius=2radius) info("Generated balls of sizes $sizes.") info("Creating product matrix...")