|
From: | Fredrik Lingvall |
Subject: | Re: Symmetric eigenproblem |
Date: | Fri, 11 Jul 2008 15:30:05 +0200 |
User-agent: | Thunderbird 2.0.0.14 (X11/20080505) |
Fumihiro Chiba wrote:
I found two possible ways to do this: 1) dsytrd/dpteqr and 2) dsyevd. I did a test with the second method on a core2 laptop (symeig uses dsyevd):There may not be such a function on Octave. For not large matrices, it is sufficient to use eig function that is made for general matrices. Recent computers have sufficient power to compute eigen value problem of not large dense matrices. For large sparse symmetric matrices, you may need to implement a function by yourself. ----------------------- Fumihiro CHIBA On 2008/07/10, at 19:42, Fredrik Lingvall wrote:Is need to do a (large) factorization of the type U*D*U^T = A where A is a symmetric real matrix, U orthonormal, and D is diagonal. Is there a function in octave that exploits that A is symmetric?
octave:1> A = rand(2000,2000); octave:2> A = A'*A; octave:3> tic,[V,L] = eig(A);toc Elapsed time is 45.5287 seconds. octave:4> tic,[V2,L2] = symeig(A);toc Elapsed time is 8.58328 seconds. octave:5> norm(A-V*L*V') ans = 9.9440e-10 octave:6> norm(A-V2*L2*V2') ans = 1.5832e-09As seen above the speedup was substantial compared to eig. I noticed that the computation is mostly serial using eig, even though I'm using a threaded BLAS (Goto BLAS 1.26). The LAPACK routine dsyevd seems better in this aspect.
/Fredrik
[Prev in Thread] | Current Thread | [Next in Thread] |