projects
/
tahoe-lafs
/
zfec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
68ae7f1
)
fec: remove unused mathutil.linear_fit_slope
author
warner
<warner@allmydata.com>
Mon, 16 Apr 2007 18:51:36 +0000
(
00:21
+0530)
committer
warner
<warner@allmydata.com>
Mon, 16 Apr 2007 18:51:36 +0000
(
00:21
+0530)
darcs-hash:
c66276a71abd205c6f93173f659fcb9523c2513b
zfec/zfec/util/mathutil.py
patch
|
blob
|
history
diff --git
a/zfec/zfec/util/mathutil.py
b/zfec/zfec/util/mathutil.py
index 609f0dffb8f9e852ac31def926be1c786524dea8..203e95a7fc23ff3064f097268c81535297dcb81e 100644
(file)
--- 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.