On 2014-10-16, Dima Pasechnik <[email protected]> wrote: > On 2014-10-16, Volker Braun <[email protected]> wrote: >> On Thursday, October 16, 2014 8:31:20 PM UTC+1, Dima Pasechnik wrote: >>> >>> Strange that Cython does not allow a proper cast, to (int (*)[])). >> >> >> Considering that Cython doesn't allow VLAs its probably not surprising. >> Just make a C macro for the cast. > > hmm, I don't know what this means, i.e. I don't know how to tell Cython > just to leave the thing alone, and plug it into the generated C.
after much trial and error, the following worked: cdef extern from "wl.h": ctypedef int* vlamatrix def ...: ... f(n, <vlamatrix>a) and in wl.h I have #define vlamatrix int(*)[] that is, using C macro AND fooling Cython... > >> Or lie to Cython >> >> ctypedef int* vlamatrix "(int (*)[])" > this gives a syntax error in Cython... > >> >> and use that to call f(n, <vlamatrix>a) >> >> Now we just need to find whoever came up with (int (*)[])) as syntax for >> cast to VLA matrix... >> > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
