18 #include "../common/helper/helper.hpp" 19 #include "../common/sigmaodd/divisors.hpp" 48 std::cerr <<
"Usage: check_multiplicativity [options]" << std::endl
50 <<
"Options:" << std::endl
51 <<
" --first n first odd number to check (" <<
first_default <<
" by default)" << std::endl
52 <<
" --last n last odd number to check (" <<
last_default <<
" by default)" << std::endl;
64 main(
int argc,
const char*
const argv[]) {
77 for (
unsigned int i = 1; i < static_cast<unsigned int>(argc); ++i) {
78 const std::string param(argv[i]);
80 if (param ==
"--first") {
86 else if (param ==
"--last") {
102 std::cout <<
"sequential/check_multiplicativity" 103 <<
"\tFirst: " << first
104 <<
"\tLast: " << last << std::endl;
109 const std::chrono::steady_clock::time_point clock_start = std::chrono::steady_clock::now();
114 std::cout << a << std::endl;
127 if (varsigma_odd_ab == varsigma_odd_a*varsigma_odd_b) {
128 std::cout <<
"Exception found! a b: " << a*b <<
'=' << a <<
'*' << b <<
'\t' 130 <<
"varsigma_odd: " << varsigma_odd_ab
131 <<
'=' << varsigma_odd_a <<
'*' << varsigma_odd_b << std::endl;
138 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".
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...
const sigmaodd::nat_type first_default
int main(int argc, const char *const argv[])
constexpr nat_type gcd(nat_type a, nat_type b)
Return the Greatest Common Divisor of a and b.
Implementation of the sequential algorithms presented in the report. (Some functions are not use in t...
const sigmaodd::nat_type last_default
void print_intern_config_compiler()
Print to stdcout the intern configuration of the compiler.
nat_type sequential_varsigma_odd(nat_type n)
Return varsigma_odd(n), i.e. the sum of all odd divisors of n, divided by 2 until to be odd...
unsigned long get_ulong(int argc, const char *const argv[], unsigned int i, void(*help_and_exit_function)())
Return argv[i] converted in integer.