caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sebastian Egner <sebastian.egner@philips.com>
To: Thomas Gazagnaire <thomas.gazagnaire@irisa.fr>
Cc: caml-list@yquem.inria.fr, caml-list-bounces@yquem.inria.fr
Subject: Re: [Caml-list] Integral solutions of rational linear equations
Date: Wed, 30 Nov 2005 09:32:12 +0100	[thread overview]
Message-ID: <OF3052ADF4.D88702E4-ONC12570C9.002B4D99-C12570C9.002F0C5A@philips.com> (raw)
In-Reply-To: <438CA20C.2080200@irisa.fr>

[-- Attachment #1: Type: text/plain, Size: 2625 bytes --]

Thomas,

Ocaml comes with a library for arbitrary-precision rational arithmetics;
the library is called 'Num' and its documentation can be found from here:

        http://caml.inria.fr/pub/docs/manual-ocaml/manual036.html

Now for computing integer solutions of rational equations you might
want to keep in mind that Gauss reduction suffers from exponential
growth of the entries because every row operation on the matrix
can---and usually does---double the number of bits in the numbers.
For this reason, Gaussian elimination and simple Hermite NF algorithms
are only useful if the number of equations is very low (<< 10, say).

Otherwise, you need to use more advanced algorithms (e.g. solving
several "mod m" images of the equation and reconstructing using the
Chinese Remainder Theorem), but I am not aware of any 'off the shelf'
implementation of this functionality in Ocaml.

As an entry point for the algorithms consider this page from the manual
of the computer algebra system Magma:

        http://magma.maths.usyd.edu.au/magma/htmlhelp/text602.htm#5489

Sebastian.

----
Dr. Sebastian Egner
Senior Scientist
Philips Research Laboratories
Prof. Holstlaan 4 (WDC 1-051, 1st floor, room 51)
5656 AA Eindhoven
The Netherlands
tel:       +31 40 27-43166
fax:      +31 40 27-44004
email: sebastian.egner@philips.com








Thomas Gazagnaire <thomas.gazagnaire@irisa.fr> 
Sent by:
caml-list-bounces@yquem.inria.fr
29-11-2005 19:46

To
caml-list@yquem.inria.fr
cc

Subject
[Caml-list] Integral solutions of rational linear equations
Classification







Hello,

in my one of my Ocaml programs, I need to find all integers solutions of 
a rational equation systems. This algo uses Gauss reduction and Hermite 
normal form, and need to know if a rational is an integer or not (ie. I 
don't want to use numerical approximation : (1/3) * 3 is an integer but 
0,333333*3 we don't know). I didn't find any integer algebra package for 
ocaml, so I tried to implement Gauss elimination (easy) and Hermite 
normal form (more difficult...). But I didn't implement optimized 
version of these algorithms...

So my question is : do you know if exists a native ocaml module or an 
interface with a C library which is able to do integer/rational matrix 
manipulation (essentialy the Hermite normal form) in an efficient way ?

Thomas


_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


[-- Attachment #2: Type: text/html, Size: 4505 bytes --]

  reply	other threads:[~2005-11-30  8:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-02 12:02 Unsafe features Florian Weimer
2005-09-03  9:24 ` [Caml-list] " Damien Bobillot
2005-09-03  9:40   ` Florian Weimer
2005-09-03 11:19     ` Jon Harrop
2005-09-03 12:07     ` yoann padioleau
2005-09-03 14:28       ` Florian Weimer
2005-09-03 14:35         ` yoann padioleau
2005-09-03 14:47           ` Florian Weimer
2005-09-03 14:51             ` Florian Weimer
2005-09-03 14:55               ` yoann padioleau
2005-09-04  1:58         ` Jacques Garrigue
2005-09-03  9:29 ` Erik de Castro Lopo
2005-11-29 18:46 ` Integral solutions of rational linear equations Thomas Gazagnaire
2005-11-30  8:32   ` Sebastian Egner [this message]
2005-11-30  8:49   ` [Caml-list] " Christophe Raffalli
2005-11-30  9:06     ` Christophe Raffalli
2005-11-30  9:08     ` Christophe Raffalli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OF3052ADF4.D88702E4-ONC12570C9.002B4D99-C12570C9.002F0C5A@philips.com \
    --to=sebastian.egner@philips.com \
    --cc=caml-list-bounces@yquem.inria.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=thomas.gazagnaire@irisa.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).