mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-04 10:12:33 +08:00
Fix: round function is not provided by libc.math on all platforms
This commit is contained in:
committed by
Stefan van der Walt
parent
3817088b37
commit
ebf04ba0d0
@@ -2,7 +2,7 @@ cimport cython
|
||||
import numpy as np
|
||||
cimport numpy as np
|
||||
from random import randint
|
||||
from libc.math cimport abs, fabs, sqrt, ceil, floor, round
|
||||
from libc.math cimport abs, fabs, sqrt, ceil, floor
|
||||
from libc.stdlib cimport rand
|
||||
|
||||
|
||||
@@ -13,6 +13,10 @@ cdef double PI_2 = 1.5707963267948966
|
||||
cdef double NEG_PI_2 = -PI_2
|
||||
|
||||
|
||||
cdef inline int round(double r):
|
||||
return <int>((r + 0.5) if (r > 0.0) else (r - 0.5))
|
||||
|
||||
|
||||
@cython.boundscheck(False)
|
||||
def _hough(np.ndarray img, np.ndarray[ndim=1, dtype=np.double_t] theta=None):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user