[Numpy-discussion] Error in choose (bug?)
Todd Miller
jmiller at stsci.edu
Mon May 17 12:04:02 CDT 2004
On Thu, 2004-05-13 at 12:57, Todd Miller wrote:
> On Thu, 2004-05-13 at 07:13, Álvaro Tejero Cantero wrote:
> > I have a matrix of particle collision times: times[i,j] gives the time
> > for particle "i" to collide with particle "j".
> >
> > If I do, in order to get the first expected collision time for each
> > particle, the following (random array for testing purposes) :
> >
> > >>> N=30
> > >>> times = rnd.random([N,N])
> > >>> choose(argmin(times,transpose(times))
> > Segmentation fault (of the python interactive shell!!!)
> >
> > With N=100 I get a more informative traceback, and rest within the
> > shell:
> >
> > Traceback (most recent call last):
> > File "<stdin>", line 1, in ?
> > File "/usr/lib/python2.3/site-packages/numarray/ufunc.py", line 1670, in choose
> > return _choose(selector, population, outarr, clipmode)
> > File "/usr/lib/python2.3/site-packages/numarray/ufunc.py", line 1579, in __call__
> > result = self._doit(computation_mode, woutarr, cfunc, ufargs, 0)
> > File "/usr/lib/python2.3/site-packages/numarray/ufunc.py", line 1564, in _doit
> > blockingparameters)
> > ValueError: _operator_compute: too many inputs + outputs
> >
> >
> > For N=10,N=15 I get the expected output, but for N=20 I get again the
> > brutal segfault...
> >
> >
> > regards,
> > á.
I tracked this down today and understand the problem: there's a bug in
the ufunc error checking and a ridiculous limit in choose. I'm still
working out the "real" solution but a quick workaround is to edit
numarray.h and set MAXARGS to a larger number, say N+10.
Regards,
Todd
--
Todd Miller <jmiller at stsci.edu>
More information about the Numpy-discussion
mailing list