[NumPy-Tickets] [NumPy] #1649: Strange array behavior in numpy c extension

NumPy Trac numpy-tickets@scipy....
Mon Oct 25 14:19:38 CDT 2010


#1649: Strange array behavior in numpy c extension
--------------------------------+-------------------------------------------
  Reporter:  c00kiemonster      |       Owner:  rgommers
      Type:  defect             |      Status:  closed  
  Priority:  normal             |   Milestone:  2.0.0   
 Component:  Official binaries  |     Version:  1.5.0   
Resolution:  invalid            |    Keywords:          
--------------------------------+-------------------------------------------
Changes (by pv):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 Not a bug.

 The iteration
 {{{
         for (n=0; n<n_max; n++) {
                 result[n] = vector[n];
         }
 }}}
 is wrong if the block of memory is not contiguous. You will either need to
 ensure the array is contiguous, or rewrite the loop to use strides
 correctly. To do that, you will need to understand what strides are.
 Further reading:

 http://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html#internal-
 memory-layout-of-an-ndarray

 Ask more info on the mailing list.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1649#comment:1>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list