source:
development/pyvolution-1d/util.py
@
2898
Last change on this file since 2898 was 2716, checked in by jakeman, 19 years ago | |
---|---|
File size: 270 bytes |
Line | |
---|---|
1 | """ |
2 | This module contains various auxiliary function used by pyvolution. |
3 | """ |
4 | |
5 | def mean(x): |
6 | from Numeric import sum |
7 | return sum(x)/len(x) |
8 | |
9 | |
10 | def gradient(x0, x1, q0, q1): |
11 | |
12 | if q1-q0 != 0: |
13 | a = (q1-q0)/(x1-x0) |
14 | else: |
15 | a = 0 |
16 | |
17 | return a |
18 |
Note: See TracBrowser
for help on using the repository browser.