From: Brian Warner Date: Mon, 16 Apr 2007 18:51:36 +0000 (-0700) Subject: fec: remove unused mathutil.linear_fit_slope X-Git-Tag: tahoe_v0.1.0-0-UNSTABLE~102 X-Git-Url: https://git.rkrishnan.org/pf/content/index.php?a=commitdiff_plain;h=8e9d090bdbe018e9705c6f1edb804fcba8ef5379;p=tahoe-lafs%2Ftahoe-lafs.git fec: remove unused mathutil.linear_fit_slope --- diff --git a/pyfec/fec/util/mathutil.py b/pyfec/fec/util/mathutil.py index ea8312d9..5f70a80e 100644 --- a/pyfec/fec/util/mathutil.py +++ b/pyfec/fec/util/mathutil.py @@ -58,18 +58,6 @@ def log_ceil(n, b): k += 1 return k -def linear_fit_slope(ps): - """ - @param ps a sequence of tuples of (x, y) - """ - avex = ave([x for (x, y) in ps]) - avey = ave([y for (x, y) in ps]) - sxy = sum([ (x - avex) * (y - avey) for (x, y) in ps ]) - sxx = sum([ (x - avex) ** 2 for (x, y) in ps ]) - if sxx == 0: - return None - return sxy / sxx - def permute(l): """ Return all possible permutations of l.