[gecode-users] Arbitrary big numbers?

Christian Schulte cschulte at kth.se
Thu Aug 3 20:55:58 CEST 2017


In fact, going to a fixed size, being it close to 64 bit or even 128 bit is not hard, it is just very tedious.

 

One of the biggest mistakes I did when starting Gecode was assuming that choosing int as the base datatype for integer variables is a good choice. Of course, it is not. One should have chosen an abstract datatype instead so that changing to larger types is easy... Now, figuring out which is really an int and what ought be the base type for an integer variable would mean sifting through 200 KLOC code… Yuck!

 

As said a stupid choice and eerily reminiscent of Bill Gates’ infamous quote “640K ought to be enough for anyone”…

 

Cheers

Christian

 

--

Christian Schulte,  <http://www.gecode.org/~schulte> www.gecode.org/~schulte

Professor of Computer Science, KTH,  <mailto:cschulte at kth.se> cschulte at kth.se

Expert Researcher, SICS, cschulte at sics.se

 

From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf Of Slav
Sent: Wednesday, August 2, 2017 23:26
To: Kish Shen <kish.shen at gmail.com>
Cc: users at gecode.org
Subject: Re: [gecode-users] Arbitrary big numbers?

 

Thank you very much for your thorough explanation.

Having infinite numbers may be a perfectionistic drive, but 2^51 integer limit is more than enough for my current problem.

That work you do, guys, with CLP and modeling is beauty in a nutshell. Wish you all the best.

 

2017-08-03 0:32 GMT+04:00 Kish Shen <kish.shen at gmail.com <mailto:kish.shen at gmail.com> >:

Hi Slav,

 

I guess I should first state that I have been working as a developer for ECLiPSe since 1998, and what I say here is personal and from an ECLiPSe perspective.

 

>How just an interface can be able to have numbers bigger than underlying library?

 

I am not sure what you mean by 'just an interface', but as the slides in your link describe, ECLiPSe is a programming language. It has an interface to Gecode, which will allow you to use Gecode in a program written in ECLiPSe, with essentially the same syntax as the native finite domain solvers of ECLiPSe, such as the interval solver (ic) described in the slides you linked to. 

 

ECLiPSe supports big integers if it was built with GMP. However, you can only use these integers when you are performing your arithmetic operations in ECLiPSe. You cannot use such integers when you are using an external solver such as Gecode. In fact, you cannot use big integers even with the native finite domain solvers of ECLiPSe

(the intervals in lib(ic) are represented using (C floating point type) double, and the integer range is the range of integers that can be precisely represented with a double).

.

On a more general point, one of the reasons why ECLiPSe does not support big integers even for native finite domain solvers is that in practice, modelling finite domain problems with very large ranges is not likely to be an effective way of solving such problems. This is our experience with ECLiPSe, I guess Christian or other people on this mailing list may have a different view.

 

Cheers,

 

Kish Shen

 

 

On Wed, Aug 2, 2017 at 8:01 PM, Christian Schulte <cschulte at kth.se <mailto:cschulte at kth.se> > wrote:

Gecode is but one of the solvers to which Eclipse has an interface. Christian

 

--

Christian Schulte,  <http://www.gecode.org/~schulte> www.gecode.org/~schulte

Professor of Computer Science, KTH,  <mailto:cschulte at kth.se> cschulte at kth.se

Expert Researcher, SICS, cschulte at sics.se <mailto:cschulte at sics.se> 

 

From: Slav [mailto:slavmfm at gmail.com <mailto:slavmfm at gmail.com> ] 
Sent: Wednesday, August 2, 2017 19:38
To: cschulte at kth.se <mailto:cschulte at kth.se> 
Cc: users at gecode.org <mailto:users at gecode.org> 
Subject: Re: [gecode-users] Arbitrary big numbers?

 

Thank for your answer :)
If so, I cannot understand that  <http://gki.informatik.uni-freiburg.de/teaching/ws1415/csp/csp11.pdf> "ECLiPSe Integers can be as large as fits into memory, e.g.: 123 0 -27 393423874981724" , but Wikipedia says <https://en.wikipedia.org/wiki/ECLiPSe>  that: 

ECLiPSe interfaces to external solvers, in particular the Gecode solver library

How just an interface can be able to have numbers bigger than underlying library?

 

2017-08-02 0:24 GMT+04:00 Christian Schulte <cschulte at kth.se <mailto:cschulte at kth.se> >:

Hi, unfortunately there is no support for this. We know that this is high on the wish list of many but… I think somebody has tried, if I recall correctly, though. Guido, do you have any details.

 

Cheers

Christian

 

--

Christian Schulte, www.gecode.org/~schulte <http://www.gecode.org/~schulte> 

Professor of Computer Science, KTH, cschulte at kth.se <mailto:cschulte at kth.se> 

Expert Researcher, SICS, cschulte at sics.se <mailto:cschulte at sics.se> 

 

From: users-bounces at gecode.org <mailto:users-bounces at gecode.org>  [mailto:users-bounces at gecode.org <mailto:users-bounces at gecode.org> ] On Behalf Of Slav
Sent: Tuesday, August 1, 2017 20:23
To: users at gecode.org <mailto:users at gecode.org> 
Subject: [gecode-users] Arbitrary big numbers?

 

Hello. I am modeling algorithm to hardware mapping with Gecode. Standard Int::Limits::max is too small because I want to target systems with more than 2^31 memory.

Is there a way to get use of arbitrary-precision arithmetic with Gecode or at least 64-bits integers?

I know that Gecode can be built with MPIR or GMP support, but seems those are just for trigonometric operations?

Thanks in advance :)

 

 

_______________________________________________
Gecode users mailing list
users at gecode.org <mailto:users at gecode.org> 
https://www.gecode.org/mailman/listinfo/gecode-users

 


_______________________________________________
Gecode users mailing list
users at gecode.org <mailto:users at gecode.org> 
https://www.gecode.org/mailman/listinfo/gecode-users

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20170803/4300a2ca/attachment.html>


More information about the users mailing list