From: Jérôme Benoit Date: Tue, 13 Nov 2018 19:43:09 +0000 (+0100) Subject: Code cleanup (PEP8) X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=69b638407a0fb3819cfe0f94577205eddbfd77c4;p=TP_AA.git Code cleanup (PEP8) Signed-off-by: Jérôme Benoit --- 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):