Rationals and Linear Programming in Python

Noah noah at noah.org
Mon May 13 15:46:18 EDT 2002


Alex Martelli <aleax at aleax.it> wrote in message news:<lzxD8.49747$zW3.655443 at news1.tin.it>...
> Noah Spurrier wrote:
>         ...
> > I've also seen a few rational modules, but many of them looked old.
> > It was hard to tell what has the most active development and support.
> 
> gmpy (gmpy.sf.net) does look old -- I haven't even released a Windows
> ...
> The rationals in gmpy are type gmpy.mpr, by the way.
> 
> I hear Marc Andre Lemburg has a spiffier-looking GMP wrapper as one
> of his mx.* goodies, but haven't looked into it -- I'd assume it could
> probably meet your needs just as well as gmpy could, though.
> 
> Alex

I'm more interested in a pure Python type. The Gmpy docs say
that it has this, so far so good. Do you know if it will work 
with the matrix type in Numerical Python? 
We need to do matrix inverses with rationals.
If that works, then it should be straighforward to code the 
Simplex method for LP problems.

The goal is to use this for Linear Programming instruction, so
rationals and the ability to step through a solution is a higher
priority than speed or precision (although rationals should help
with that -- we are mainly interested in the fact that rationals
are easier for students to think about that a bunch of large
decimal-place reals).

Yours,
Noah



More information about the Python-list mailing list