Invert 4x4 matrix - Numerical most stable solution needed

后端 未结 6 825
青春惊慌失措
青春惊慌失措 2021-02-04 08:41

I want to invert a 4x4 matrix. My numbers are stored in fixed-point format (1.15.16 to be exact).

With floating-point arithmetic I usually just build the adjoint matrix

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-04 09:13

    I'd like to second the question Jason S raised: are you certain that you need to invert your matrix? This is almost never necessary. Not only that, it is often a bad idea. If you need to solve Ax = b, it is more numerically stable to solve the system directly than to multiply b by A inverse.

    Even if you have to solve Ax = b over and over for many values of b, it's still not a good idea to invert A. You can factor A (say LU factorization or Cholesky factorization) and save the factors so you're not redoing that work every time, but you'd still solve the system each time using the factorization.

提交回复
热议问题