From 69b638407a0fb3819cfe0f94577205eddbfd77c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 13 Nov 2018 20:43:09 +0100 Subject: [PATCH] Code cleanup (PEP8) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- TP3/exo2/tp3_exo2.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/TP3/exo2/tp3_exo2.py b/TP3/exo2/tp3_exo2.py index 78392d9..2a83187 100755 --- a/TP3/exo2/tp3_exo2.py +++ b/TP3/exo2/tp3_exo2.py @@ -87,7 +87,8 @@ def complete(sample): def plongement_phi(sample_element): - return [1, sample_element[0], sample_element[1], sample_element[0] * sample_element[0], sample_element[0] * sample_element[1], sample_element[1] * sample_element[1]] + return [1, sample_element[0], sample_element[1], sample_element[0]**2, + sample_element[0] * sample_element[1], sample_element[1]**2] def apply_plongement(sample, p): @@ -106,7 +107,8 @@ def f_from_k(coeffs, support_set, k, x): def k1(X1, X2): - return 1 + X1[0] * X2[0] + X1[1] * X2[1] + X1[0] * X1[0] * X2[0] * X2[0] + X1[0] * X1[1] * X2[0] * X2[1] + X1[1] * X1[1] * X2[1] * X2[1] + return 1 + X1[0] * X2[0] + X1[1] * X2[1] + X1[0]**2 * X2[0]**2 \ + + X1[0] * X1[1] * X2[0] * X2[1] + X1[1]**2 * X2[1]**2 def kg(x, y, sigma=10): -- 2.34.1