Skip to content

Commit

Permalink
Merge branch 'fix-useTerminationValue-param' into 'bugfix-70'
Browse files Browse the repository at this point in the history
properly initialize useTerminationValue

See merge request integer/soplex!484
  • Loading branch information
leoneifler committed Jun 12, 2024
2 parents 3f52108 + 0704c79 commit 3544c0c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/soplex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6555,10 +6555,12 @@ bool SoPlexBase<R>::setRealParam(const RealParam param, const Real value, const

// lower limit on objective value is set in solveReal()
case SoPlexBase<R>::OBJLIMIT_LOWER:
this->_solver.toggleTerminationValue(true);
break;

// upper limit on objective value is set in solveReal()
case SoPlexBase<R>::OBJLIMIT_UPPER:
this->_solver.toggleTerminationValue(true);
break;

// working tolerance for feasibility in floating-point solver
Expand Down
4 changes: 2 additions & 2 deletions src/soplex/spxsolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ class SPxSolverBase : public SPxLPBase<R>, protected SPxBasisBase<R>
Real maxTime; ///< maximum allowed time.
int nClckSkipsLeft; ///< remaining number of times the clock can be safely skipped
long nCallsToTimelim; /// < the number of calls to the method isTimeLimitReached()
R objLimit; ///< objective value limit.
R objLimit; ///< objective value limit.
bool useTerminationValue; ///< true, if objective limit should be used in the next solve.
Status m_status; ///< status of algorithm.

R m_nonbasicValue; ///< nonbasic part of current objective value
Expand All @@ -276,7 +277,6 @@ class SPxSolverBase : public SPxLPBase<R>, protected SPxBasisBase<R>
int m_maxCycle; ///< maximum steps before cycling is detected.
int m_numCycle; ///< actual number of degenerate steps so far.
bool initialized; ///< true, if all vectors are setup.
bool useTerminationValue; /// true, if objective limit should be used in the next solve.

SSVectorBase<R>*
solveVector2; ///< when 2 systems are to be solved at a time; typically for speepest edge weights
Expand Down
3 changes: 3 additions & 0 deletions src/soplex/spxsolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,7 @@ void SPxSolverBase<R>::setType(Type tp)
, nClckSkipsLeft(0)
, nCallsToTimelim(0)
, objLimit(R(infinity))
, useTerminationValue(true)
, m_status(UNKNOWN)
, m_nonbasicValue(0.0)
, m_nonbasicValueUpToDate(false)
Expand Down Expand Up @@ -1185,6 +1186,7 @@ void SPxSolverBase<R>::setType(Type tp)
maxIters = base.maxIters;
maxTime = base.maxTime;
objLimit = base.objLimit;
useTerminationValue = base.useTerminationValue;
m_status = base.m_status;
m_nonbasicValue = base.m_nonbasicValue;
m_nonbasicValueUpToDate = base.m_nonbasicValueUpToDate;
Expand Down Expand Up @@ -1385,6 +1387,7 @@ void SPxSolverBase<R>::setType(Type tp)
, nClckSkipsLeft(base.nClckSkipsLeft)
, nCallsToTimelim(base.nCallsToTimelim)
, objLimit(base.objLimit)
, useTerminationValue(base.useTerminationValue)
, m_status(base.m_status)
, m_nonbasicValue(base.m_nonbasicValue)
, m_nonbasicValueUpToDate(base.m_nonbasicValueUpToDate)
Expand Down

0 comments on commit 3544c0c

Please sign in to comment.