473,796 Members | 2,520 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

numarray.linear _algebra.eigenv ectors 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.eigenv ectors
Multiply = numarray.matrix multiply
Zeros = numarray.zeros
Transpose = numarray.transp ose

def makeCovMat(size ):
covmat = Zeros((size,siz e),'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(co vmat)
# Test S = V L V'
mdiag = Zeros((size,siz e),'f8') # L
for j in xrange(size):
mdiag[j,j] = eval[j]
testmat = Multiply(Transp ose(evec),Multi ply(mdiag,evec) )
ival,ivec = EigenVectors(te stmat)
print ' %3d %-14.7g %-14.7g' % \
(size, (eval-ival).max(), (evec-ivec).max())
Jul 18 '05 #1
1 2819
eu***********@y ahoo.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
2993
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 "import numarray" allows the exe to run. Left in, I get "4.exe has generated errors" etc. I'm going around and around and there isn't much on Google. py2exe output is last.
3
1832
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 win32 numarray: Version 0.7 the output from the installation (by hand) you can see below:
4
1989
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 "/home/marco/projects/test_pyrex/gl.pyx", line 40, in gl ctypedef class numarray.NumArray :
4
1992
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 = NA_InputArray(NA_updateDataPtr(array), tFloat64,
2
2971
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 function) #include <python2.3/Python.h>
0
1249
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 entire-byte-consuming-Boolean. Good luck all:-) uint32Mask = numarray.array(, numarray.UInt32) uint32MaskInner = numarray.copy.deepcopy(uint32Mask) uint32MaskInner.shape =
0
2000
by: robert | last post by:
just a note - some speed comparisons : 0.60627370238398726 0.42836673376223189 0.36965815487747022 0.016557970357098384 0.15692469294117473 0.01951756438393204
4
3381
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 recommend which one I should use? If one is considered the officially blessed one going forward, that would be my ideal. Thanks, Christian
18
26368
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 2.0818 + 2.8963i 1.8692 + 1.9634i 5.8774 - 1.5423i 6.8258 2.6390 + 2.8255i 2.2955 + 1.9349i 2.0818 - 2.8963i 2.6390 - 2.8255i 3.9534 2.9155 -
0
9683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10457
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9054
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4119
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.