[gecode-users] Getting the domain size

Malcolm Ryan malcolmr at cse.unsw.edu.au
Fri Nov 23 04:35:23 CET 2007


Is there any efficient way of getting the domain size of an IntVarView?

Currently, I'm doing:

int min = view.min();
int max = view.max();
int size = 0;
for (int i = min; i <= max; i++) {
	if (view.in(i)) size++;
}

Also, could you please add a toString() method to IntVarView? It  
would make debugging easier.

Malcolm

--
      "Progress should mean that we are always changing the world to fit
       the vision, instead we are always changing the vision."
                - G.K.Chesterton, Orthodoxy







More information about the gecode-users mailing list