[Matrix-SIG] Re: NumPy core dump

Zane Motteler zcm@llnl.gov
Fri, 29 Jan 99 07:28:51 PST


Charles,

You wrote:

>The following message is a courtesy copy of an article
>that has been posted to comp.lang.python as well.
>
>
>Chad Scherrer <chscherr@indiana.edu> writes:
>
>> import Numeric
>> x=Numeric.array([2l,3l,4l]) # those are L's, not ones
>> print x**2
>
>> Python kicks me out with a segmentation fault and a core dump
...<snip>...

David Ascher called my attention to this problem several days
ago, and I found and fixed it, so the fix will be present in the
next version of NumPy.

>While investigating this problem I noticed that in fact the ternary
>version of power is not implemented for arrays:
...<snip>...

I was aware of this problem. It's interesting that array_power
is declared as a ternaryfunc but not implemented as one. I don't
know why. Most of the work on NumPy (except for PyGist) is
going to be done by Paul Dubois, so I'll leave the implementation
of ternary pow up to him. (I fixed the core dump problem
because he was absent on jury duty this week.)

...<snip>...
>There is certainly some more work to be done to make support of
>general object arrays a little cleaner in NumPy.

Well, yeah, I suppose so. Our main concern here at LLNL was
to implement fast operations on floating point arrays. Physics
simulation programs don't do much work with integers, long or not.
I certainly agree that if such operations can be implemented
fairly easily, then they should be. If not, at least Python
shouldn't core dump--it should give a nice message that the
operation is not yet implemented, and gracefully return to
the prompt.

Zane

--------------------
Zane C. Motteler, Ph. D.
   Professor Emeritus of Computer Science and Engineering
   California Polytechnic State University, San Luis Obispo
   zmottel@calpoly.edu
Currently:
   Computer Scientist
   Lawrence Livermore National Laboratory
   P O Box 808, L-038 (Street address 7000 East Avenue, L-038)
   Livermore, CA 94551-9900
   zcm@llnl.gov  925/423-2143, FAX 925/423-9969