Refactored to make benchmark part of the main program

This commit is contained in:
2020-07-09 00:00:33 -04:00
parent 89bb42d4d9
commit 6f55685f48
5 changed files with 73 additions and 68 deletions

View File

@@ -8,9 +8,9 @@
#include <iostream>
#include <vector>
#include "benchmark.hpp"
#include "Algorithms.hpp"
#include "Headers/Problem.hpp"
#include "Problems.hpp"
#include "ProblemSelection.hpp"
@@ -27,7 +27,7 @@ unsigned int getProblemNumber(); //A helper function to error check the problem
void listProblems(); //Lists the problem numbers that you can choose
//Setup the menu options
enum MenuOptions {SOLVE = 1, DESCRIPTION, LIST, EXIT, SIZE};
enum MenuOptions {SOLVE = 1, DESCRIPTION, LIST, BENCHMARK, EXIT, SIZE};
int main(){
int selection = 0; //Holds the menu selection of the user
@@ -37,10 +37,11 @@ int main(){
selection = getMenuSelection();
switch(selection){
case SOLVE : solveMenu(); break;
case DESCRIPTION : descriptionMenu(); break;
case LIST : listProblems(); break;
case EXIT : break;
case MenuOptions::SOLVE : solveMenu(); break;
case MenuOptions::DESCRIPTION : descriptionMenu(); break;
case MenuOptions::LIST : listProblems(); break;
case MenuOptions::BENCHMARK : benchmarkMenu(); break;
case MenuOptions::EXIT : break;
}
}while(selection != EXIT);
@@ -51,7 +52,8 @@ void printMenu(){
std::cout << "1. Solve a problem\n"
<< "2. Print a problem description\n"
<< "3. List valid problem numbers\n"
<< "4. Exit" << std::endl;
<< "4. Benchmark\n"
<< "5. Exit" << std::endl;
}
int getMenuSelection(){