Skip to content
Snippets Groups Projects
Commit 7cbe5a66 authored by timeo's avatar timeo
Browse files

Test des valeurs du SA, valeurs étranges

parent 29421c31
No related branches found
No related tags found
No related merge requests found
......@@ -319,113 +319,12 @@ void ecrireSommeCentre(){
}
int main(){
//parseFile("testfiles/100000fromCorrect.txt");
/*sommeAdditive();
nbAdditifsAvecSansOpenMP();*/
ofstream flux("tempsExecInterne.csv");
for (int i = 0; i < 6; i++){
std::cout << "Tir " << i << std::endl;
parseFile("testfiles/5000fromCorrect.txt");
sommeAdditive();
#ifdef CHRONO
high_resolution_clock::time_point t1 = high_resolution_clock::now();
#endif
//std::cout << std::endl << nbAdditif() << std::endl;
std::cout << "5 000 char" << std::endl;
std::cout << nbAdditifWithSommeOpenMp(8) << std::endl;
#ifdef CHRONO
high_resolution_clock::time_point t2 = high_resolution_clock::now();
duration<double> time_span = duration_cast<duration<double>>(t2 - t1);
flux << "5000," << time_span.count() << std::endl;
std::cout << "Durée :" << time_span.count() << " secondes" << std::endl << std::endl;
#endif
parseFile("testfiles/10000fromCorrect.txt");
sommeAdditive();
#ifdef CHRONO
t1 = high_resolution_clock::now();
#endif
//std::cout << std::endl << nbAdditif() << std::endl;
std::cout << "10 000 char" << std::endl;
std::cout << nbAdditifWithSommeOpenMp(8) << std::endl;
#ifdef CHRONO
t2 = high_resolution_clock::now();
time_span = duration_cast<duration<double>>(t2 - t1);
flux << "10000," << time_span.count() << std::endl;
std::cout << "Durée :" << time_span.count() << " secondes" << std::endl << std::endl;
#endif
parseFile("testfiles/50000fromCorrect.txt");
sommeAdditive();
#ifdef CHRONO
t1 = high_resolution_clock::now();
#endif
//std::cout << std::endl << nbAdditif() << std::endl;
std::cout << "50 000 char" << std::endl;
std::cout << nbAdditifWithSommeOpenMp(8) << std::endl;
#ifdef CHRONO
t2 = high_resolution_clock::now();
time_span = duration_cast<duration<double>>(t2 - t1);
flux << "50000," << time_span.count() << std::endl;
std::cout << "Durée :" << time_span.count() << " secondes" << std::endl << std::endl;
#endif
parseFile("testfiles/100000fromCorrect.txt");
sommeAdditive();
#ifdef CHRONO
t1 = high_resolution_clock::now();
#endif
//std::cout << std::endl << nbAdditif() << std::endl;
std::cout << "100 000 char" << std::endl;
std::cout << nbAdditifWithSommeOpenMp(8) << std::endl;
#ifdef CHRONO
t2 = high_resolution_clock::now();
time_span = duration_cast<duration<double>>(t2 - t1);
flux << "100000," << time_span.count() << std::endl;
std::cout << "Durée :" << time_span.count() << " secondes" << std::endl << std::endl;
#endif
parseFile("testfiles/500000fromCorrect.txt");
sommeAdditive();
#ifdef CHRONO
t1 = high_resolution_clock::now();
#endif
//std::cout << std::endl << nbAdditif() << std::endl;
std::cout << "500 000 char" << std::endl;
std::cout << nbAdditifWithSommeOpenMp(8) << std::endl;
#ifdef CHRONO
t2 = high_resolution_clock::now();
time_span = duration_cast<duration<double>>(t2 - t1);
flux << "500000," << time_span.count() << std::endl;
std::cout << "Durée :" << time_span.count() << " secondes" << std::endl << std::endl;
#endif
parseFile("testfiles/1000000fromCorrect.txt");
sommeAdditive();
#ifdef CHRONO
t1 = high_resolution_clock::now();
#endif
//std::cout << std::endl << nbAdditif() << std::endl;
std::cout << " 1 000 000 char" << std::endl;
std::cout << nbAdditifWithSommeOpenMp(8) << std::endl;
#ifdef CHRONO
t2 = high_resolution_clock::now();
time_span = duration_cast<duration<double>>(t2 - t1);
flux << "1000000," << time_span.count() << std::endl;
std::cout << "Durée :" << time_span.count() << " secondes" << std::endl << std::endl;
#endif
}
parseFile("testfiles/100000fromCorrect.txt");
sommeAdditive();
// ecrireSommeCentre();
/*int32_t* T = new int32_t[fichier.size() + 1];
int32_t* T = new int32_t[fichier.size() + 1];
for (int i = 0; i < fichier.size() + 2; i++){
T[i] = sommeAdditiveArray[i];
}
......@@ -434,8 +333,12 @@ int main(){
int32_t k = maxi - mini;
std::cout << "k : " << k << " maxi : " << maxi << " mini : " << mini << std::endl;
// std::cout << libsais_int(T, SA, 70880000, k, fs) << std::endl;*/
std::cout << libsais_int(T, SA, 100000, k, fs) << std::endl;
for (int i = 0; i < 100000; i++){
if (SA[i] != 0)
std::cout << "Entrée : " << T[i] << " Suffix Array : " << SA[i] << std::endl;
}
// free(T);
// free(SA);
free(T);
free(SA);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment