Consider the following example:
cdef test_function():
cdef:
double[:] p1 = np.array([3.2, 2.1])
double[:] p2 = np.array([0.9, 6.])
return p1-p2
If used, it returns the following error:
Error compiling Cython file:
------------------------------------------------------------
...
cdef test_function():
cdef:
double[:] p1 = np.array([3.2, 2.1])
double[:] p2 = np.array([0.9, 6.])
return p1-p2
^
------------------------------------------------------------
cython_cell_v3.pyx:354:13: Invalid operand types for '-' (double[:]; double[:])
If I am using numpy arrays to initialize the memory view, how can I go about using its functionality? Do I have to somehow do some dereferencing on the memoryviews?