Inverse Matrix Calculation with elementary matrix

Just for fun for holidays, I took a look at a linear algebra text book which I used in my university and wrote python code to calculate inverse matrix. I was interested that elementary operations of matrix can be represented by matrix itself. So, I wrote calculation algorithm by using multiplication chain of elementary matrix. I know the implementation has very bad performance (Yes, it’s O(N⁵). surprisingly bad) than gaussian elimination (O(N³)). However, it’s still useful to see elementary matrix based implementation actually works as it is easier to understand the concept of inverse matrix and its calculation methodology.

Examples of Calculated Inverse Matrix

--

--