Malcolm Ryan wrote:
> 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++;
> }
You could use an IntViewRanges iterator, that would be more
efficient. Version 2.0.0 will include a method size() for IntViews.
> Also, could you please add a toString() method to IntVarView? It
> would make debugging easier.
Yes, that will also be available in the next version.
Guido
_______________________________________________
Gecode users mailing list
[EMAIL PROTECTED]
https://www.gecode.org/mailman/listinfo/gecode-users