Fast matrix inversion without a package

Viewed 1322

Assume that I have a square matrix M. Assume that I would like to invert the matrix M.

I am trying to use the the fractions mpq class within gmpy2 as members of my matrix M. If you are not familiar with these fractions, they are functionally similar to python's built-in package fractions. The only problem is, there are no packages that will invert my matrix unless I take them out of fraction form. I require the numbers and the answers in fraction form. So I will have to write my own function to invert M.

There are known algorithms that I could program, such as gaussian elimination. However, performance is an issue, so my question is as follows:

Is there a computationally fast algorithm that I could use to calculate the inverse of a matrix M?

1 Answers
Related