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