Hi,
The update function copies once, otherwise it redirects the pointer to the created copy. This is classical idea from copying garbage collection, you could for example check Cheyney’s algorithm (Gecode uses a more specialized variant of this). Best Christian -- Christian Schulte, <http://www.gecode.org/~schulte> www.gecode.org/~schulte Professor of Computer Science, KTH, <mailto:[email protected]> [email protected] Expert Researcher, SICS, <mailto:[email protected]> [email protected] From: [email protected] [mailto:[email protected]] On Behalf Of Zhu Zichen's cse Sent: Wednesday, July 15, 2015 05:56 AM To: Christian Schulte Cc: [email protected] Subject: Re: [gecode-users] Why do we need to update variables for propagators Dear Christian, Thanks very much for your replying. I did some experiment on the BIBD(7,3,7) benchmark. I checked the profile after utilizing the two versions: one-for-each, GLOBAL_ONE. The calls of the update function cost 60.81 and 8.50 seconds by one-for-each and GLOBAL_ONE respectively. While the propagate function totally costs 5.73 and 7.64 seconds respectively. Even though GLOBAL_ONE is slower when doing filtering, it wins for the less calls of update function. A variable is really only a pointer to a variable implementation which is copied at most once. You mean no matter how many update calls of a variable during a copying, it would be copied at most once? If so, why would we need to update these variables in a copy function of propagators as we have done it in the Space copy function? Yours, Zoe
_______________________________________________ Gecode users mailing list [email protected] https://www.gecode.org/mailman/listinfo/gecode-users
