Paul,
Thanks. I was unaware of the existence of CPX_BIGINT. There is still something odd about this. I ran the following in CP Optimizer 22.1.1:
IloCP model = new IloCP();
IloIntVar v = model.intVar(0, Integer.MAX_VALUE);
model.addMaximize(v);
if (model.solve()) {
System.out.println((long) model.getValue(v));
}
It runs without any errors and outputs 2147483647, which is the value of Integer.MAX_VALUE. So I'm confused why CPO, which deals with explicit integers, can go that high while CPLEX (where everything internally is double precision) cannot.
Paul
------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
------------------------------
Original Message:
Sent: Thu July 13, 2023 11:30 AM
From: Paul Shaw
Subject: Bug in CPLEX 22.1.1 (Java API)
Paul,
The value of Integer.MAX_VALUE is actually too big for CPLEX. The value can be at most 2100000000 (https://www.ibm.com/docs/en/icos/22.1.1?topic=api-cpx-bigint).
I hope that this can unblock your development.
Regards,
Paul
------------------------------
Paul Shaw
------------------------------
Original Message:
Sent: Wed July 12, 2023 11:40 AM
From: Paul Rubin
Subject: Bug in CPLEX 22.1.1 (Java API)
Reposting because the uploaded file does not seem to be attached to my previous response.
------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
Original Message:
Sent: Wed July 12, 2023 11:37 AM
From: Paul Rubin
Subject: Bug in CPLEX 22.1.1 (Java API)
Philippe,
I've attached a zip file. In it is a Java package containing three files: the main class (which sets the problem data and runs the problem); the scenario class (which holds and dispenses problem data); and the class containing the IP model. You'll find some lines commented out where I tried different combinations of things. For instance, in IP.java around line 55 you'll see one line (commented out) that uses Double.MAX_VALUE as an upper bound and another (active) that uses Integer.MAX_VALUE.
The built in scenario is one that produces the error message, and I've included my output log. The IP model is solved repeated for a series of scenarios, and the error does not manifest until around the 75th scenario.
Hope this helps,
Paul
------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
Original Message:
Sent: Wed July 12, 2023 09:39 AM
From: Philippe Refalo
Subject: Bug in CPLEX 22.1.1 (Java API)
Hi Paul, yes this look like a bug.
Can you send us or post here a code that creates the problem ?
Thanks.
Philippe
------------------------------
Philippe Refalo
IBM ILOG CP Optimizer