FindAFactor 3.6.4__tar.gz → 3.6.5__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {findafactor-3.6.4 → findafactor-3.6.5}/FindAFactor/_find_a_factor.cpp +15 -18
- {findafactor-3.6.4 → findafactor-3.6.5}/FindAFactor.egg-info/PKG-INFO +1 -1
- {findafactor-3.6.4 → findafactor-3.6.5}/PKG-INFO +1 -1
- {findafactor-3.6.4 → findafactor-3.6.5}/setup.py +1 -1
- {findafactor-3.6.4 → findafactor-3.6.5}/FindAFactor/__init__.py +0 -0
- {findafactor-3.6.4 → findafactor-3.6.5}/FindAFactor/dispatchqueue.cpp +0 -0
- {findafactor-3.6.4 → findafactor-3.6.5}/FindAFactor/find_a_factor.py +0 -0
- {findafactor-3.6.4 → findafactor-3.6.5}/FindAFactor/oclengine.cpp +0 -0
- {findafactor-3.6.4 → findafactor-3.6.5}/FindAFactor.egg-info/SOURCES.txt +0 -0
- {findafactor-3.6.4 → findafactor-3.6.5}/FindAFactor.egg-info/dependency_links.txt +0 -0
- {findafactor-3.6.4 → findafactor-3.6.5}/FindAFactor.egg-info/requires.txt +0 -0
- {findafactor-3.6.4 → findafactor-3.6.5}/FindAFactor.egg-info/top_level.txt +0 -0
- {findafactor-3.6.4 → findafactor-3.6.5}/LICENSE +0 -0
- {findafactor-3.6.4 → findafactor-3.6.5}/README.md +0 -0
- {findafactor-3.6.4 → findafactor-3.6.5}/setup.cfg +0 -0
@@ -759,7 +759,7 @@ struct Factorizer {
|
|
759
759
|
wheelRadius *= p;
|
760
760
|
sqrPrimes.push_back(p * p);
|
761
761
|
smoothNumberKeys.push_back(p);
|
762
|
-
smoothNumberValues.emplace_back(primes.size(),
|
762
|
+
smoothNumberValues.emplace_back(primes.size(), 0);
|
763
763
|
smoothNumberValues.back()[i] = true;
|
764
764
|
}
|
765
765
|
}
|
@@ -828,10 +828,9 @@ struct Factorizer {
|
|
828
828
|
|
829
829
|
// Compute the prime factorization modulo 2
|
830
830
|
boost::dynamic_bitset<size_t> factorizationVector(BigInteger num) {
|
831
|
-
boost::dynamic_bitset<size_t> vec(primes.size(),
|
832
|
-
|
833
|
-
|
834
|
-
factor = gcd(num, wheelRadius);
|
831
|
+
boost::dynamic_bitset<size_t> vec(primes.size(), 0);
|
832
|
+
while (true) {
|
833
|
+
BigInteger factor = gcd(num, wheelRadius);
|
835
834
|
if (factor == 1U) {
|
836
835
|
break;
|
837
836
|
}
|
@@ -839,21 +838,19 @@ struct Factorizer {
|
|
839
838
|
// Remove smooth primes from factor
|
840
839
|
for (size_t pi = 0U; pi < primes.size(); ++pi) {
|
841
840
|
const BigInteger& p = primes[pi];
|
842
|
-
if (
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
841
|
+
if (factor % p) {
|
842
|
+
continue;
|
843
|
+
}
|
844
|
+
factor /= p;
|
845
|
+
vec[pi] = !vec[pi];
|
846
|
+
if (factor == 1U) {
|
847
|
+
break;
|
848
848
|
}
|
849
849
|
}
|
850
850
|
if (num == 1U) {
|
851
|
-
|
851
|
+
return vec;
|
852
852
|
}
|
853
|
-
|
854
|
-
// factor == 1U if the number is smooth.
|
855
|
-
} while (factor == 1U);
|
856
|
-
|
853
|
+
};
|
857
854
|
if (num != 1U) {
|
858
855
|
return boost::dynamic_bitset<size_t>();
|
859
856
|
}
|
@@ -882,7 +879,7 @@ struct Factorizer {
|
|
882
879
|
|
883
880
|
// Now that smooth parts have been shuffled, just multiply down the list until they are larger than square root of toFactor.
|
884
881
|
BigInteger smoothNumber = 1U;
|
885
|
-
boost::dynamic_bitset<size_t> fv(primes.size(),
|
882
|
+
boost::dynamic_bitset<size_t> fv(primes.size(), 0);
|
886
883
|
for (size_t spi = 0U; spi < smoothParts.size(); ++spi) {
|
887
884
|
const BigInteger &sp = smoothParts[spi];
|
888
885
|
// This multiplies together the factorizations of the smooth parts
|
@@ -900,7 +897,7 @@ struct Factorizer {
|
|
900
897
|
}
|
901
898
|
// Reset "smoothNumber" and its factorization vector.
|
902
899
|
smoothNumber = 1U;
|
903
|
-
fv = boost::dynamic_bitset<size_t>(primes.size(),
|
900
|
+
fv = boost::dynamic_bitset<size_t>(primes.size(), 0);
|
904
901
|
}
|
905
902
|
}
|
906
903
|
|
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
|