Registered Member
|
Hi,
I want to solve A.X=B where A is a square dense matrix et B a vector. To reduce the size of my problem, I wrote X=P+S , P is the vector of primary unknowns and S is the vector of secondary unknown. Knowning matrix Q,R,T, I want to solve Q.S =R.P + T. with eigen. What is the best solution (regarding memory and cpu) to get Q-1*R and Q-1*T using eigen ? Can you post code to solve this problem (I am new user of eigen) Thank in advance |
Moderator
|
Can you comment on Q? (size, symmetry, etc.)
A general approach would be:
Check these pages for alternatives and details: http://eigen.tuxfamily.org/dox-devel/gr ... tions.html http://eigen.tuxfamily.org/dox-devel/gr ... gebra.html |
Registered Member
|
Thanks, I will test it. Q is a dense non symetric matrix. Typical sizes for my problem are X vector of 15 elements with 7 primary and 8 secondary unkwown. With thoses sizes, Q is a (8x8) square dense non symetric matrix, R is a (8,7) matrix and T is a 8 element vector The key Issue is that this process is a local resolution I repeat 100,000 times per Newton step. is HouseholderQR the best solver for that ? |
Moderator
|
Since Q is squared, PartialPivLu will be faster. Also, since your matrix sizes are small an known at compile time, I recommend you to use fixed size matrices, e.g., with float:
typedef Matrix<float, 8, 8> Matrix88f; typedef Matrix<float, 8, 7> Matrix87f; typedef Matrix<float, 8, 1> Vector8f; This way you make sure to avoid costly dynamic memory allocations. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]