8#ifndef OPENFPM_DATA_SRC_UTIL_MATH_UTIL_COMPLEX_HPP_
9#define OPENFPM_DATA_SRC_UTIL_MATH_UTIL_COMPLEX_HPP_
12extern std::vector<int> sieve_spf;
19 #define SIEVE_MAXN 4096
26 void inline init_getFactorization()
28 sieve_spf.resize(SIEVE_MAXN);
31 for (
int i = 2; i < SIEVE_MAXN; i++)
40 for (
int i = 4; i < SIEVE_MAXN; i += 2)
43 for (
int i = 3; i*i < SIEVE_MAXN; i++)
46 if (sieve_spf[i] == i)
49 for (
int j=i*i; j < SIEVE_MAXN; j+=i)
53 if (sieve_spf[j] == j)
67 inline void getFactorization(
int x, std::vector<size_t> & ret)
72 ret.push_back(sieve_spf[x]);
convert a type into constant type