Registered Member
|
Hey Eigen !
First of all, I apologize for my english, it is not my mother tongue. Here is my question : I have a complex matrix A and a complex vector b. I would like to solve the linear system Ax=b. I tried to use the example on this page, and adapt it to my complex problem. (http://eigen.tuxfamily.org/dox/group__TutorialLinearAlgebra.html) Here is a simplified example of what i'm trying to do : My object are defined this way :
And in my code I want to solve this
The error appears at the line : DoubleComplexArray x = dec.solve(b); because when I comment it, there is no more error. I get this error : TideSolve.cpp:98:38: error: no matching function for call to ‘Eigen::ColPivHouseholderQR<Eigen::Matrix<std::complex<double>, -1, -1> >::solve(DoubleComplexArray&)’ DoubleComplexArray x = dec.solve(b); Here is finally my question: Does that mean that eigen solvers does not work with complex ? (I'm sure they do, and I'm just bad ! ) Do I need another solver than ColPivHouseholderQR that work with complexs ? If so, can someone tell me which one ? Thank you very much for your help and time. Once again, I apologize for my english. If this subject has already been covered somewhere, I also apologize: I did not find it... |
Moderator
|
Answered on SO: http://stackoverflow.com/questions/3568 ... ear-system
|
Registered Member
|
Thank you very much for your answer and considering my question. SO indeed helped me fixed my problem.
But I have to admit it is pretty slow. It took 2 hours to solve a 1800*1800 matrix. Do you think it is a normal time ? I admit I have no idea what are normal compuation time for these kind of calculus. I compile using : g++ -o main *.cpp |
Moderator
|
Don't forget to enable compiler optimizations: with the -O3 flag. It then should be several order of magnitude faster
|
Registered Member
|
Thank you very much !
When I did this I had several error in my codes (mostly warnings) but now it works just fine and it's so much faster ! |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft