From: Thierry P. <thi...@em...> - 2007-05-30 15:46:10
|
Hello, With the choco_1_2_04.jar archive, choco.integer.constraints.TimesXYZ has a strange behavior with large domains. This code: public class TestTimesXYZ { public static void testTimesXYZ(int n) { Problem pb = new Problem(); IntDomainVar[] c = new IntDomainVar[2]; c[0] = pb.makeBoundIntVar("a", 1, n); c[1] = pb.makeBoundIntVar("b", 1, n); IntDomainVar ab = pb.makeBoundIntVar("ab", 1, n); pb.post(new TimesXYZ(c[0],c[1],ab)); pb.solve(); if(pb.getSolver().getNbSolutions()>0) { System.out.println(c[0] + ", " + c[1]); } else { System.out.println("no solution"); } } public static void main(String[] args) { testTimesXYZ(103621); testTimesXYZ(103622); } } displays: a:1, b:1 no solution Thanks, Thierry. |