Skip to content
Snippets Groups Projects
Commit 777e33e8 authored by timeo's avatar timeo
Browse files

Affichage de la différence d'appel au tableau de somme entre vérification...

Affichage de la différence d'appel au tableau de somme entre vérification normale et vérification par le tableau des suffixes
parent bf5f1cfb
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ string fichier; ...@@ -20,6 +20,7 @@ string fichier;
int32_t* sommeAdditiveArray; int32_t* sommeAdditiveArray;
SuffixTree *arbre; SuffixTree *arbre;
int32_t maxi = 0; int32_t maxi = 0;
int32_t compteur_somme = 0;
void parseFile(string namefile) // Enregitrement du fichier dans une variable void parseFile(string namefile) // Enregitrement du fichier dans une variable
...@@ -97,6 +98,7 @@ void sommeAdditiveCentre(){ ...@@ -97,6 +98,7 @@ void sommeAdditiveCentre(){
* Bloc délimité par son indice de début et de fin dans la string * Bloc délimité par son indice de début et de fin dans la string
*/ */
inline int valeurBloc(int debutBloc, int finBloc){ inline int valeurBloc(int debutBloc, int finBloc){
compteur_somme++;
return (sommeAdditiveArray[finBloc+1] - sommeAdditiveArray[debutBloc]); return (sommeAdditiveArray[finBloc+1] - sommeAdditiveArray[debutBloc]);
} }
...@@ -503,6 +505,15 @@ int main(){ ...@@ -503,6 +505,15 @@ int main(){
high_resolution_clock::time_point t1 = high_resolution_clock::now(); high_resolution_clock::time_point t1 = high_resolution_clock::now();
std::cout << std::endl << nbAdditifWithSomme() << std::endl; std::cout << std::endl << nbAdditifWithSomme() << std::endl;
int32_t compteur_somme_sans_arbre = compteur_somme;
compteur_somme = 0;
std::cout << std::endl << nbAdditifSuffixTree() << std::endl;
std::cout << "Différence appel : " << compteur_somme_sans_arbre - compteur_somme << std::endl;
float pourcentage = (1 - ((float) compteur_somme / (float) compteur_somme_sans_arbre)) * 100;
std::cout << "Pourcentage différence " << pourcentage << std::endl;
high_resolution_clock::time_point t2 = high_resolution_clock::now(); high_resolution_clock::time_point t2 = high_resolution_clock::now();
duration<double> time_span = duration_cast<duration<double>>(t2 - t1); duration<double> time_span = duration_cast<duration<double>>(t2 - t1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment