[Numpy-discussion] random access iterators

Travis E. Oliphant oliphant@enthought....
Sun Dec 30 17:35:42 CST 2007


Neal Becker wrote:
> I'm looking at writing some c++ code to interoperate with numpy.  A c++
> random access iterator must include a 'distance' function.  distance (i1,
> i2) must return the number of times i1 has to be incremented to reach i2.
>
> Is there a way to get this from PyArrayIterObject?
>   
In the general case,  not directly.  However, you may be able to figure 
something out using the "coordinate" array that is stored with each 
iterator. 

-Travis O.



More information about the Numpy-discussion mailing list