title: Passing Numpy arrays to C code wrapped with Cython
body: <p>I have a small bit of existing C code that I want to wrap using Cython. I want to be able to set up a number of numpy arrays, and then pass those arrays as arguments to the C code whose functions take standard c arrays (1d and 2d). I'm a little stuck in terms of figuring out how to write the proper .pyx code to properly handle things.</p>
  
  <p>There are a handful of functions, but a typical function in the file funcs.h looks something like:</p>
  
  <pre><code>double InnerProduct(double *A, double **coords1, double **coords2, const int len)
  </code></pre>
  
  <p>I then have a .pyx file that has a corresponding line:</p>
  
  <pre><code>cdef extern from "funcs.h":
      double InnerProduct(double *A, double **coords1, double **coords2, int len)
  </code></pre>
  
  <p>where I got rid of the <em>const</em> because cython doesn't support it. Where I'm stuck is what the wrapper code should then look like to pass a MxN numpy array to the **coords1 and **coords2 arguments. </p>
  
  <p>I've struggled to find the correct documentation or tutorials for this type of problem. Any suggestions would be most appreciated.</p>