18 #include "../common/helper/helper.hpp" 38 std::cerr <<
"Usage: print_path [options]" << std::endl
40 <<
"Options:" << std::endl
41 <<
" --complete check complete path until 1 (by default check only partial path until < n)" << std::endl
42 <<
" --first n first odd number to check (3 by default)" << std::endl
43 <<
" --last n last odd number to check (1000001 by default)" << std::endl
44 <<
" --nb n number of odd numbers to check" << std::endl
45 <<
" --useless check all odd numbers (by default avoid exactly divisible by 3, 7, 31 or 127)" << std::endl;
57 main(
int argc,
const char*
const argv[]) {
68 bool complete =
false;
73 for (
unsigned int i = 1; i < static_cast<unsigned int>(argc); ++i) {
74 const std::string param(argv[i]);
76 if (param ==
"--complete") {
79 else if (param ==
"--first") {
85 else if (param ==
"--last") {
91 else if (param ==
"--nb") {
94 else if (param ==
"--useless") {
107 std::cout <<
"sequential/print_path" 108 <<
"\tFirst: " << first
109 <<
"\tLast: " << last
110 <<
"\tNb: " << (first <= last
111 ? (last - first)/2 + 1
118 std::cout << std::endl
119 <<
"n\tLower\tPartial length\tPartial path";
121 std::cout <<
"\tLength\tPath";
123 std::cout << std::endl;
128 const std::chrono::steady_clock::time_point clock_start = std::chrono::steady_clock::now();
140 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.
constexpr bool is_even(nat_type n)
Return true iff n is even.
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...
int main(int argc, const char *const argv[])
Implementation of the sequential algorithms presented in the report. (Some functions are not use in t...
void print_intern_config_compiler()
Print to stdcout the intern configuration of the compiler.
unsigned long get_ulong(int argc, const char *const argv[], unsigned int i, void(*help_and_exit_function)())
Return argv[i] converted in integer.
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".