From: warner Date: Mon, 16 Apr 2007 18:51:36 +0000 (+0530) Subject: fec: remove unused mathutil.linear_fit_slope X-Git-Url: https://git.rkrishnan.org/pf/content/en.html?a=commitdiff_plain;h=a673bcc338c4660e777b5b86fcc5a3e03df9df2b;p=tahoe-lafs%2Fzfec.git fec: remove unused mathutil.linear_fit_slope darcs-hash:c66276a71abd205c6f93173f659fcb9523c2513b --- diff --git a/zfec/zfec/util/mathutil.py b/zfec/zfec/util/mathutil.py index 609f0df..203e95a 100644 --- a/zfec/zfec/util/mathutil.py +++ b/zfec/zfec/util/mathutil.py @@ -51,18 +51,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.