[gecode-users] empty array with argmin (and min)

Kish Shen kisshen at cisco.com
Fri Jun 26 20:25:25 CEST 2015


Hi,

argmin throws an exception when the array is empty, which surprised me. 
I expected the constraint to fail, because for an empty array, the index 
for the minimum does not exist, i.e. the index has an empty domain, 
which should mean failure.

It seems that min also throws an exception for an empty array. and 
although it looks less clear-cut in this case, it still seem more 
logical to me that min should also fail rather than throw an exception.
I guess you might not want to do this with min as it will mean that 
IntExpr might fail, but argmin cannot occur in IntExpr.

To me, it seems reasonable that the user may want to call these 
constraints with an empty array -- the array may be generated from data, 
and finding no variables seems a reasonable possibility.

Cheers,

Kish



More information about the users mailing list