[gecode-users] Value intersection problem
anden_blah at hotmail.com
Fri Jan 23 16:44:19 CET 2009
I am trying to restrict the values of an IntView by doing the following:
...(values is given as parameter for the method containing this code, the type is const set<string>& )
for(set<string>::const_iterator setIt = values.begin(); setIt!= values.end(); setIt++)
restrictedDoms[i] = atoi(v[i].c_str());
Gecode::Iter::Values::Array restrictIterator(restrictedDoms, v.size());
return iv.inter_v(homeFZ, restrictIterator, false);
I can inspect the code and see that the values contained in "restrictedDoms" are the values 1 to 10. Furthermore I can see that iv.size() is 10 (values 1 to 10) before the call to inter_v (and unassigned of course). Then after the call to inter_v, iv is assigned, and I can see that the value it is assigned to is the first value in the restrictedDoms array.
So what am I doing wrong?
p.s. Of course it is useless to intersect a variable with domain 1 to 10 with the values 1 to 10, but still the behavior is unexpected.
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gecode-users