1 #ifndef LAS_COFAC_STANDALONE_HPP_ 2 #define LAS_COFAC_STANDALONE_HPP_ 3 4 #include <cstdio> // for FILE, size_t 5 #include <array> // for array 6 #include <cstdint> // for uint8_t, int64_t, uint64_t 7 #include <vector> // for vector 8 #include <gmp.h> // mpz_even_p // IWYU pragma: keep 9 #include "cxx_mpz.hpp" 10 #include "ecm/batch.hpp" // for cofac_list 11 #include "las-divide-primes.hpp" // for factor_list_t 12 #include "relation.hpp" // for relation 13 class nfs_work_cofac; // IWYU pragma: keep 14 struct las_todo_entry; // IWYU pragma: keep 15 struct qlattice_basis; // IWYU pragma: keep 16 template <typename T> struct lock_guarded_container; // IWYU pragma: keep 17 18 struct cofac_standalone { 19 std::array<uint8_t, 2> S; 20 std::array<cxx_mpz, 2> norm; 21 std::array<factor_list_t, 2> factors; 22 std::array<std::vector<cxx_mpz>, 2> lps; 23 int64_t a; 24 uint64_t b; 25 #ifdef SUPPORT_LARGE_Q 26 cxx_mpz az, bz; 27 #endif 28 cofac_standalone(); 29 cofac_standalone(int N, size_t x, int logI, qlattice_basis const & Q); 30 bool trace_on_spot() const; 31 /* TODO. Hmmm. How important is this ? We don't want to expose 32 * dependence on a compile flag in a header */ both_evencofac_standalone33 inline bool both_even() const {/*{{{*/ 34 #ifndef SUPPORT_LARGE_Q 35 return ((((a | b) & 1) == 0)); 36 #else 37 return ((mpz_even_p(az) && mpz_even_p(bz))); 38 #endif 39 }/*}}}*/ 40 bool gcd_coprime_with_q(las_todo_entry const & E); 41 bool ab_coprime() const; 42 void print_as_survivor(FILE * f); 43 relation get_relation(las_todo_entry const & doing); 44 void transfer_to_cofac_list(lock_guarded_container<cofac_list> & L, las_todo_entry const & doing); 45 int factor_both_leftover_norms(nfs_work_cofac & wc); 46 }; 47 48 49 #endif /* LAS_COFAC_STANDALONE_HPP_ */ 50