inverse of a matrix with Fraction entries

casevh casevh at gmail.com
Fri Nov 26 13:31:32 EST 2010


On Nov 25, 1:28 pm, Daniel Fetchinson <fetchin... at googlemail.com>
wrote:

> Okay, I see your point and I completely agree.
> Surely it will be faster to do it with integers, will give it a shot.
>
> Cheers,
> Daniel
>
> --
> Psss, psss, put it down! -http://www.cafepress.com/putitdown

You may want to look at using GMPY. GMPY wraps the Gnu Multiple-
precision library and includes support for rational arithmetic. I just
tested a few calculations involving rational numbers with hundreds to
thousands of digits and GMPY's mpq type was between 10x and 100x
faster than fractions.Fractions.

GMPY is availabe at http://code.google.com/p/gmpy/

casevh

Disclaimer: I'm the current maintainer of GMPY.



More information about the Python-list mailing list