diff --git a/libsolutil/LP.cpp b/libsolutil/LP.cpp index fa0187a99..36deb7bc9 100644 --- a/libsolutil/LP.cpp +++ b/libsolutil/LP.cpp @@ -815,7 +815,7 @@ LPResult LPSolver::setState(SolvingState _state) // We do not need to store reasons because at this point, we do not have any reasons yet. // We can add this and just need to store the reasons together with the variables. - m_fixedVariables = std::get(modelOrReasonSet); + m_fixedVariables = make_shared>(std::get>(modelOrReasonSet)); //cout << "Splitting..." << endl; ProblemSplitter splitter(*m_state); @@ -848,11 +848,11 @@ void LPSolver::addConstraint(Constraint _constraint) for (auto const& [index, entry]: _constraint.data.enumerateTail()) if (entry) { - if (m_fixedVariables.count(index)) + if (m_fixedVariables->count(index)) { // This can directly lead to a conflict. We will check it later during the // simplify run on the split problems. - _constraint.data[0] -= _constraint.data[index] * m_fixedVariables.at(index); + _constraint.data[0] -= _constraint.data[index] * m_fixedVariables->at(index); _constraint.data[index] = {}; } else if (m_subProblemsPerVariable[index] != static_cast(-1)) diff --git a/libsolutil/LP.h b/libsolutil/LP.h index 31a600edb..8e544e544 100644 --- a/libsolutil/LP.h +++ b/libsolutil/LP.h @@ -284,7 +284,7 @@ private: SolvingState stateFromSubProblem(size_t _index) const; ReasonSet reasonSetForSubProblem(SubProblem const& _subProblem); - std::map m_fixedVariables; + std::shared_ptr> m_fixedVariables; /// These use "copy on write". std::vector> m_subProblems; std::vector m_subProblemsPerVariable;