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-boun...@gecode.org [mailto:users-boun...@gecode.org] On Behalf Of Zhu Zichen's cse Sent: Thursday, November 07, 2013 3:12 PM To: users@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
_______________________________________________ Gecode users mailing list users@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users