Loading [MathJax]/extensions/tex2jax.js
Parallel numerical verification of the σ_odd problem  October 6, 2018
All Classes Namespaces Files Functions Variables Typedefs Macros
Namespaces | Typedefs | Functions | Variables
helper.hpp File Reference

Define type and some generic functions. More...

#include "helper__inline.hpp"
Include dependency graph for helper.hpp:

Go to the source code of this file.

Namespaces

 sigmaodd
 A lot of functions and stuffs to deal the sigma_odd problem and related stuffs.
 

Typedefs

typedef uint64_t sigmaodd::nat_type
 Type for natural number used in all code, on 64 bits. More...
 
typedef unsigned __int128 sigmaodd::tmp_uint128_type
 Type double size for some temporary calculation. More...
 

Functions

nat_type sigmaodd::ceil_eighth_root (nat_type n)
 Return the eighth root of n rounded to above. More...
 
nat_type sigmaodd::ceilx_fourth_root (nat_type n)
 Return the fourth root of n rounded to above. More...
 
nat_type sigmaodd::ceil_square_root (nat_type n)
 Return the square root of n rounded to above. More...
 
nat_type sigmaodd::floor_eighth_root (nat_type n)
 Return the eighth root of n rounded to below. More...
 
nat_type sigmaodd::floor_fourth_root (nat_type n)
 Return the fourth root of n rounded to below. More...
 
nat_type sigmaodd::floor_square_root (nat_type n)
 Return the square root of n rounded to below. More...
 
constexpr bool sigmaodd::is_even (nat_type n)
 Return true iff n is even. More...
 
constexpr bool sigmaodd::is_odd (nat_type n)
 Return true iff n is odd. More...
 
std::vector< nat_typesigmaodd::load_bad_table (const std::string &filename, const std::vector< nat_type > &bad_table=std::vector< nat_type >())
 Read a file that contains list of bad numbers, add after bad_table, and return the result. More...
 
std::vector< nat_typesigmaodd::load_numbers (const std::string &filename)
 Read the file and extract each natural number begining a line. Return the list of these numbers. More...
 
constexpr nat_type sigmaodd::pow_nat (nat_type n, unsigned int k)
 Return x^k, x power k. More...
 
constexpr double sigmaodd::square (double x)
 Return x*x. More...
 
constexpr nat_type sigmaodd::square (nat_type n)
 Return n*n. More...
 
constexpr nat_type sigmaodd::sum_even (nat_type n)
 Return 2 + 4 + 6 + 8 + ... + (n or n-1) = k(k + 1) with k = floor(n/2). More...
 
constexpr nat_type sigmaodd::sum_geometric_progression (nat_type r, unsigned int k)
 Return the sum of the (k + 1) terms of the geometric progression of the common ratio r. More...
 
constexpr nat_type sigmaodd::sum_geometric_progression_strict (nat_type r, unsigned int k)
 Return sum_geometric_progression(r, k) but only for r > 1. More...
 
constexpr nat_type sigmaodd::sum_natural (nat_type n)
 Return 1 + 2 + 3 + 4 + ... + n = n(n + 1)/2. More...
 
constexpr nat_type sigmaodd::sum_odd (nat_type n)
 Return 1 + 3 + 5 + 7 + ... + (n or n-1) = k^2 with k floor((n+1)/2). More...
 

Variables

constexpr nat_type sigmaodd::MAX_POSSIBLE_N = (static_cast<nat_type>(1) << 56) - 1
 Lower bound of the bigger number such that it is possible to compute the result of the sigma function. More...
 

Detailed Description

Define type and some generic functions.

(January 6, 2018) GPLv3 — Copyright (C) 2017, 2018 Olivier Pirson http://www.opimedia.be/

Definition in file helper.hpp.