Registered Member
|
Hello
this is my env: windows7_32bit+vs2008 I want to get the largest and second-largest eigenvalues when I use EigenSolver to solver a matrix(size is 1000*1000),1hours later ,the programe still executing EigenSolver this line. //////////code MatrixXf big(1000, 1000); big << *****; EigenSolver<MatrixXd> ces(big); ////// i really want to know how to improving my code~if you know plz tell me mail: currily@163.com |
Registered Member
|
You are solving the problem with dense matrix. 1000x1000 is a relative large dense matrix. So the computing complexity is high. You may try sparse matrix instead. However, this is only applicable when the sparsity of your problem is good enough. And, I am curious about how you feed the such a big matrix will the operator << ...
|
Registered Member
|
thanks you
yes, I hava a large dense matrix, i try to solving it through redsvd(https://code.google.com/p/redsvd/), it can calculate the eigenvalues and eigenvector in rank,and quite fast, but the answer seems deviate from the matlab " feed the such a big matrix" in fact, I feed it by read value form excel sheet then big(i, j) = value = =.. |
Registered Member
|
You might want to try installing and enabling the Eigen MKL backend, computing the Eigenvalues with MKL ?GEES is a lot faster.
Another idea is to try this alternative approach: http://www.cs.colorado.edu/~mcbryan/3656.04/mail/61.htm Here you do: do N times { [Q R] = qr(A) A = R*Q } at the end A will contain the approximate eigenvalues in its diagonal. However, this method has some convergence issues. There is a quite fast GPU-based implementation of QR in MAGMA ?GEQP3. |
Moderator
|
Make sure you compiled with optimizations ON, and SSE2. On my 5 years old computer, EigenSolver tooks 41s on a random 1000x1000 matrix. If your matrix is symmetric, SelfAdjointEigenSolver will complete in 1 or 2 seconds.
|
Registered Member
|
Thank you..
I will try optimizations this is my env IDE:vs2008 os:windows7 cpu entium G630 2.70GHz |
Registered Member
|
oh....it work!
when i use release mode instead of debug , only cost 40+s ,Thank you~ |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]