[gecode-users] question about mult propagator
Christian Schulte
schulte at imit.kth.se
Wed Sep 13 09:51:45 CEST 2006
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 <a_le_jo55 at yahoo.com> 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 <iostream>
>
> 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"<<std::endl;
> if(estado==SS_SOLVED) std::cout<<"OK"<<std::endl;
> std::cout<<"A: "<<a<<" B: "<<b<<" tmp: "<<tmp<<std::endl;
> 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
More information about the gecode-users
mailing list