![]() Registered Member ![]()
|
Greetings all,
I need to solve equation which is: b * A^(-1) = x where b - vector of double numbers A - large matrix (90000 * 90000 elements of double type) x - vector representing results Due to large size of A matrix i should to make it sparse before solution. Next step it is inversion of A matrix. And the last one step is inversed sparse A matrix multiplication by vector b. I had read documentation of Eigen and found that code below will work for me:
So i have two quastions: 1) is it most optimal scheme for solution of such type of equations? 2) what is the most efficient way to define and replace values in A and b ? Thanks in advance! |
![]() Registered Member ![]()
|
This is how I do it with square matrices that have >10^6 rows and columns
Note: b * A^(-1) = x x = b * A^(-1) x * A = b (x * A)^T = (b)^T https://en.wikipedia.org/wiki/Transpose#Properties A^T * x^T = b^T There is your Ax=B form, and this is more-or-less what my code looks like:
I'm not proficient enough with Eigen to know if this is better, but it's an alternative that might be. You just have to profile/benchmark it and see. |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell