473,480 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Eigenvector routine....

Does anyone know of a small, simple, freely available Eigenvector routine?

My application has been developed using jacobi.c (and eigsrt.c) from
Numerical Recipes. This works well for me, but the application will soon be
released under the GPL, and the nice folks at NR don't want their source
distributed around. I could just leave stubs in place and require people to
get the routines themselves, but I'd rather replace the routines with
something more available.

I don't really want to introduce a dependency on a large numerical toolkit,
instead, I'd like to just pull in the relevant code. Something small and
simple is preferred over the latest & greatest.

In fact, the problem is nearly trivial. Find the eigenvectors & eigenvalues
of a real, symmetric, 3x3 matrix. Then, all I need is the eigenvector with
the smallest eigenvalue.

With such a small problem, I'm surprised there isn't an even simpler
approach...

Any help will be appreciated,

Rob
Nov 15 '05 #1
4 4746
Rob McDonald wrote:
Does anyone know of a small, simple, freely available Eigenvector routine?


CBLAS, GSL? Get the source and modify it freely as long as you keep it GPL.
Nov 15 '05 #2
Rob

Well, in the case of GSL...

http://www.gnu.org/software/gsl/manu...14.html#SEC233

It isn't exactly what I would call small or simple. It requires the
manual, dynamic allocation & destruction of some bizarre 'workspace'
memory, as well as the use of custom data structures to store matrices
and vectors, instead of plain C arrays.

Large libraries, like these two, use custom data structures to gain
flexibility and performance (sparse matrices, etc.). Consequently, you
can't just sneak in and slip out a simple routine. NR also has this
problem, it wraps arrays such that they are 1-indexed. That way, their
translated FORTRAN looks better...

Besides, the algorithm used by GSL is a bit of a 1000lb gorilla for
this problem.

Maybe I'm asking for too much, but there ought to be a simple
eigenvalue routine laying around somewhere.

Rob
Sensei wrote:
Rob McDonald wrote:
Does anyone know of a small, simple, freely available Eigenvector routine?


CBLAS, GSL? Get the source and modify it freely as long as you keep it GPL.


Nov 15 '05 #3
Hi Rob,
even for a 3x3 matrix, finding the lowest eigenvalue is not entirely
trivial. It amounts to finding the zeros of the characteristic equation
which is obviously cubic. Google for Vieta equation (mathworld.com has
a nice explanation)

Good luck,

Jan

Rob McDonald wrote:
Does anyone know of a small, simple, freely available Eigenvector routine?

My application has been developed using jacobi.c (and eigsrt.c) from
Numerical Recipes. This works well for me, but the application will soon be
released under the GPL, and the nice folks at NR don't want their source
distributed around. I could just leave stubs in place and require people to
get the routines themselves, but I'd rather replace the routines with
something more available.

I don't really want to introduce a dependency on a large numerical toolkit,
instead, I'd like to just pull in the relevant code. Something small and
simple is preferred over the latest & greatest.

In fact, the problem is nearly trivial. Find the eigenvectors & eigenvalues
of a real, symmetric, 3x3 matrix. Then, all I need is the eigenvector with
the smallest eigenvalue.

With such a small problem, I'm surprised there isn't an even simpler
approach...

Any help will be appreciated,

Rob


Nov 15 '05 #4
Rob wrote:
Well, in the case of GSL...

http://www.gnu.org/software/gsl/manu...14.html#SEC233

It isn't exactly what I would call small or simple. It requires the
manual, dynamic allocation & destruction of some bizarre 'workspace'
memory, as well as the use of custom data structures to store matrices
and vectors, instead of plain C arrays.
In fact, I said modify the code :) Get the algorithm and use it. NR is
just the same as gsl, less complicated, with more problems (allocation
and deallocation still are there, as NR use float[] and co, WITHOUT any
particular check)... NR is less sophisticated.

Still, as suggested, check for other available algorithms (Wolfram math
is good).
Maybe I'm asking for too much, but there ought to be a simple
eigenvalue routine laying around somewhere.


No. *IF* the problem is *JUST* 3x3, then you can solve it by hand, and
implement it, just in this case, and in no other.
Nov 15 '05 #5

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

Similar topics

0
1671
by: drife | last post by:
Hello, Has anyone a Python script for rotating an eigenvector matrix using the varimax (or quartimax or other) methods? Thanks in advance for your help. Daran
1
1688
by: peteh | last post by:
Hi All; I'm having a problem running an external routine (C language) under DB2 8.2 (FP 9) on AIX 5.3. Since the code was mostly copied from the DB2 sample library, I'm pretty sure it's sound....
1
1806
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
7
5536
by: Morgan | last post by:
I have read much posts on the argument but no one clearly says if this operation is possible or not. Simply I have a routine which reads from a text file some integer arrays (1 or 2D). The...
1
3657
by: everymn | last post by:
Hi, Supposedly the Alter Routine privilege can be granted at the level of a single routine but I haven't been able to get that to work. I've tried it a number of different ways like: GRANT...
7
2410
by: Bob Darlington | last post by:
I'm using the following routine to call UpdateDiary() - below: Private Sub Form_BeforeUpdate(Cancel As Integer) On Error GoTo Form_BeforeUpdate_Error Call UpdateDiary(Me!TenantCounter,...
5
3628
by: Railgunner | last post by:
I am looking for a routine that can evaluate boolean expressions like: IF/ELSE-IF (X1=X2 AND (Y=1 OR Z1=Z2)) IF/ELSE-IF (A$='Y' AND B=1) OR (C=1 AND D>E) etc. I can handle...
0
2027
by: Independent | last post by:
Python programmers may find the application to decoding an encrypted map image format known as Memory Map to produce a standard PNG image file interesting. Someone obviously very well versed in...
2
1446
by: pvong | last post by:
I'm a newbie. I'm using VS2008 & VB.net I have a simple site and each page uses the same sub-routine. I copy and paste to each page and that's no big deal but that can get tiresome. I was...
0
7055
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,...
0
6920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7059
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,...
1
6758
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...
0
7010
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...
1
4799
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...
0
4499
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1311
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 ...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.