This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Inverse of small matrices also numerically stable?

Tags: None
(comma "," separated)
vernal
Registered Member
Posts
37
Karma
0
The eigen tutorial/docs say:
While certain decompositions, such as PartialPivLU and FullPivLU, offer inverse() and determinant() methods, you can also call inverse() and determinant() directly on a matrix. If your matrix is of a very small fixed size (at most 4x4) this allows Eigen to avoid performing a LU decomposition, and instead use formulas that are more efficient on such small matrices.

Does that mean that it is always advisable/better for matrices smaller than 4x4 to call the .inverse() function instead of performing a decomposition? Are there numerically stable operations performed?

Cheers
vernal
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
regarding numerical accuracy it is always better not to compute the inverse but directly compute A^1 * B through the solve methods of the decompositions. Now, for very small matrices, specialized inverse functions are also much faster and should give enough accuracy in most cases.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora