Registered Member
|
I haven't seriously used eigen for anything, so to learn a bit more I was playing around with some simple timings. (Code posted here: https://gist.github.com/2802432). As far as I remember it's the most recent stable version of Eigen.
I came across a couple of unexpected things. (1) I keep getting the same matrix (for a given size) when I call MatrixXf. Is there some random seed that's automatically set in eigen? I didn't see anything in the docs. (2) On my machine the householder reflection qr was usually only, say, about 2 times as slow as the partial pivot lu, but gave accuracy better than the full pivot lu. Also, the householder reflection qr often did better (both in terms of x-real_x norm and A*x-b norm) than the column or full pivot qr's. I don't know numerical linear algebra very well, but that surprised me. Can anyone point me to explanations of what could be going on? Also, if anyone could suggest better ways of doing the tests I posted in the code I'd be very grateful. (The timings should only be of the factorizations, not computing the residuals. But my major issue was wanting to move the timings of the factorization into some sort of function call rather than using macros. I wasn't sure how to do that.) Thanks, Chris |
Moderator
|
1) yes that's intended, Matrix::Random uses the standard rnd generator, so you can initialize a seed with srand(seed);
2) Pivoting does not necessarily improve numerical accuracy, it only improves robustness in case of rank-deficient, or nearly rank deficient matrices. |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell