Skip to content

Commit

Permalink
allow startFinisOptions in barrier
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhforrest committed Dec 11, 2022
1 parent 5f42a5f commit 922a76f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/ClpSimplex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6446,7 +6446,7 @@ int ClpSimplex::reducedGradient(int phase)
#include "ClpPresolve.hpp"
/* Solves using barrier (assumes you have good cholesky factor code).
Does crossover to simplex if asked*/
int ClpSimplex::barrier(bool crossover)
int ClpSimplex::barrier(bool crossover, int startFinishOptions)
{
ClpSimplex *model2 = this;
int savePerturbation = perturbation_;
Expand Down Expand Up @@ -6681,12 +6681,12 @@ int ClpSimplex::barrier(bool crossover)
// model2->setObjectiveScale(1.0e-3);
// model2->primal(2);
// model2->setObjectiveScale(saveScale);
model2->primal(1);
model2->primal(1,startFinishOptions);
} else if (barrierStatus == 4 && crossover) {
// memory problems
model2->setPerturbation(savePerturbation);
model2->createStatus();
model2->dual();
model2->dual(0,startFinishOptions);
}
model2->setMaximumIterations(saveMaxIts);
delete[] rowPrimal;
Expand All @@ -6705,7 +6705,7 @@ int ClpSimplex::barrier(bool crossover)
CoinMemcpyN(saveUpper, numberColumns, model2->columnUpper());
CoinMemcpyN(saveUpper + numberColumns, numberRows, model2->rowUpper());
delete[] saveUpper;
model2->primal(1);
model2->primal(1,startFinishOptions);
}
model2->setPerturbation(savePerturbation);
return model2->status();
Expand Down
5 changes: 3 additions & 2 deletions src/ClpSimplex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,9 @@ class CLPLIB_EXPORT ClpSimplex : public ClpModel {
int nonlinearSLP(int numberConstraints, ClpConstraint **constraints,
int numberPasses, double deltaTolerance);
/** Solves using barrier (assumes you have good cholesky factor code).
Does crossover to simplex if asked*/
int barrier(bool crossover = true);
Does crossover to simplex if asked.
startFinishOptions as dual/primal */
int barrier(bool crossover = true, int startFinishOptions = 0);
/** Solves non-linear using reduced gradient. Phase = 0 get feasible,
=1 use solution */
int reducedGradient(int phase = 0);
Expand Down

0 comments on commit 922a76f

Please sign in to comment.