[gecode-users] sqrt function

Christian Schulte cschulte at kth.se
Sat Apr 5 20:11:43 CEST 2008


Great! All well, that spells WEEKEND! Christian

--
Christian Schulte, www.ict.kth.se/~cschulte/

-----Original Message-----
From: Jaroslav Mlejnek [mailto:mum.jmlejnek at post.cz] 
Sent: Saturday, April 05, 2008 7:02 PM
To: cschulte at kth.se; users at gecode.org
Subject: Re: [gecode-users] sqrt function

Dear Christian,

thanks a lot for your time! As you said I found a thread in e-mail archive 
and both compilation and sqrt function work perfectly.

Jarda

----- Original Message ----- 
From: "Christian Schulte" <cschulte at kth.se>
To: "'Jaroslav Mlejnek'" <mum.jmlejnek at post.cz>; <users at gecode.org>
Sent: Saturday, April 05, 2008 5:40 PM
Subject: RE: [gecode-users] sqrt function


> Hi, there is an old message in this thread that explains how to get MSVC
> 2008 working for Gecode. Please check. It is easy enough. We do not use 
> the
> IDE and project files.
>
> Christian
>
>
> --
> Christian Schulte, www.ict.kth.se/~cschulte/
>
>
> -----Original Message-----
> From: Jaroslav Mlejnek [mailto:mum.jmlejnek at post.cz]
> Sent: Saturday, April 05, 2008 4:18 PM
> To: cschulte at kth.se; users at gecode.org
> Subject: Re: [gecode-users] sqrt function
>
> I tried compile Gecode source codes from svn but without any success. I am
> using Windows, MSVS 2008 & Cygwin and as you write on your website
> http://www.gecode.org/gecode-doc-latest/PageComp.html, there is no way how
> to make DLLs? But I am using DLLs and header files now, so is there any 
> MSVS
>
> project which can do this? Or exists some more "talkaktive" how to?
>
> If you have time can you send me patched header files and compiled DLL/lib
> libraries? I am very sorry, but this things under Windows is a little bit
> "taboos" for me and I can't use my linux because of project specification.
>
> Jarda
>
> ----- Original Message ----- 
> From: "Christian Schulte" <cschulte at kth.se>
> To: "'Jaroslav Mlejnek'" <mum.jmlejnek at post.cz>; <users at gecode.org>
> Sent: Saturday, April 05, 2008 12:37 AM
> Subject: RE: [gecode-users] sqrt function
>
>
>> Jarda,
>>
>> Hmmm, we have no real plan for the next release yet (honestly, there is
>> currently a mismatch between the docs and the code, for once in a 
>> lifetime
>> the docs jumping ahead).
>>
>> But, as said, it is in the trunk: the trunk is available in svn and - if
>> memory serves me right - there is even some blurb on the webpages you to
>> get
>> it.
>>
>> If you just want to have a patch to 2.1.1 source I code send you that.
>>
>> Thanks!
>> Christian
>>
>> --
>> Christian Schulte, www.ict.kth.se/~cschulte/
>>
>> -----Original Message-----
>> From: Jaroslav Mlejnek [mailto:mum.jmlejnek at post.cz]
>> Sent: Friday, April 04, 2008 12:10 AM
>> To: cschulte at kth.se; users at gecode.org
>> Subject: Re: [gecode-users] sqrt function
>>
>> You are welcome :-)
>>
>> Can you tell me a date when will be new release of Gecode with this
>> function
>>
>> fixed? Or can I download fixed files from (for example) some svn? Sqrt
>> function is very important in computing my objective function.
>>
>> Thanks a lot, I have a great regard for your work.
>>
>> Jarda
>>
>> ----- Original Message ----- 
>> From: Christian Schulte
>> To: 'Jaroslav Mlejnek' ; users at gecode.org
>> Sent: Thursday, April 03, 2008 11:15 PM
>> Subject: RE: [gecode-users] sqrt function
>>
>>
>> Hi Jaroslav,
>> I checked: it is a bug in sqrt (it was not incorrect but too weak)! So
>> what
>> it does for sqrt(25) is that it  believes that it is between 4..5 ;-(
>> Unluckily, both the propagator and its test was buggy and cancelled each
>> other out;-) That's why this one escaped us.
>> The assertion you see is that you use val() on a variable not yet 
>> assigned
>> due to the bug.
>> I fixed it in the trunk.
>>
>> Thank you!
>> Christian
>>
>> --
>> Christian Schulte, www.ict.kth.se/~cschulte/
>>
>> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On 
>> Behalf
>> Of Jaroslav Mlejnek
>> Sent: Thursday, April 03, 2008 7:50 PM
>> To: users at gecode.org
>> Subject: [gecode-users] sqrt function
>>
>> Hi!
>>
>> I am using C++ Gecode Library in my school project and I am very 
>> satisfied
>> with it. But I would like to use an arithmetic function "sqrt" and I 
>> think
>> it doesn't work well. In code:
>>
>>
>> defining CSP (x is class global, y is constructor local):
>>
>> IntVar x (this, 0, Int::Limits::max), y (this, 0, Int::Limits::max);
>> rel(this, y, IRT_EQ, 25);
>> rel(this, x, IRT_EQ, Gecode::sqrt(this, y));
>>
>>
>> printing solution (like Gecode examples):
>> cout << x.val() << endl;
>>
>>
>> There is in printing solution method an assert (debug) error instead of
>> solution number 5. But when I use "similar" function "sqr", it works fine
>> (or as I expect), so the solution is 625.
>>
>> Is this bug in sqrt function or sqrt function has some special way how to
>> use it? I am using Gecode since version 1.1.0, my current version is the
>> newest  2.1.1.
>>
>> Thanks a lot for your answer,
>>
>> Jaroslav Mlejnek
>> Faculty of Mathematics and Physics
>> Charles University, Prague
>> Czech Republic
>>
>>
>>
>
> 






More information about the gecode-users mailing list