[gecode-users] Writing a Branching

Mikael Zayenz Lagerkvist zayenz at gmail.com
Thu Nov 22 07:15:29 CET 2007


On Nov 22, 2007 4:02 AM, Malcolm Ryan <malcolmr at cse.unsw.edu.au> wrote:
> Does the Branching always have to  copy the variables it is given when it
> is created? Vis:
>
>      public Naive(Space home, VarArray<IntVar> x0) {
>          x = new ViewArray<IntVarView>(home, IntVarView.class, x0);
>      }

Making IntVarView's out of variables does not copy them. Both IntView
and IntVarView are simple wrappers around pointers to the real
variable.

The general rule is that IntVar's are for modelling, while IntVarViews
are for actors. A view has methods for modifying the domain of a
variable, while a var lacks those methods.

Cheers,
Mikael

-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/




More information about the gecode-users mailing list