summaryrefslogtreecommitdiff
path: root/pyspike/cython_distance.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'pyspike/cython_distance.pyx')
-rw-r--r--pyspike/cython_distance.pyx5
1 files changed, 3 insertions, 2 deletions
diff --git a/pyspike/cython_distance.pyx b/pyspike/cython_distance.pyx
index 23ffc37..2be8525 100644
--- a/pyspike/cython_distance.pyx
+++ b/pyspike/cython_distance.pyx
@@ -29,6 +29,7 @@ import numpy as np
cimport numpy as np
from libc.math cimport fabs
+from libc.math cimport fmax
DTYPE = np.float
ctypedef np.float_t DTYPE_t
@@ -56,7 +57,7 @@ def isi_distance_cython(double[:] s1,
isi_values = np.empty(N1+N2-1)
with nogil: # release the interpreter to allow multithreading
- isi_values[0] = (nu1-nu2)/max(nu1,nu2)
+ isi_values[0] = (nu1-nu2)/fmax(nu1,nu2)
index1 = 0
index2 = 0
index = 1
@@ -84,7 +85,7 @@ def isi_distance_cython(double[:] s1,
nu1 = s1[index1+1]-s1[index1]
nu2 = s2[index2+1]-s2[index2]
# compute the corresponding isi-distance
- isi_values[index] = (nu1 - nu2) / max(nu1, nu2)
+ isi_values[index] = (nu1 - nu2) / fmax(nu1, nu2)
index += 1
# the last event is the interval end
spike_events[index] = s1[N1]