Java inverse matrix calculation

后端 未结 11 1226
难免孤独
难免孤独 2020-12-03 07:58

I\'m trying to calculate the inverse matrix in Java.

I\'m following the adjoint method (first calculation of the adjoint matrix, then transpose this matrix and fina

11条回答
  •  生来不讨喜
    2020-12-03 08:45

    You NEVER want to compute an inverse matrix this way. Ok, computation of the inverse itself is to be avoided, as it is almost always better to use a factorization such as an LU.

    Computation of the determinant using recursive computations is a numerically obscene thing to do. It turns out that a better choice is to use an LU factorization to compute a determinant. But, if you are going to bother to compute LU factors, then why would you possibly want to compute the inverse? You have already done the difficult work by computing the LU factors.

    Once you have LU factors, you can use them to do back and forward substitution.

    As far as a 19x19 matrix being big, it is not even close to what I'd think of as big.

提交回复
热议问题