Anil Raj
unread,Sep 29, 2009, 1:30:21 PM9/29/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to apam-pyt...@googlegroups.com
Hi all,
I'm trying to define a C-function in cython as follows:
FTYPE = np.float32
ITYPE = np.int32
ctypedef np.float32_t FTYPE_t
ctypedef np.int32_t ITYPE_t
cdef getpc(np.ndarray[ITYPE_t, ndim=2] X, np.ndarray[ITYPE_t, ndim=2] Tplist, np.ndarray[FTYPE_t, ndim=2] w, np.ndarray[FTYPE_t, ndim=2] wp, np.ndarray[FTYPE_t, ndim=2] wm, float eps):
However, when generating the .c file, I get this error:
cdef getpc(np.ndarray[ITYPE_t, ndim=2] X, np.ndarray[ITYPE_t, ndim=2] Tplist, np.ndarray[FTYPE_t, ndim=2] w, np.ndarray[FTYPE_t, ndim=2] wp, np.ndarray[FTYPE_t, ndim=2] wm, float eps):
^
------------------------------------------------------------
/proj/ar2384/gwas/src/gettree.pyx:205:35: Expected ']'
Any thoughts/suggestions on what I might be doing wrong?
Also, if i wanted my C-function to return two ints, is 'cdef int getpc(...):' still the right way to define the function?
Thanks a lot!
Best
Anil