Re: [Numpy-discussion] random access iterators

2007-12-30 Thread Travis E. Oliphant
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?

Re: [Numpy-discussion] how do I list all combinations

2007-12-30 Thread Alan G Isaac
On Wed, 26 Dec 2007, Mathew Yeates apparently wrote: > r1=["dog","cat"] > r2=[1,2] > I want to return [["dog",1],["dog",2],["cat",1],["cat",2]] This is a Cartesian product. Sage has ``cartesian_product_iterator`` for this. Also http://www.sagemath.org/doc/html/ref/module-sage.combinat.carte

[Numpy-discussion] random access iterators

2007-12-30 Thread Neal Becker
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? __

[Numpy-discussion] iterator speed

2007-12-30 Thread Neal Becker
In numpybook, in discussing iterators, it says that if you know your array is contiguous, it may be faster to just use C-style pointers instead of iterators. Looking at the code a little, it appears that PyArray_ITER_NEXT(it) attempts to optimize for certain cases. I wonder if anyone has done any

Re: [Numpy-discussion] [SciPy-dev] Doc-day

2007-12-30 Thread Alan G Isaac
On Sat, 29 Dec 2007, "Travis E. Oliphant" apparently wrote: > they make it so that the documentation standard for SciPy > and NumPy is not different from the ETS standard 1. Is the Enthought Tool Suite standard published? 2. I think it miscasts things to say that the previous standard was buil

[Numpy-discussion] Passing a Null pointer after ndarray prototype definition

2007-12-30 Thread Nicholas
I have a problem in that I have a DLL function which accepts several numpy double arrays, but you need to pass a NULL pointer for the ones from which you do not require results. The prototype is as follows: T_ndDp = numpy.ctypeslib.ndpointer(dtype=float, ndim=1, flags='C_CONTIGUOUS') Prototype_exa