[gecode-users] Value intersection problem

Anden blah 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>& )

    vector<string> v;  

    for(set<string>::const_iterator setIt = values.begin(); setIt!= values.end(); setIt++)
    for(int i=0;i<v.size();i++)
      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...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20090123/8136dcc8/attachment.htm>

More information about the gecode-users mailing list