How to find out if matrix is invertible (regular, nonsingular, full rank...) in Eigen?

StackOverflow https://stackoverflow.com/questions/23155762

  •  05-07-2023
  •  | 
  •  

문제

When computing the inverse of a matrix in Eigen it is up to the user to check if this can be done:

This matrix must be invertible, otherwise the result is undefined.

but how can I check for this condition in Eigen?

도움이 되었습니까?

해결책

Eigen provides a rank-revealing LU decomposition, which provides an isInvertible member function.

See

다른 팁

There are plenty of other properties of matrices that hold only for invertible matrices. You can check one of those to see if the matrix is invertible.

One possibility is to check if the determinant is 0. Iff so, the matrix is not invertible.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top