19 #include "../common/helper/helper.hpp" 39 std::cerr <<
"Usage: check_load [options] filename" << std::endl
41 <<
"Options:" << std::endl
42 <<
" --complete check complete path until 1 (by default check only partial path until < n)" << std::endl
43 <<
" --print-all print all checked number (by default only bad number are printed)" << std::endl
44 <<
" --useless check all odd numbers (only with --complete option, by default avoid exactly divisible by 3, 7, 31 or 127)" << std::endl;
56 main(
int argc,
const char*
const argv[]) {
65 bool complete =
false;
67 bool print_all =
false;
72 for (
unsigned int i = 1; i < static_cast<unsigned int>(argc); ++i) {
73 const std::string param(argv[i]);
75 if (param ==
"--complete") {
78 else if (param ==
"--print-all") {
81 else if (param ==
"--useless") {
84 else if (i < static_cast<unsigned int>(argc)) {
92 if (filename.empty()) {
106 std::cout <<
"sequential/check_load" 107 <<
"\tFilename: " << filename
108 <<
"\tNb: " << list.size()
114 std::cout << std::endl;
117 std::cout << std::endl
118 <<
"n\tLower\tPartial length\tPartial path";
120 std::cout <<
"\tLength\tPath";
122 std::cout << std::endl;
127 const std::chrono::steady_clock::time_point clock_start = std::chrono::steady_clock::now();
139 std::chrono::duration<double> duration = std::chrono::steady_clock::now() - clock_start;
uint64_t nat_type
Type for natural number used in all code, on 64 bits.
const std::string prime_filename
Default filename for the binary file "big_data/prime28.bin".
void sequential_check_varsigma_odd_complete(nat_type first_n, nat_type last_n, bool check_useless, bool print_bad, bool print_all, bool print_category, bool print_lower, bool print_length, bool print_path)
Check completely (until 1) in the order all odd numbers between first_n and last_n. The consequence of the result is that: all odd numbers checked between first_n and last_n (included) respect the conjecture.
int main(int argc, const char *const argv[])
std::string duration_to_string(std::chrono::duration< double > duration_second)
Return a string with the duration expressed in milliseconds, seconds, minutes and hours...
bool read_primes_table()
Read the binary file prime_filename to fill the table with all primes < 2^28. This table must be read...
Implementation of the sequential algorithms presented in the report. (Some functions are not use in t...
std::vector< nat_type > load_numbers(const std::string &filename)
Read the file and extract each natural number begining a line. Return the list of these numbers...
void print_intern_config_compiler()
Print to stdcout the intern configuration of the compiler.
void sequential_check_varsigma_odd(nat_type first_n, nat_type last_n, bool print_bad, bool print_all, bool print_category, bool print_lower, bool print_length, bool print_path)
Check in the order all odd numbers between first_n and last_n. The consequence of the result is that:...
std::string to_string(bool b)
Return the string "true" if b, else "false".