473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

numarray.linear_algebra.eigenvectors bug ?

Hi all,
I need eigen values and vectors for symmetric matrices (like VCV).
Solving with numarray and testing the results, I've got
strange results - input and output matrices of some sizes are
very different. That's an example of differencies:

Size MaxDif(E.Val) MaxDif(E.Vect)
2 0 1.110223e-016
3 1.776357e-015 2.053913e-015
10 1.221245e-015 7.255307e-014
11 3.552714e-015 0.8455322
12 1.526557e-016 1.345035e-013
13 8.881784e-016 0.7796273
14 2.775558e-016 0.7504375
15 2.331468e-015 2.045031e-013

This is for numarray 0.7 on W2K.
I hoped to have all the differencies below 1e-15 or so.
What's wrong ? Program text is below.

Thanks,
Eugene Druker
import numarray, numarray.linear_algebra

EigenVectors = numarray.linear_algebra.eigenvectors
Multiply = numarray.matrixmultiply
Zeros = numarray.zeros
Transpose = numarray.transpose

def makeCovMat(size):
covmat = Zeros((size,size),'f8')
d,t = 0.9,0.8
for i in xrange(size):
v = covmat[i,i] = d
for j in xrange(i+1,size):
v *= t
covmat[i,j] = covmat[j,i] = v
return covmat

print 'Size MaxDif(E.Val) MaxDif(E.Vect)'
for size in [2,3]+range(10,24):
covmat = makeCovMat(size)
eval,evec = EigenVectors(covmat)
# Test S = V L V'
mdiag = Zeros((size,size),'f8') # L
for j in xrange(size):
mdiag[j,j] = eval[j]
testmat = Multiply(Transpose(evec),Multiply(mdiag,evec))
ival,ivec = EigenVectors(testmat)
print ' %3d %-14.7g %-14.7g' % \
(size, (eval-ival).max(), (evec-ivec).max())
Jul 18 '05 #1
1 2799
eu***********@yahoo.com (Eugene Druker) writes:
I need eigen values and vectors for symmetric matrices (like VCV).
Solving with numarray and testing the results, I've got
strange results - input and output matrices of some sizes are

[...]

You'll probably be much better off posting this to whichever mailing
list the numarray people use. Google for it. HTH
John
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RJS | last post by:
Hi all, I can't get a py2exe compiled app to run with numarray (numarray-0.5.win32- py2.2). Also wxPythonWIN32-2.3.3.1-Py22 and ActivePython-2.2.1-222. In the sample below, commenting out...
3
by: Alexander Schwaigkofler | last post by:
Hi! I have the following problem with numarray. I read the install.txt manual, but it doesn't already work. OS: Microsoft Windows 2000 python: Python 2.2.3 (#42, May 30 2003, 18:12:08) on...
4
by: Marco Bubke | last post by:
Hi I have tried to include numarray in Pyrex but I get allways this error: Traceback (most recent call last): File "gears.py", line 9, in ? import gl File...
4
by: Marco Bubke | last post by:
Hi Ok, I get a reproduceable seqmentation fault. Ok, fist the code: cdef NumArray array_to_double(NumArray array): # maybe here is memoty leak! cdef NumArray flat_array_obj flat_array_obj...
2
by: Marc Schellens | last post by:
Following the NumPy documentation, I took over some C code, but run into an error. Does anybody have a suggestion? Thanks, marc gdlpython.cpp:225: `PyArray_Type' undeclared (first use this...
0
by: andrewfelch | last post by:
Below is the code to/from Boolean arrays and Unsigned integers. On my Pentium 4, functions such as "bitwise_and" are 32 times faster when run on 32-bit integers instead of the...
0
by: robert | last post by:
just a note - some speed comparisons : 0.60627370238398726 0.42836673376223189 0.36965815487747022 0.016557970357098384 0.15692469294117473 0.01951756438393204
4
by: Christian Convey | last post by:
I need to bang out an image processing library (it's schoolwork, so I can't just use an existing one). But I see three libraries competing for my love: numpy, numarray, and numeric. Can anyone...
18
by: Jedora | last post by:
Hi all, I want to write a C program to compute eigenvalues and eigenvectors. But the matrix is a complex matrix which has all complex numbers. Like this: 5.8751 5.8774 + 1.5423i ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.