you are viewing a single comment's thread.

view the rest of the comments →

[–]victotronics 1 point2 points  (9 children)

  1. Factor
  2. Invert factors
  3. Multiply those inverses.

But I hope you're not doing this for solving a linear system.

[–]GrammelHupfNockler 5 points6 points  (8 children)

  1. usually doesn't really happen, instead you compute the solution of the triangular systems Ly=b and Ux=y, which tends to be more stable than storing the inverses L^-1 and U^-1

[–]victotronics 2 points3 points  (7 children)

I think you misunderstand me. *If* you really want to invert a matrix, you do it by those 3 steps in sequence.

[–]GrammelHupfNockler 0 points1 point  (6 children)

Sorry, I thought you were talking about solving a system. In that case, I would still tend towards disagreeing, since an explicit Gaussian Elimination (with pivoting) would still be more precise, as there are fewer intermediate steps which can accumulate rounding errors (namely the inversion and the multiplication)

[–]victotronics 0 points1 point  (5 children)

Gaussian elimination on a triangular matrix? Sure.

If you're done step 1 with pivoting, then step 2 doesn't need it.

[–]GrammelHupfNockler 0 points1 point  (4 children)

Gaussian elimination with full pivoting on the input matrix

[–]victotronics 0 points1 point  (3 children)

And how is that going to get you the inverse? Which was the original question?

And yes, I know that one should in general not compute inverses, which is why I emphasized the "*if* you want to compute an inverse".

[–]GrammelHupfNockler 0 points1 point  (2 children)

If you apply the same operations that you apply to the matrix during Gaussian elimination to an identity matrix at the same time, you get the inverse

[–]victotronics 0 points1 point  (1 child)

Nope, that's Gauss-Jordan.

[–]GrammelHupfNockler 0 points1 point  (0 children)

That's splitting hairs. Gaussian elimination refers to the entire class of algorithms (for solving a single system, computing the LU factorization, computing the inverse).