From 00223904295fdecd6f3d199bbded4632fd353877 Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Thu, 25 Sep 2008 18:48:51 -0400 Subject: bugfix: correctly modify constant coefficient to obtain upper bound --- csv_tool | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'csv_tool') diff --git a/csv_tool b/csv_tool index 96cd99e..17ad949 100755 --- a/csv_tool +++ b/csv_tool @@ -112,7 +112,7 @@ def numpy_lstsq(x, y): return lstsq(A, b)[0] def max_delta(c0, c1, x, y): - return max([abs(c0 + c1 * float(x) - float(y)) for (x,y) in izip(x, y)]) + return max([float(y) - (c0 + c1 * float(x)) for (x,y) in izip(x, y)]) def least_squares(rows, xy_pairs, upper_bound): cols = [] -- cgit v1.2.2