[gecode-users] strange behaviour of SetVarArray

Stefano Gualandi gualandi at elet.polimi.it
Tue Mar 3 18:15:51 CET 2009


Hi,
there is a strange behavior of one of the SetVarArray constructors, in  
the trunk version.
In practice, if you try to define an array of set variables as follows:

     x ( *this, 4, IntSet::empty, 2, 4, 0, 4 )

it raises an exception, since it fails the test in the file gecode/set/ 
array.cpp at lines 84-85:

84:    if (minCard > maxCard || minCard > lubSize || maxCard < glbSize  
||
85:        glb.min() < ubMin || glb.max() > ubMax)

The point is that glb.min() of an empty set is 1 (?).
Commenting the line 85 seems to fix the problem, but I don't know if  
it breaks some other assumption.

You can find attached the smallest example the show the *behavior*.

cheers,
Stefano


-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cpp
Type: application/octet-stream
Size: 1008 bytes
Desc: not available
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20090303/17185b13/attachment.obj>
-------------- next part --------------



More information about the gecode-users mailing list