1 #ifndef LIBJMMCG_CORE_FACTORING_HPP
2 #define LIBJMMCG_CORE_FACTORING_HPP
43 assert(x>collection_type::value_type{});
44 std::set<collection_type::value_type> factors;
45 collection_type::value_type count=1lu, tst_divs=2lu, n=x;
56 count++&1 ? (tst_divs+=2) : (tst_divs+=4);
57 if ((count>8) && (!(tst_divs%5) || !(tst_divs%7))) {
58 count++&1 ? (tst_divs+=2) : (tst_divs+=4);
63 return collection_type{factors.begin(), factors.end()};
66 factors.insert(tst_divs);
70 return collection_type{factors.begin(), factors.end()};
86 collection_type factors;
87 collection_type::value_type x=5, x_=2, k=1, l=1, n=y, g;
90 factors.emplace_back(n);
94 if ((g=euclid::gcd((x_-x),n))==1) {
96 }
else if ((g=n)!=0) {