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.3039i
1.8692 - 1.9634i 2.2955 - 1.9349i 2.9155 + 0.3039i 2.2816
Then, the eigenvalues are:
0.0412 0 0 0
0 0.1996 0 0
0 0 2.0591 0
0 0 0 16.6361
eigenvectors are:
-0.0506 + 0.2898i 0.1137 + 0.6431i -0.1009 - 0.3856i 0.3665 +
0.4403i
-0.0942 - 0.2603i -0.3552 - 0.5019i -0.3791 - 0.1255i 0.4927 +
0.3782i
-0.5045 - 0.0249i 0.2804 - 0.2056i 0.6644 - 0.0427i 0.4221 -
0.0503i
0.7627 -0.2731 0.4882 0.3245
Please help! 18 26046
On 17 May 2007 22:18:09 -0700, Jedora <je****@gmail.comwrote:
>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.3039i
1.8692 - 1.9634i 2.2955 - 1.9349i 2.9155 + 0.3039i 2.2816
Then, the eigenvalues are: 0.0412 0 0 0
0 0.1996 0 0
0 0 2.0591 0
0 0 0 16.6361
eigenvectors are:
-0.0506 + 0.2898i 0.1137 + 0.6431i -0.1009 - 0.3856i 0.3665 + 0.4403i
-0.0942 - 0.2603i -0.3552 - 0.5019i -0.3791 - 0.1255i 0.4927 + 0.3782i
-0.5045 - 0.0249i 0.2804 - 0.2056i 0.6644 - 0.0427i 0.4221 - 0.0503i
0.7627 -0.2731 0.4882 0.3245
Please help!
I have this book "Numerical recipes in C" that has a chapter on
eigen-stuff.
maybe this title is a good search phrase for google ?
ah.. yes: www.nr.com !!
surely you could find the accompanying source on the net... I found it
on EMULE P2p...
On 2007-05-18 11:47:41 +0200, Osiris <no**@hotmail.comsaid:
I have this book "Numerical recipes in C" that has a chapter on
eigen-stuff.
maybe this title is a good search phrase for google ?
ah.. yes: www.nr.com !!
surely you could find the accompanying source on the net... I found it
on EMULE P2p...
And surely you read that the book and the code snippets inside are
copyrighted and non-free, right?
--
Sensei <senseiwa at Apple's mac dot com>
If you get this in less than 10 seconds, then you are a certified geek.
"FEATUR"
(License plate seen on an old Volkswagen Beetle)
Sensei wrote:
On 2007-05-18 11:47:41 +0200, Osiris <no**@hotmail.comsaid:
>I have this book "Numerical recipes in C" that has a chapter on eigen-stuff. maybe this title is a good search phrase for google ? ah.. yes: www.nr.com !!
surely you could find the accompanying source on the net... I found it on EMULE P2p...
And surely you read that the book and the code snippets inside are
copyrighted and non-free, right?
[OT, sorry]
Surely that means that one can type them in from a reference and try
them without fear of reprisal. Copyright was granted the moment the work
was created, but I see no moral reason why someone can't find the code
on the internet to study.
--
clvrmnky <mailto:sp******@clevermonkey.org>
Direct replies will be blacklisted. Replace "spamtrap" with my name to
contact me directly.
In article <mV****************@nnrp.ca.mci.com!nnrp1.uunet.ca >,
Clever Monkey <sp******@clevermonkey.org.INVALIDwrote:
>Sensei wrote:
>On 2007-05-18 11:47:41 +0200, Osiris <no**@hotmail.comsaid:
>>I have this book "Numerical recipes in C" that has a chapter on
>And surely you read that the book and the code snippets inside are copyrighted and non-free, right?
>Surely that means that one can type them in from a reference and try them without fear of reprisal.
No, it means that you can take the ideas expressed in the algorithms
and write your -own- versions of them.
--
Okay, buzzwords only. Two syllables, tops. -- Laurie Anderson
Walter Roberson wrote:
In article <mV****************@nnrp.ca.mci.com!nnrp1.uunet.ca >,
Clever Monkey <sp******@clevermonkey.org.INVALIDwrote:
>Sensei wrote:
>>On 2007-05-18 11:47:41 +0200, Osiris <no**@hotmail.comsaid:
>>>I have this book "Numerical recipes in C" that has a chapter on
>>And surely you read that the book and the code snippets inside are copyrighted and non-free, right?
>Surely that means that one can type them in from a reference and try them without fear of reprisal.
No, it means that you can take the ideas expressed in the algorithms
and write your -own- versions of them.
Wrong. Read http://www.nrbook.com/a/bookcpdf/c0-1.pdf where is says that
"you can type the programs from this book directly into your computer".
( I'm unable to copy the exact text from the pdf, sorry.)
Bjørn
--
Looking for an embeddable web server? http://www.metasystems.no/products/h...der/index.html
Walter Roberson wrote:
In article <mV****************@nnrp.ca.mci.com!nnrp1.uunet.ca >,
Clever Monkey <sp******@clevermonkey.org.INVALIDwrote:
>Sensei wrote:
>>On 2007-05-18 11:47:41 +0200, Osiris <no**@hotmail.comsaid:
>>>I have this book "Numerical recipes in C" that has a chapter on
>>And surely you read that the book and the code snippets inside are copyrighted and non-free, right?
>Surely that means that one can type them in from a reference and try them without fear of reprisal.
No, it means that you can take the ideas expressed in the algorithms
and write your -own- versions of them.
And, hence my comment you snipped, which I have replaced here:
"Copyright was granted the moment the work was created, but I see no
moral reason why someone can't find the code on the internet to study."
Someone points out else-thread that the copyright holders have granted
additional rights to type the code in, but even if that were not the
case most jurisdictions recognize private, personal, non-commercial use
as part of that default agreement.
For example, in my country I can make as many copies of many types of
media that I like, as long as it is for private, personal use and I do
not pass any of those copies along without express permission from the
rightsholder.
In general, rightsholders cannot ask for additional rights that local
jurisdiction expressly grants.
However, I'm not a lawyer and do not pretend to be one. I've read local
copyright code on how it affects me in some cases, and have come to the
conclusion that there is little illegal in copying source code from an
ordinary computer book into my computer for personal research.
Certainly there is very little immoral about such activities, even if
your local laws have other ideas.
--
clvrmnky <mailto:sp******@clevermonkey.org>
Direct replies will be blacklisted. Replace "spamtrap" with my name to
contact me directly.
On May 17, 10:18 pm, Jedora <jed...@gmail.comwrote:
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.3039i
1.8692 - 1.9634i 2.2955 - 1.9349i 2.9155 + 0.3039i 2.2816
Then, the eigenvalues are:
0.0412 0 0 0
0 0.1996 0 0
0 0 2.0591 0
0 0 0 16.6361
eigenvectors are:
-0.0506 + 0.2898i 0.1137 + 0.6431i -0.1009 - 0.3856i 0.3665 +
0.4403i
-0.0942 - 0.2603i -0.3552 - 0.5019i -0.3791 - 0.1255i 0.4927 +
0.3782i
-0.5045 - 0.0249i 0.2804 - 0.2056i 0.6644 - 0.0427i 0.4221 -
0.0503i
0.7627 -0.2731 0.4882 0.3245
It's a FAQ.
14.12: I'm looking for some code to do:
Fast Fourier Transforms (FFT's)
matrix arithmetic (multiplication, inversion, etc.)
complex arithmetic
A: Ajay Shah has prepared a nice index of free numerical
software which has been archived pretty widely; one URL
is ftp://ftp.math.psu.edu/pub/FAQ/numcomp-free-c .
See also questions 18.13, 18.15c, and 18.16.
Suggestion:
Try this search on sourceforge:
(+matrix +complex eigenvalue eigenvector eigenvalues eigenvectors) AND
-has_file:(0)
Jedora wrote:
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.
Why do you want to implement this yourself?
If you are not very experienced, there many pitfalls to watch out for,
you should at least verify your implementation with the robust code
found in EISPACK and CERNLIB. [1]
The definite reference on eigensystems, is Wilkinson and Reinsch,
"Handbook for Automatic Computation", IIRC sample code was in AGOL.
[1] Warning, it's 20 years since I solved complex eigensystems myself,
but back then we did this in FORTRAN on supercomputers. Dan Pop stated
once here, that CERNLIB these days has been ported to C++. If your
problem is simple, can't tools like e.g. Mathlab & Maple help out?
--
Tor <torust [at] online [dot] no>
Tor Rustad wrote:
IIRC sample code was in AGOL.
ALGOL :-)
--
Tor <torust [at] online [dot] no>
Clever Monkey said:
<snip>
I've read
local copyright code on how it affects me in some cases, and have come
to the conclusion that there is little illegal in copying source code
from an ordinary computer book into my computer for personal research.
If there is *anything* illegal about it, the world is crazy (which isn't
so impossible, I grant you).
When I put a whole bunch of source code onto a CD and stuck it in the
back of "C Unleashed", I sure as heck didn't put it there so that you
would *not* be able to use it. Sheesh, world! If you don't want people
to use source code, don't publish it! If you publish source code, *why*
are you publishing it, if *not* to let people *use* it?
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk
email: rjh at the above domain, - www.
On May 18, 2:43 pm, Tor Rustad <torust_at_online.nowrote:
Why do you want to implement this yourself?
If you are not very experienced, there many pitfalls to watch out for,
you should at least verify your implementation with the robust code
found in EISPACK and CERNLIB. [1]
[1] Warning, it's 20 years since I solved complex eigensystems myself,
but back then we did this in FORTRAN on supercomputers. Dan Pop stated
once here, that CERNLIB these days has been ported to C++. If your
problem is simple, can't tools like e.g. Mathlab & Maple help out?
Nowadays, the state of the art in dense-matrix eigensolvers is usually
considered to be LAPACK (the successor to LINPACK and EISPACK).
(The fact that LAPACK is in Fortran is no excuse for the original
poster to rewrite his own C eigensolver. It's quite easy to call
Fortran code from C, with a little care about data types and
subroutine naming.)
Regards,
Steven G. Johnson
"Richard Heathfield" <rj*@see.sig.invalidwrote in message
news:3b******************************@bt.com...
Clever Monkey said:
<snip>
>I've read local copyright code on how it affects me in some cases, and have come to the conclusion that there is little illegal in copying source code from an ordinary computer book into my computer for personal research.
If there is *anything* illegal about it, the world is crazy (which isn't
so impossible, I grant you).
When I put a whole bunch of source code onto a CD and stuck it in the
back of "C Unleashed", I sure as heck didn't put it there so that you
would *not* be able to use it. Sheesh, world! If you don't want people
to use source code, don't publish it! If you publish source code, *why*
are you publishing it, if *not* to let people *use* it?
It is a problem for me. I am not clever enough to solve eigensystems from
first principles. However I use these functions in my work. I'd like to post
the programs on my website but I am worried about compromising Numerical
Recipies.
I know that the legal situation is very complicated. The court could regard
the code as "text" and thus copyright, in which case fair use would have to
be defined, or it could regard it as a "functional device" in which case
patent law would apply. However you can't generally patent mathematical
results, and I don't think the Numerical Recipes authors devised their own
algorithms anyway - certainly the Fast Fourier transform was invented by
Cooley and Tuckey.
--
Free games and programming goodies. http://www.personal.leeds.ac.uk/~bgy1mm
"Malcolm McLean" <re*******@btinternet.comwrites:
It is a problem for me. I am not clever enough to solve eigensystems
from first principles. However I use these functions in my work. I'd
like to post the programs on my website but I am worried about
compromising Numerical Recipies.
Numerical Recipes is a rule unto its because the authors are
aggressive about defending what they see as their rights, which
they happen to see as being much more extensive than what most
authors believe to be their rights. It's bad enough that I've
been discouraged by other programmers from using Numerical
Recipes as a citation in code when I'm using NR algorithms but
not NR code.
--
"In My Egotistical Opinion, most people's C programs should be indented six
feet downward and covered with dirt." -- Blair P. Houghton
On May 18, 12:43 pm, Richard Heathfield <r...@see.sig.invalidwrote:
Clever Monkey said:
<snip>
I've read
local copyright code on how it affects me in some cases, and have come
to the conclusion that there is little illegal in copying source code
from an ordinary computer book into my computer for personal research.
If there is *anything* illegal about it, the world is crazy (which isn't
so impossible, I grant you).
When I put a whole bunch of source code onto a CD and stuck it in the
back of "C Unleashed", I sure as heck didn't put it there so that you
would *not* be able to use it. Sheesh, world! If you don't want people
to use source code, don't publish it! If you publish source code, *why*
are you publishing it, if *not* to let people *use* it?
The NR in C people did it to make money on it.
The code has a separate license from the book (owning the book is not
enough to use it, you also have to buy a separate license to use the
code for jobs).
I have all of the NR books, but I don't use their code for anything
except looking at an alternate implementation of some algorithm I am
planning to write.
The code is lame anyway, they don't check for zero divides or any sort
of thing that you will normally find in robust implementations.
On the other hand, it is always interesting to see how someone else
would tackle a problem and their code is simple enough that anyone can
easily understand it.
So I'm glad that the books come with code, despite the fact that I
can't use it for anything but study.
On Fri, 18 May 2007 16:41:25 +0200, Sensei <senseiwa at Apple's mac
dot comwrote:
>On 2007-05-18 11:47:41 +0200, Osiris <no**@hotmail.comsaid:
>I have this book "Numerical recipes in C" that has a chapter on eigen-stuff. maybe this title is a good search phrase for google ? ah.. yes: www.nr.com !!
surely you could find the accompanying source on the net... I found it on EMULE P2p...
And surely you read that the book and the code snippets inside are copyrighted and non-free, right?
You mean to imply that the OP would not BUY the book and use the code
like I did ?
Good god......surely not.... really !
Sensei in what ?
Steven G. Johnson wrote:
On May 18, 2:43 pm, Tor Rustad <torust_at_online.nowrote:
>Why do you want to implement this yourself?
If you are not very experienced, there many pitfalls to watch out for, you should at least verify your implementation with the robust code found in EISPACK and CERNLIB. [1]
<snip>
Nowadays, the state of the art in dense-matrix eigensolvers is usually
considered to be LAPACK (the successor to LINPACK and EISPACK).
OK, the world has moved forward then.
(The fact that LAPACK is in Fortran is no excuse for the original
poster to rewrite his own C eigensolver.
Yes, the only reason I can see for the OP to implement this himself, is
if it's an assignment, where the program is *not* supposed to be used
for serious calculations.
--
Tor <torust [at] online [dot] no>
Ben Pfaff wrote:
"Malcolm McLean" <re*******@btinternet.comwrites:
>It is a problem for me. I am not clever enough to solve eigensystems from first principles. However I use these functions in my work. I'd like to post the programs on my website but I am worried about compromising Numerical Recipies.
Numerical Recipes is a rule unto its because the authors are
aggressive about defending what they see as their rights, which
they happen to see as being much more extensive than what most
authors believe to be their rights.
There is no reason to consider the code in NR on eigenvalue problems,
since there are free scientific libraries on this. I would be very
surprised if NR could even match quality found in LAPACK/EISPACK.
Do NR handle the case of OP, i.e. complex matrix?
--
Tor <torust [at] online [dot] no>
On May 18, 4:53 pm, Tor Rustad <torust_at_online.nowrote:
Ben Pfaff wrote:
"Malcolm McLean" <regniz...@btinternet.comwrites:
It is a problem for me. I am not clever enough to solve eigensystems
from first principles. However I use these functions in my work. I'd
like to post the programs on my website but I am worried about
compromising Numerical Recipies.
Numerical Recipes is a rule unto its because the authors are
aggressive about defending what they see as their rights, which
they happen to see as being much more extensive than what most
authors believe to be their rights.
There is no reason to consider the code in NR on eigenvalue problems,
since there are free scientific libraries on this. I would be very
surprised if NR could even match quality found in LAPACK/EISPACK.
Do NR handle the case of OP, i.e. complex matrix?
It has some complex stuff in it but the eigenvalue/eigenvector
routines are cleary not designed for complex numbers.
The C++ version might possibly be made to work because it is a
template, but I guess that there will be a lot of work to get it
right.
This might be worth a look for the O.P. http://www.alglib.net/eigen/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Roman Suzi |
last post by:
;-)
Just type into google
"best programming language"
and press (I am lucky)
Sincerely yours, Roman Suzi
--
rnd@onego.ru =\= My AI powered by GNU/Linux RedHat 7.3
|
by: Matt |
last post by:
I always heard dialet of programming language. For example,
Objective-C is a dialet of C programming language. What does it really
mean? C is already standardize, why there are dialets? Or when...
|
by: evolnet.regular |
last post by:
I've been utilising C for lots of small and a few medium-sized personal
projects over the course of the past decade, and I've realised lately
just how little progress it's made since then. I've...
|
by: Juuso Hukkanen |
last post by:
Language is quite good, if you don't learn the language syntax in 30
minutes complain and flame.
t3d(TM) in a nutshell:
-Languages main documentation is two pages (presented on the last two...
|
by: Matt |
last post by:
Some people identify Microsoft C# is Proprietary programming language.
What is Proprietary programming language then? How does it differ
from other languages such as C++, or Java??
Please...
|
by: Dave |
last post by:
I want to spend two minutes on my soapbox.
I love C#. I am so productive in it it's ridiculous. But it's so easy to
write code that uses poor design principles. Example: just making...
|
by: Robert Seacord |
last post by:
The CERT/CC has just deployed a new web site dedicated to developing
secure coding standards for the C programming language, C++, and
eventually other programming language.
We have already...
|
by: deko |
last post by:
For building Windows desktop apps, the clear favorite is C#. But my clients
can't afford to buy Microsoft products. So I need to develop software for Linux
users and web applications.
In the...
|
by: CoreyWhite |
last post by:
I bought this book years ago, when I was just learning C++. Since
then I've gone through every math course offered at my college, taken
courses on coding C & thinking in terms how how to make the...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
|
by: Matthew3360 |
last post by:
Hi,
I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
|
by: Oralloy |
last post by:
Hello Folks,
I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA.
My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
|
by: Ricardo de Mila |
last post by:
Dear people, good afternoon...
I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control.
Than I need to discover what...
|
by: ezappsrUS |
last post by:
Hi,
I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
| |