Skip to content

Commit

Permalink
for improvements? to fathomMany
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhforrest committed Jun 20, 2024
1 parent 7a9efea commit a7fe6ad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ClpNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@ ClpNodeStuff::ClpNodeStuff()
, nNodes_(0)
, numberNodesExplored_(0)
, numberIterations_(0)
, maximumIterations_(1000000)
, presolveType_(0)
#ifndef NO_FATHOM_PRINT
, startingDepth_(-1)
Expand Down Expand Up @@ -746,6 +747,7 @@ ClpNodeStuff::ClpNodeStuff(const ClpNodeStuff &rhs)
, nNodes_(rhs.nNodes_)
, numberNodesExplored_(rhs.numberNodesExplored_)
, numberIterations_(rhs.numberIterations_)
, maximumIterations_(rhs.maximumIterations_)
, presolveType_(rhs.presolveType_)
#ifndef NO_FATHOM_PRINT
, startingDepth_(rhs.startingDepth_)
Expand Down Expand Up @@ -792,6 +794,7 @@ ClpNodeStuff::operator=(const ClpNodeStuff &rhs)
nNodes_ = rhs.nNodes_;
numberNodesExplored_ = rhs.numberNodesExplored_;
numberIterations_ = rhs.numberIterations_;
maximumIterations_ = rhs.maximumIterations_;
presolveType_ = rhs.presolveType_;
#ifndef NO_FATHOM_PRINT
handler_ = rhs.handler_;
Expand Down
2 changes: 2 additions & 0 deletions src/ClpNode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ class CLPLIB_EXPORT ClpNodeStuff {
int numberNodesExplored_;
/// Number of iterations
int numberIterations_;
/// Maximum iterations
int maximumIterations_;
/// Type of presolve - 0 none, 1 crunch
int presolveType_;
#ifndef NO_FATHOM_PRINT
Expand Down
3 changes: 3 additions & 0 deletions src/ClpSimplex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12123,6 +12123,7 @@ int ClpSimplex::fathomMany(void *stuff)
assert(stuff);
ClpNodeStuff *info = reinterpret_cast< ClpNodeStuff * >(stuff);
int nNodes = info->maximumNodes();
int maximumIterations = info->maximumIterations_;
int putNode = info->maximumSpace();
int goodNodes = 0;
info->nNodes_ = 0;
Expand Down Expand Up @@ -12453,6 +12454,8 @@ int ClpSimplex::fathomMany(void *stuff)
fastDual2(info);
forceFactorization_ = save;
}
if (numberIterations>=maximumIterations)
stopAtOnce = true;
if (problemStatus_ == 1 || (problemStatus_ == 0 && objectiveValue() * optimizationDirection_ > bestObjective)) {
backtrack = true;
if (printing)
Expand Down

0 comments on commit a7fe6ad

Please sign in to comment.