From 8835b95719cb072519a66d16599141eab8d592ca Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 3 Feb 2022 16:26:41 +0100 Subject: [PATCH] comment --- libsolutil/LP.cpp | 3 +++ libsolutil/LP.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/libsolutil/LP.cpp b/libsolutil/LP.cpp index 640d30334..c6d3915fe 100644 --- a/libsolutil/LP.cpp +++ b/libsolutil/LP.cpp @@ -760,6 +760,9 @@ pair> LPSolver::check(SolvingState _state) LPResult lpResult; vector solution; + // TODO this actually compares including the variable names. + // If we only compare based on coefficients, we will get way more cache hits. + // The downside is that we need to adjust the model. auto it = m_cache.find(split); if (it != m_cache.end()) tie(lpResult, solution) = it->second; diff --git a/libsolutil/LP.h b/libsolutil/LP.h index 22cfea036..9fb0ef943 100644 --- a/libsolutil/LP.h +++ b/libsolutil/LP.h @@ -161,6 +161,8 @@ public: private: // TODO check if the model is requested in production. If not, we do not need to cache it. + // TODO This cache is inefficient because it compares including the variable names. + // See comment in LPSolver::check for details. std::map>>> m_cache; };