FindAFactor 3.6.6__tar.gz → 3.6.7__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {findafactor-3.6.6 → findafactor-3.6.7}/FindAFactor/_find_a_factor.cpp +6 -7
- {findafactor-3.6.6 → findafactor-3.6.7}/FindAFactor.egg-info/PKG-INFO +1 -1
- {findafactor-3.6.6 → findafactor-3.6.7}/PKG-INFO +1 -1
- {findafactor-3.6.6 → findafactor-3.6.7}/setup.py +1 -1
- {findafactor-3.6.6 → findafactor-3.6.7}/FindAFactor/__init__.py +0 -0
- {findafactor-3.6.6 → findafactor-3.6.7}/FindAFactor/dispatchqueue.cpp +0 -0
- {findafactor-3.6.6 → findafactor-3.6.7}/FindAFactor/find_a_factor.py +0 -0
- {findafactor-3.6.6 → findafactor-3.6.7}/FindAFactor/oclengine.cpp +0 -0
- {findafactor-3.6.6 → findafactor-3.6.7}/FindAFactor.egg-info/SOURCES.txt +0 -0
- {findafactor-3.6.6 → findafactor-3.6.7}/FindAFactor.egg-info/dependency_links.txt +0 -0
- {findafactor-3.6.6 → findafactor-3.6.7}/FindAFactor.egg-info/requires.txt +0 -0
- {findafactor-3.6.6 → findafactor-3.6.7}/FindAFactor.egg-info/top_level.txt +0 -0
- {findafactor-3.6.6 → findafactor-3.6.7}/LICENSE +0 -0
- {findafactor-3.6.6 → findafactor-3.6.7}/README.md +0 -0
- {findafactor-3.6.6 → findafactor-3.6.7}/setup.cfg +0 -0
@@ -682,7 +682,7 @@ bool isMultiple(const BigInteger &p, const std::vector<size_t> &knownPrimes) {
|
|
682
682
|
|
683
683
|
boost::dynamic_bitset<size_t> wheel_inc(std::vector<size_t> primes) {
|
684
684
|
BigInteger radius = 1U;
|
685
|
-
for (const
|
685
|
+
for (const size_t &i : primes) {
|
686
686
|
radius *= i;
|
687
687
|
}
|
688
688
|
const size_t prime = primes.back();
|
@@ -1231,8 +1231,6 @@ std::string find_a_factor(const std::string &toFactorStr, const bool &isConOfSqr
|
|
1231
1231
|
|
1232
1232
|
// Range per parallel node
|
1233
1233
|
const BigInteger nodeRange = (((backward(SMALLEST_WHEEL)(fullMaxBase) + nodeCount - 1U) / nodeCount) + wheelEntryCount - 1U) / wheelEntryCount;
|
1234
|
-
// This is used by all threads:
|
1235
|
-
std::vector<std::vector<BigInteger>> semiSmoothParts(CpuCount);
|
1236
1234
|
// This manages the work of all threads.
|
1237
1235
|
Factorizer worker(toFactor * toFactor, toFactor, fullMaxBase,
|
1238
1236
|
nodeRange, nodeCount, nodeId,
|
@@ -1269,7 +1267,7 @@ std::string find_a_factor(const std::string &toFactorStr, const bool &isConOfSqr
|
|
1269
1267
|
return boost::lexical_cast<std::string>(result);
|
1270
1268
|
}
|
1271
1269
|
|
1272
|
-
const auto smoothNumberFn = [&inc_seqs, &wheelEntryCount, &
|
1270
|
+
const auto smoothNumberFn = [&inc_seqs, &wheelEntryCount, &batchSizeMultiplier, &worker, &isGaussElim] {
|
1273
1271
|
// inc_seq needs to be independent per thread.
|
1274
1272
|
std::vector<boost::dynamic_bitset<size_t>> inc_seqs_clone;
|
1275
1273
|
inc_seqs_clone.reserve(inc_seqs.size());
|
@@ -1278,10 +1276,11 @@ std::string find_a_factor(const std::string &toFactorStr, const bool &isConOfSqr
|
|
1278
1276
|
}
|
1279
1277
|
|
1280
1278
|
// Different collections per thread;
|
1281
|
-
semiSmoothParts
|
1279
|
+
std::vector<BigInteger> semiSmoothParts;
|
1280
|
+
semiSmoothParts.reserve((size_t)((wheelEntryCount << 1U) * batchSizeMultiplier));
|
1282
1281
|
|
1283
1282
|
// While brute-forcing, use the "exhaust" to feed "smooth" number generation and check conguence of squares.
|
1284
|
-
return worker.smoothCongruences(&inc_seqs_clone, &
|
1283
|
+
return worker.smoothCongruences(&inc_seqs_clone, &semiSmoothParts, isGaussElim);
|
1285
1284
|
};
|
1286
1285
|
|
1287
1286
|
std::vector<std::future<BigInteger>> futures;
|
@@ -1289,7 +1288,7 @@ std::string find_a_factor(const std::string &toFactorStr, const bool &isConOfSqr
|
|
1289
1288
|
|
1290
1289
|
do {
|
1291
1290
|
for (unsigned cpu = 0U; cpu < CpuCount; ++cpu) {
|
1292
|
-
futures.push_back(std::async(std::launch::async, smoothNumberFn
|
1291
|
+
futures.push_back(std::async(std::launch::async, smoothNumberFn));
|
1293
1292
|
}
|
1294
1293
|
|
1295
1294
|
for (unsigned cpu = 0U; cpu < futures.size(); ++cpu) {
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|