[pypy-commit] pypy numpy-searchsorted: cleanup
mattip
noreply at buildbot.pypy.org
Sat Apr 19 23:53:31 CEST 2014
Author: Matti Picus <matti.picus at gmail.com>
Branch: numpy-searchsorted
Changeset: r70787:aeb6f15e5552
Date: 2014-04-19 23:56 +0300
http://bitbucket.org/pypy/pypy/changeset/aeb6f15e5552/
Log: cleanup
diff --git a/pypy/module/micronumpy/app_numpy.py b/pypy/module/micronumpy/app_numpy.py
--- a/pypy/module/micronumpy/app_numpy.py
+++ b/pypy/module/micronumpy/app_numpy.py
@@ -23,33 +23,3 @@
i += step
return arr
-# How to call this from descr_searchsorted??
-def searchsort(arr, v, side, result):
- def left_find_index(a, val):
- imin = 0
- imax = a.size
- while imin < imax:
- imid = imin + ((imax - imin) >> 1)
- if a[imid] <= val:
- imin = imid +1
- else:
- imax = imid
- return imin
- def right_find_index(a, val):
- imin = 0
- imax = a.size
- while imin < imax:
- imid = imin + ((imax - imin) >> 1)
- if a[imid] < val:
- imin = imid +1
- else:
- imax = imid
- return imin
- if side == 'l':
- func = left_find_index
- else:
- func = right_find_index
- for i in range(v.get_size()):
- result[i] = func(arr, v[i])
- return result
-
More information about the pypy-commit
mailing list