[Gecode] Propgator copy

Guido Tack tack at ps.uni-sb.de
Thu Feb 10 09:53:12 CET 2005


Actually, if the tree doesn't change during propagation (that is, if 
it's only created during initialization of the propagator and not 
touched afterwards), shouldn't it rather be handled like a SharedArray 
in e.g. int/element/int.icc?

Christian Schulte wrote:
> The first issue is that of course your propagator is in charge of copying,
> if needed.
> 
> Secondly, consider whether you really want to always copy! Have a look to
> int/distinct/dom.icc. There the propagator also needs a graph only during
> propagation. It maintains this graph as follows: when the propagator is
> created or copied set the graph to empty. If the propagate function is
> invoked, check whether the graph exists. If not, create it. If yes, update
> it accordingly. Upon destruction delete it, if it exists. Make sure that the
> destructor is called! This you have to do by giving a special flag to the
> propagator. Again see the above mentioned example.
> 
> All the best
> Christian 

-- 
Guido Tack
http://www.ps.uni-sb.de/~tack



More information about the gecode-users mailing list