[gecode-users] error_segmentation
Guido Tack
tack at gecode.org
Mon Jan 20 22:27:42 CET 2014
The BoolVar doesn't look initialise (try BoolVar B(*this,0,1);).
Just as a further tip, you don't need the Reify object, you can pass the BoolVar directly (the Reify is constructed automatically).
Cheers,
Guido
On 21 Jan 2014, at 8:23 am, mehdi m <medistif at hotmail.fr> wrote:
>
> Arrays are initialized properly like this:
> int i=5;
> int m=10;
> BoolVar B;
> Reify r(b);
> Intargs D (n*m);
> Matrix <IntArgs> A (*this, n, m);
> for (int i=0;i<m;i++){
> for(int j=0;j<n;j++){
> A(i,j)=1;
> }
> }
> for (int i=0;i<m;i++){
> linear (*this, A.col(i),B , IRT_EQ, 0, r);
> }
>
> if you have an example of reification of linear constraint, could you send it to me.
> Thank you.
> Cheers
> Mehdi
> From: medistif at hotmail.fr
> To: users at gecode.org
> Date: Mon, 20 Jan 2014 20:22:53 +0000
> Subject: [gecode-users] error_segmentation
>
> Hello everyone,
> in my model, i want to express : x <--> Sum Ai*Bi = 0.
> why i use linear constraint and reification such as :
>
> IntArgs A ;
> BoolVarArray B;
> BoolVar b;
> reify r (b);
> linear (*this, A , B , IRT_EQ , 0 , r);
>
> when running this gives me a segmentation fault. when I deleted the parameter r that passes, the problem might therefore be in the parameter r.
>
> if someone has an idea ! .
> thank you.
> Cheers,
> Mehdi
>
> _______________________________________________ Gecode users mailing list users at gecode.org https://www.gecode.org/mailman/listinfo/gecode-users
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
More information about the users
mailing list