[gecode-users] A rather basic quesion

Mikael Zayenz Lagerkvist zayenz at gmail.com
Thu Aug 16 16:15:44 CEST 2007


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/




More information about the gecode-users mailing list