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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user