[Osi] OsiClp gives wrong iteration count?
Goossens Jan-Willem
Jan-Willem.Goossens at nc3a.nato.int
Thu Jul 30 09:43:57 EDT 2009
Hi,
Either it's me, or the iteration count reported through OsiClpSolverInterface is wrong.
The following code solves a small problem:
OsiClpSolverInterface model;
int start[] = { 0, 1, 2};
int index[] = { 0, 0};
double values[] = {1.0, 2.0};
double collb[] = {0.0, 0.0};
double colub[] = {10.0, 10.0};
double obj[] = { 1.0, 1.0};
double rowlb[] = { 0.0};
double rowub[]= { 3.9};
// obj: Max x0 + x1
// st. x0 + 2 x1 <= 3.9
// 0 <= x0 <= 10 and integer
// 0 <= x1 <= 10
model.loadProblem(2, 1, start, index, values, collb, colub, obj, rowlb, rowub);
model.setObjSense(-1.0);
model.initialSolve();
std::cout << "algorithm:" << model.lastAlgorithm() << std::endl;
std::cout << "iteration count:" << model.getIterationCount() << std::endl;
The output is
Coin0506I Presolve 1 (0) rows, 2 (0) columns and 2 (0) elements
Clp0006I 0 Obj -0 Dual inf 2 (2)
Clp0006I 1 Obj 3.9
Clp0000I Optimal - objective value 3.9
Clp0032I Optimal objective 3.9 - 1 iterations time 0.012
algorithm:2
iteration count:0
So, Clp says "1 iterations", but the OsiClpSolverInterface says 0.
Is this a bug or a feature?
I'm working with the source as they come with Cbc-2.3.0..
Thanks in advance,
Jan-Willem Goossens
More information about the Osi
mailing list