Cython:无法在浮动和浮动MemoryView上传递指针

时间:2019-06-17 15:45:40

标签: python cython

以下示例无法编译:

from cython cimport floating

cpdef int foo(floating * R, floating[:] theta):
    cdef int bar = 1
    return bar

错误:

Error compiling Cython file:
------------------------------------------------------------
...
from cython cimport floating

cpdef int foo(floating * R, floating[:] theta):
             ^
------------------------------------------------------------

debug.pyx:3:14: Cannot convert Python object argument to type 'float *'

Error compiling Cython file:
------------------------------------------------------------
...
from cython cimport floating

cpdef int foo(floating * R, floating[:] theta):
             ^
------------------------------------------------------------

debug.pyx:3:14: Cannot convert Python object argument to type 'double *'

我可以传递两个指针,两个memoryview,但不能组合。正常吗?

0 个答案:

没有答案