[Osi] OsiClp gives wrong iteration count?
John J Forrest
jjforre at us.ibm.com
Fri Jul 31 09:35:20 EDT 2009
Jan-Willem,
It is a bug which crept in. I was trying to get a more accurate count in
the case when OsiClp does two solves (e.g. dual followed by primal) and
missed out a line. Can occur in initialSolve from an all slack basis.
John
From: Goossens Jan-Willem <Jan-Willem.Goossens at nc3a.nato.int>
To: osi <osi at list.coin-or.org>
Cc: "Goossens Jan-Willem \[Internet\]" <Jan-Willem.Goossens at nc3a.nato.int>
Date: 07/30/2009 09:45 AM
Subject: [Osi] OsiClp gives wrong iteration count?
Sent by: osi-bounces at list.coin-or.org
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
_______________________________________________
Osi mailing list
Osi at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/osi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/osi/attachments/20090731/32dbeed9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/osi/attachments/20090731/32dbeed9/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/osi/attachments/20090731/32dbeed9/attachment-0001.gif>
More information about the Osi
mailing list