Added a benchmark tool

This commit is contained in:
2020-07-08 20:38:37 -04:00
parent a7d960c3b1
commit 766af92f1a
68 changed files with 546 additions and 134 deletions

View File

@@ -402,6 +402,10 @@ std::vector<std::string> Problem22::names = { "MARY","PATRICIA","LINDA","BARBARA
"HAI","ELDEN","DORSEY","DARELL","BRODERICK","ALONSO"};
Problem22::Problem22() : Problem("What is the total of all the name scores in the file?"){
reserveVectors();
}
void Problem22::reserveVectors(){
//Make sure the vector is the right size
sums.reserve(names.size());
sums.resize(names.size());
@@ -468,3 +472,10 @@ uint64_t Problem22::getNameScoreSum() const{
}
return mee::getSum(prod);
}
void Problem22::reset(){
Problem::reset();
sums.clear();
prod.clear();
reserveVectors();
}