PDA

View Full Version : QMatrix Inverted



muykim
18th January 2018, 01:19
I would like to do an inverse of a matrix. I read the QMatrix document (http://doc.qt.io/archives/qt-4.8/qmatrix.html#inverted). They have this inverted function. According to the doc, it supposes to return an inverted copy of the matrix, but it also mentions about returning boolean. How does this work?

d_stranz
18th January 2018, 04:52
If the matrix can be inverted successfully, then the boolean value is set to true and the inverted matrix is returned. If the matrix is singular (or degenerate), then its determinate is zero and it is non-invertible. If the matrix is not square, it is non-invertible. In this case, the function sets the boolean to false. As the docs say, if the matrix is non-invertible, then the method returns the identity matrix and the boolean is set to false.

Wikipedia (https://en.wikipedia.org/wiki/Invertible_matrix) explains it in more detail.