mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Added a benchmark tool
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user