[gecode-users] question about mult propagator

Alejandro Arbelaez a_le_jo55 at yahoo.com
Wed Sep 13 19:23:10 CEST 2006


Hi, 
 

 I tried to compile the program again, and when I compile gecode without debug the program fails (i.e prints FAILED), but when I compile gecode with debug the program works very well (i.e prints OK).
 
 
 I'm working with: 
 gecode-1.2.2 
 g++-4.03
 ubuntu 6.04
 


Thanks for the help
Alejandro


Christian Schulte <schulte at imit.kth.se> wrote: Please, let me reiterate the issues raised in the two previous replies:

 Never, never ever, report a problem without telling
  - Gecode version number
  - platform used (operating system plus C++ compiler)

In this case, early versions of Gecode had actually a bug in multiplication
(but actually not incorrectness just a  quirk). So did you double check that
the program you wrote is the program you executed?

Cheers
Christian

--
Christian Schulte, http://www.imit.kth.se/~schulte/ 

-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Mikael Zayenz Lagerkvist
Sent: Wednesday, September 13, 2006 8:22 AM
To: Alejandro Arbelaez
Cc: users at gecode.org
Subject: Re: [gecode-users] question about mult propagator


Hello Alejandro,

When I tried your program with Gecode 1.2.2 it worked as it should, i.e., it
printed OK
A: 316 B: 120 tmp: 37920

What version of Gecode are you using? What platform are you using it on?

Cheers,
Mikael

On 9/13/06, Alejandro Arbelaez  wrote:
> Hi all,
>
> I don't understand why the following program fails,
>
> I only want to create a propagator for
> a*b=:tmp, where a=:316 and b=:120
> so after the propagation (status) tmp is going to be equal to 37920, 
> and that is the value that tmp shows in the last line of the program, 
> but the status of  A is failed ????
>
> #include "gecode/int.hh"
> #include "gecode/kernel.hh"
> #include 
>
> using namespace Gecode;
>
> class Alejo : public Space {
> public:
>   Alejo(void) {}
>   virtual Space* copy(bool share) {
>     return new Alejo(*this);
>   }
> };
>
> int main() {
>   Alejo A;
>   IntVar a(&A,0,100000);
>   IntVar b(&A,0,100000);
>   IntVar tmp(&A,Gecode::Limits::Int::int_min,
> Gecode::Limits::Int::int_max);
>   mult(&A,a,b,tmp);
>   eq(&A,a,316);
>   eq(&A,b,120);
>
>   unsigned long pp;
>   SpaceStatus estado = A.status(pp);
>
>   if(estado==SS_FAILED) std::cout<<"FAILED"<
>   if(estado==SS_SOLVED) std::cout<<"OK"<
>   std::cout<<"A: "<<<" B: "<<<" tmp: "<<
>   return 0;
> }
>
>
> Cheers
> Alejandro
> _______________________________________________
> Gecode users mailing list
> users at gecode.org https://www.gecode.org/mailman/listinfo/gecode-users
>
>
>


-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/

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



 				
---------------------------------
Do you Yahoo!?
 Next-gen email? Have it all with the  all-new Yahoo! Mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20060913/52f883d7/attachment.htm>


More information about the gecode-users mailing list