[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: calculating the eigen matrix

From: Quentin Spencer
Subject: Re: calculating the eigen matrix
Date: Fri, 04 Jun 2004 10:50:19 -0500
User-agent: Mozilla Thunderbird 0.6 (X11/20040519)

This is from some old code I wrote:

ComplexMatrix R(size,size), V(size,size);
// Assign R to something...
V = EIG(R).eigenvectors();

Note that the data type doesn't have to be ComplexMatrix--it could also be just Matrix. I only needed the eigenvectors in this particular application. If you wanted both eigenvalues and eigenvectors, a better way would probably be something like this:

Matrix A,B;
ColumnVector c;
// Assign A to something...

This code is untested--just based on what I remember from doing this sort of thing in the past. I hope this helps.

Quentin Spencer

Tapesh wrote:


I am writing an application in C/C++ and want to use Octave library to calculate the eigen matrix and eigen-values.

I am able to compile octave successfully and to write a sample C++ programme.

Can someone provide a sample code to calculate eigen vectors?

Thanks in Advance,

Tapesh Kr. Agarwal

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]