From aa0f0f3034fd520e5f3f459d6db6c90afda25eb1 Mon Sep 17 00:00:00 2001 From: kalmar Date: Tue, 6 Jun 2017 11:51:15 +0200 Subject: [PATCH] add type argument to splaplacian --- src/sdps.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sdps.jl b/src/sdps.jl index 49bd402..365b960 100644 --- a/src/sdps.jl +++ b/src/sdps.jl @@ -13,11 +13,11 @@ function constraints_from_pm(pm, total_length=maximum(pm)) return constraints end -function splaplacian(RG::GroupRing, S, basis, n=length(basis)) - result = RG(spzeros(n)) - result[RG.group()] = float(length(S)) +function splaplacian(RG::GroupRing, S, basis, n=length(basis), T::Type=Int) + result = RG(spzeros(T, n)) + result[RG.group()] = T(length(S)) for s in S - result[s] += -1.0 + result[s] -= one(T) end return result end