[Clp] Possible bug in setObjCoeff

Aleksandr M. Kazachkov akazachk at cmu.edu
Mon Oct 2 02:11:23 EDT 2017


Hi all, I have a possible bug report, as well as a (related) question.

1. In OsiClpSolverInterface::setObjCoeff (when setting just one
coefficient), I think (unless I am misunderstanding something, in which
case I apologize) that line 6125

  modelPtr_->whatsChanged_ &= 0xffff;

should be

  modelPtr_->whatsChanged_ &= (0xffff&~64);

same as in OsiClpSolverInterface::setObjective, as the 64 bit corresponds
to "OBJECTIVE_SAME". This was (ultimately) causing a memory corruption
error for me after I would set the objective (coefficient by coefficient,
because my objective is sparse), resolve, then delete my solver object.

2. I am working with an instance in n-dimensional space, but the majority
of these columns are empty. In my context, I will be solving the instance
repeatedly with different objective functions. The first solve is an
"initialSolve" and subsequent solves, unless some issue is encountered, are
"resolve" calls.

Is it better (faster in the long run, given the multiple resolves) to
preprocess the instance in advance to have no empty columns, or is that a
waste of time? My first thought was that it would not make much difference
since internally the matrix is kept in sparse form and anyway presolve
would catch this, but I am not sure I am right.

Thank you in advance for your input,
Aleksandr Kazachkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20171002/421612fd/attachment.html>


More information about the Clp mailing list