MAINT Use push_back directly in dbscan_inner
@@ -10,12 +10,6 @@ import numpy as np
np.import_array()
-# Work around Cython bug: C++ exceptions are not caught unless thrown within
-# a cdef function with an "except +" declaration.
-cdef extern inline void push(vector[np.npy_intp] &stack, np.npy_intp i) except +:
- stack.push_back(i)
-
-
def dbscan_inner(np.ndarray[np.uint8_t, ndim=1, mode='c'] is_core,
np.ndarray[object, ndim=1] neighborhoods,
np.ndarray[np.npy_intp, ndim=1, mode='c'] labels):
@@ -39,7 +33,7 @@ def dbscan_inner(np.ndarray[np.uint8_t, ndim=1, mode='c'] is_core,
for i in range(neighb.shape[0]):
v = neighb[i]
if labels[v] == -1:
- push(stack, v)
+ stack.push_back(v)
if stack.size() == 0:
break
