[gecode-users] Update function

Christian Schulte cschulte at kth.se
Thu Nov 7 15:20:23 CET 2013


Hi,

 

The answer to the first question is simple: because you have to! Update
updates variables during cloning g and is needed for search. Posting a
constraint as you suggest is something very different.

 

There can be no global variables in Gecode provided you mean something such
as Gecode's integer variables as they are always situated inside a given
space (this is the space you given when initializing a Gecode variable). Or
dou you mean variable as in C++-variable? Then it does not need to be
updated.

 

Maybe you would like to read the chapter on Search in MPG that explains what
happens during search in Gecode.

 

Cheers

Christian

 

--

Christian Schulte, Professor of Computer Science, KTH,
<http://www.ict.kth.se/~cschulte/> www.ict.kth.se/~cschulte/

 

 

From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Zhu Zichen's cse
Sent: Thursday, November 07, 2013 3:12 PM
To: users at gecode.org
Subject: [gecode-users] Update function

 

Dear All,

          For variables, why do we have to use update function when we
copying? Why cannot I simply use rel(*this,x==_x)? And there are problems
when I use update function to update a global variable from another global
variable. What should I do when I update global variables?

 

 

Best Regards,

Zichen Zhu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20131107/a477ef36/attachment.html>


More information about the users mailing list