[Numpy-discussion] Heigenvalues is broken

Jeff Whitaker jsw at cdc.noaa.gov
Mon Nov 19 11:37:05 CST 2001


On Sun, 18 Nov 2001, Travis Oliphant wrote:

> On Sunday 18 November 2001 09:40 am, Alessandro Mirone wrote:
> > Is it a problem of lapack3.0 of of
> > LinearAlgebra.py?
> > ..................... ==> (Eigenvalues should be (0,2))
> >
> > >>> a=array([[1,0],[0,1]])
> > >>> b=array([[0,1],[-1,0]])
> > >>> M=a+b*complex(0,1.0)
> > >>> Heigenvalues(M)
>
> I suspect it is your lapack.  On an Athlon running Mandrake Linux with the
> lapack-3.0-9 package, I get.
>
> >>> a=array([[1,0],[0,1]])
> >>> b=array([[0,1],[-1,0]])
> >>> M=a+b*complex(0,1.0)
> >>> Heigenvalues(M)
> array([ 0.,  2.])

This is definitely a hardware/compiler dependant feature.  I get the
"right" answer on Solaris (with the forte compiler) but the same "wrong"
answer as Alessandro on MacOS X/gcc.  I've tried fiddling with compiler
options on my OS X box, to no avail.

-Jeff

 --
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/CDC  R/CDC1        Email  : jsw at cdc.noaa.gov
325 Broadway                Web    : www.cdc.noaa.gov/~jsw
Boulder, CO, USA 80303-3328 Office : Skaggs Research Cntr 1D-124





More information about the Numpy-discussion mailing list