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

@@ -138,9 +138,11 @@
#include "../Headers/Problem13.hpp"
std::vector<mpz_class> Problem13::nums;
Problem13::Problem13() : Problem("Work out the first ten digits of the sum of the one-hundred 50-digit numbers"), sum(0){
reserveVectors();
}
void Problem13::reserveVectors(){
//Make sure the vector is the correct size
nums.reserve(100);
nums.resize(100);
@@ -299,3 +301,10 @@ mpz_class Problem13::getSum() const{
}
return sum;
}
void Problem13::reset(){
Problem::reset();
sum = 0;
nums.clear();
reserveVectors();
}