Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 21231a3a authored by Valentin Touzeau's avatar Valentin Touzeau Committed by EXT Valentin Touzeau
Browse files

Removes useless old code

parent 5f5d54bc
......@@ -4,9 +4,10 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
set(PLUGIN "exactlru") # plugin name
set(NAMESPACE "") # namespace
set(SOURCES "src/exactlru.cpp"
"src/Generator.cpp"
"src/MayAnalysis/MayAnalysis.cpp"
"src/MustAnalysis/MustAnalysis.cpp"
"src/MayAnalysis/GlobalMayAnalysis.cpp"
"src/MustAnalysis/GlobalMustAnalysis.cpp"
"src/ClassificationBuilder.cpp"
"src/ZDD/ZDD.cpp"
"src/ZDD/ZDDManager.cpp"
......
#include <exactlru/Generator.h>
namespace exactlru
{
Generator::Generator(const Block* focus,
unsigned int ways,
bool focusEvicted) :
_focus(focus),
_ways(ways),
_focusEvicted(focusEvicted),
_youngerBlocks(BlockSet())
{
}
void Generator::update(const Block* block)
{
ASSERT(block != nullptr);
if(block == _focus) {
_focusEvicted = false;
_youngerBlocks.clear();
return;
}
if(_youngerBlocks.find(block) != _youngerBlocks.end())
return;
if(_youngerBlocks.size() == _ways - 1) {
_focusEvicted = true;
_youngerBlocks.clear();
return;
}
if(_focusEvicted) {
return;
}
_youngerBlocks.insert(block);
}
bool Generator::contains(const Generator& generator) const
{
if(_focusEvicted)
return true;
if(generator._focusEvicted)
return false;
if(_youngerBlocks.size() < generator._youngerBlocks.size())
return false;
for(const auto& e : generator._youngerBlocks) {
if(!contains(e))
return false;
}
return true;
}
} // namepsace exactlru
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment