[gecode-users] A rather basic quesion

Christian Schulte cschulte at kth.se
Fri Aug 17 10:16:51 CEST 2007


However, there is a small quirk in your code: writing just "BollVar X" does
not initialize X. You need to write
	BoolVar X(this,0,1);

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: Thursday, August 16, 2007 4:16 PM
To: Justin Pearson
Cc: users at gecode.org
Subject: Re: [gecode-users] A rather basic quesion


On 8/16/07, Justin Pearson <Justin.Pearson at it.uu.se> wrote:
> Suppose I have a script, I know that I have to do the business with 
> the copy constructor and sharing. But suppose I set up a constraint as 
> follows (V is already copyed in the copy/sharing stuff):
>
>  BoolVar X;
>  rel(this,V,IRT_NQ,42,X);
>  eq(this,X,1);
>
> Do I have to copy X as well in the copy constructor/sharing?
>
> What happens if I don't?

There is no need to copy the temporary variables, you only need to copy
those variables that you are interested in inspecting in a solution.

The temporary variable will be maintained by the associated propagators as
long as it is needed.

Cheers,
Mikael

-- 
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