g-truc/glm — pull request #5 by komiga (2012-10-22 21:47:52+00:00)
Title: Fixed component swapping in tmat2x2::_inverse()

`glm::detail::tmat2x2::_inverse()` incorrectly swaps both diagonals instead of only main diagonals:

A = ⌈a b⌉
⌊c d⌋

(using standard representation). `_inverse()` on `A` incorrectly gives the order

⌈ d -c⌉
⌊-b a⌋

(swaps both diagonals) where it should be

⌈ d -b⌉
⌊-c a⌋

(I am leaving out division by the determinate for clarity).

Also, `glm::inverse()` in `glm/core/func_matrix.inl` is **correct** for 2x2 matrices and shows the mistake of `_inverse()`.
The unit tests do not appear to test division of a `mat2` by a `mat2` (where this could arise).