Skip to content

Commit 3f8e6a1

Browse files
Avoid taus88 on Jammy
1 parent 4fa4d33 commit 3f8e6a1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

FindAFactor/_find_a_factor.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,18 @@
5858
#include <pybind11/pybind11.h>
5959
#include <pybind11/stl.h>
6060

61+
#include <cxxabi.h>
62+
6163
namespace Qimcifa {
6264

6365
typedef boost::multiprecision::cpp_int BigInteger;
6466

67+
#if (__GLIBCXX__ >= 20350000) && (__GLIBCXX__ <= 20360000)
68+
typedef std::mt19937 rngType;
69+
#else
70+
typedef boost::random::taus88 rngType;
71+
#endif
72+
6573
const unsigned CpuCount = std::thread::hardware_concurrency();
6674
DispatchQueue dispatch(CpuCount);
6775

@@ -807,7 +815,7 @@ struct Factorizer {
807815
return 1U;
808816
}
809817

810-
BigInteger monteCarlo(boost::random::taus88& gen) {
818+
BigInteger monteCarlo(rngType& gen) {
811819
// This function enters only once per thread.
812820
size_t batchPower = 0U;
813821

@@ -1123,7 +1131,7 @@ std::string find_a_factor(std::string toFactorStr, size_t method, size_t nodeCou
11231131
std::vector<std::future<BigInteger>> futures;
11241132
futures.reserve(CpuCount);
11251133

1126-
std::vector<boost::random::taus88> gen;
1134+
std::vector<rngType> gen;
11271135
if (isFactorFinder) {
11281136
std::default_random_engine rng{};
11291137
gen.reserve(CpuCount);

0 commit comments

Comments
 (0)