title: Casting fftw_complex pointer (aka double[2]) to cython complex memoryview
body: <p>(Cross-posted from cython-users)</p>
  
  <p>I am trying to use FFTW for some Cython code.  I am running into issues when trying to cast a pointer to a fftw_complex (a typedef to double[2]) to a complex memoryview, namely (minimal example)</p>
  
  <pre><code>cdef extern from "fftw3.h":
      ctypedef double fftw_complex[2]
      fftw_complex* fftw_alloc_complex(int N)
  
  cdef foo(complex[::1] input):
      complex_ny = fftw_alloc_complex(input.size)
      (&lt;complex[:self.ny]&gt;complex_ny)[:] = input
      # actual call to FFTW follows
  </code></pre>
  
  <p>fails at the cast: "hmm.pyx:8:34: Pointer base type does not match cython.array base type" (perhaps it can't be expected for Cython to know that double[2] can be converted to complex but... what else can I do?)</p>
  
  <p>PS: If someone has experience using the pyFFTW wrapper directly from Cython, I'm interested too.</p>
  
  <p>Thanks in advance.</p>