inverse of a matrix with Fraction entries

Robert Kern robert.kern at
Wed Nov 24 23:54:56 CET 2010

On 11/24/10 12:30 PM, Robert Kern wrote:
> On 11/24/10 12:07 PM, Daniel Fetchinson wrote:
>> The whole story is that I have a matrix A and matrix B both of which
>> have rational entries and they both have pretty crazy entries too.
>> Their magnitude spans many orders of magnitude, but inverse(A)*B is an
>> okay matrix and I can deal with it using floating point numbers. I
>> only need this exact fraction business for inverse(A)*B (yes, a
>> preconditioner would be useful :))
>> And I wouldn't want to write the whole matrix into a file, call Maple
>> on it, parse the result, etc.
>> So after all I might just code the inversion via Gauss elimination
>> myself in a way that can deal with fractions, shouldn't be that hard.
> +1000. This is almost always the right thing to do whether you have floats or
> rationals.

By this I meant that you should using Gaussian elimination to *solve* the 
problem A^-1*B is the right thing to do rather than explicitly forming the 
inverse of A (no matter which algorithm you use). I hope that's what you meant too.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

More information about the Python-list mailing list