From 063a5a3ca7ffb3d667818d0cadf9fa185edaa01b Mon Sep 17 00:00:00 2001 From: Per A Brodtkorb Date: Tue, 20 Dec 2016 20:58:51 +0100 Subject: [PATCH] Simplified fixed_point --- wafo/kdetools/kernels.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wafo/kdetools/kernels.py b/wafo/kdetools/kernels.py index 1ab21e4..26d7d96 100644 --- a/wafo/kdetools/kernels.py +++ b/wafo/kdetools/kernels.py @@ -898,14 +898,16 @@ class Kernel(object): prod = np.prod # L = 7 logI = np.log(I) - f = 2 * pi ** (2 * L) * \ - (a2 * exp(L * logI - I * pi ** 2 * t)).sum() + + def fun(s, time): + return (2 * pi ** (2 * s) * + (a2 * exp(s * logI - I * pi ** 2 * time)).sum()) + f = fun(L, t) for s in range(L - 1, 1, -1): K0 = prod(np.r_[1:2 * s:2]) / sqrt(2 * pi) const = (1 + (1. / 2) ** (s + 1. / 2)) / 3 time = (2 * const * K0 / N / f) ** (2. / (3 + 2 * s)) - f = 2 * pi ** (2 * s) * \ - (a2 * exp(s * logI - I * pi ** 2 * time)).sum() + f = fun(s, time) return t - (2 * N * sqrt(pi) * f) ** (-2. / 5) h = np.empty(d)