Skip to content

Commit

Permalink
get rid of odd valgrind error
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhforrest committed Dec 30, 2021
1 parent 33f7f22 commit cfda164
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/ClpSimplex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7621,6 +7621,17 @@ void ClpSimplex::allSlackBasis(bool resetSolution)
}
}
}
// Deletes rows (just ClpMode::deleteRows plus a bit)
void
ClpSimplex::deleteRows(int number, const int *which)
{
if (number) {
// do more if necessary
delete [] pivotVariable_;
pivotVariable_=NULL;
ClpModel::deleteRows(number,which);
}
}
/* Loads a problem (the constraints on the
rows are given by lower and upper bounds). If a pointer is 0 then the
following values are the default:
Expand Down Expand Up @@ -9221,7 +9232,7 @@ int ClpSimplex::startup(int ifValuesPass, int startFinishOptions)
if ((startFinishOptions & 1) != 0) {
// User may expect user data - fill in as required
if (numberRows_) {
if (!pivotVariable_)
if (!pivotVariable_)
pivotVariable_ = new int[numberRows_];
CoinIotaN(pivotVariable_, numberRows_, numberColumns_);
}
Expand Down
2 changes: 2 additions & 0 deletions src/ClpSimplex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,8 @@ class CLPLIB_EXPORT ClpSimplex : public ClpModel {
mutable int spareIntArray_[4];
/// Spare double array for passing information [0]!=0 switches on
mutable double spareDoubleArray_[4];
/// Deletes rows (just ClpMode::deleteRows plus a bit)
void deleteRows(int number, const int *which);

protected:
/// Allow OsiClp certain perks
Expand Down

0 comments on commit cfda164

Please sign in to comment.