changeset 20:8e02346789b2

Fix off by one error in P computation
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Sat, 17 Jan 2015 19:54:11 -0500
parents d9230d702fbf
children d63e763f8ac1
files pymedcouple
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pymedcouple
+++ b/pymedcouple
@@ -175,7 +175,7 @@
 
         j = 0
         for i in xrange(n_plus - 1, -1, -1):
-            while j < n_minus - 1 and h_kern(i, j) - Am > Am_eps:
+            while j < n_minus and h_kern(i, j) - Am > Am_eps:
                 j += 1
             P.append(j - 1)