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

@@ -35,6 +35,10 @@
int Problem23::MAX_NUM = 28123;
Problem23::Problem23() : Problem("Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers"), sum(0){
reserveVectors();
}
void Problem23::reserveVectors(){
//This makes sure the vector is the correct size
divisorSums.reserve(MAX_NUM);
divisorSums.resize(MAX_NUM);
@@ -116,3 +120,10 @@ uint64_t Problem23::getSum() const{
}
return sum;
}
void Problem23::reset(){
Problem::reset();
sum = 0;
divisorSums.clear();
reserveVectors();
}