title: how to pass a 3d and 4d numpy.array to swig
body: <p>I am using python to calculate something, but i want to make it faster. so I used swig.</p>
  
  <p>I want to use a 3d-array and a 4d-array in the same function.</p>
  
  <p>swig.i</p>
  
  <pre><code>%apply (double *INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3)\
  {(double *trans, int trans_dim1, int trans_dim2, int trans_dim3)};
  
  %apply (double *INPLACE_ARRAY4, int DIM1, int DIM2, int DIM3, int DIM4)\
  {(double *sample,int sam_dim1, int sam_dim2, int sam_dim3, int sam_dim4)};
  </code></pre>
  
  <p>sample.h</p>
  
  <pre><code>void update_transition(double *trans,int trans_dim1,int trans_dim2, int trans_dim3,
   double *sample,int sam_dim1, int sam_dim2, int sam_dim3, int sam_dim4, double DENO);
  </code></pre>
  
  <p>but when i use it in python, error:</p>
  
  <pre><code>**TypeError: update_transition() takes exactly 7 arguments (3 given)**
  </code></pre>
  
  <p>is that means my 3d-array can be recognized by swig, but 4d-array can't? How to solve this problem? I want them both.</p>