FindAFactor 3.6.3__tar.gz → 3.6.5__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -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(), false);
762
+ smoothNumberValues.emplace_back(primes.size(), 0);
763
763
  smoothNumberValues.back()[i] = true;
764
764
  }
765
765
  }
@@ -828,29 +828,29 @@ 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(), false);
832
- BigInteger factor = 1U;
833
- do {
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
  }
838
837
  num /= factor;
838
+ // Remove smooth primes from factor
839
839
  for (size_t pi = 0U; pi < primes.size(); ++pi) {
840
840
  const BigInteger& p = primes[pi];
841
- if (!(factor % p)) {
842
- factor /= p;
843
- vec[pi] = !vec[pi];
844
- if (factor == 1U) {
845
- break;
846
- }
841
+ if (factor % p) {
842
+ continue;
843
+ }
844
+ factor /= p;
845
+ vec[pi] = !vec[pi];
846
+ if (factor == 1U) {
847
+ break;
847
848
  }
848
849
  }
849
850
  if (num == 1U) {
850
- break;
851
+ return vec;
851
852
  }
852
- } while (factor != 1U);
853
-
853
+ };
854
854
  if (num != 1U) {
855
855
  return boost::dynamic_bitset<size_t>();
856
856
  }
@@ -879,7 +879,7 @@ struct Factorizer {
879
879
 
880
880
  // Now that smooth parts have been shuffled, just multiply down the list until they are larger than square root of toFactor.
881
881
  BigInteger smoothNumber = 1U;
882
- boost::dynamic_bitset<size_t> fv(primes.size(), false);
882
+ boost::dynamic_bitset<size_t> fv(primes.size(), 0);
883
883
  for (size_t spi = 0U; spi < smoothParts.size(); ++spi) {
884
884
  const BigInteger &sp = smoothParts[spi];
885
885
  // This multiplies together the factorizations of the smooth parts
@@ -897,7 +897,7 @@ struct Factorizer {
897
897
  }
898
898
  // Reset "smoothNumber" and its factorization vector.
899
899
  smoothNumber = 1U;
900
- fv = boost::dynamic_bitset<size_t>(primes.size(), false);
900
+ fv = boost::dynamic_bitset<size_t>(primes.size(), 0);
901
901
  }
902
902
  }
903
903
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: FindAFactor
3
- Version: 3.6.3
3
+ Version: 3.6.5
4
4
  Summary: Find any nontrivial factor of a number
5
5
  Home-page: https://github.com/vm6502q/FindAFactor
6
6
  Author: Dan Strano
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: FindAFactor
3
- Version: 3.6.3
3
+ Version: 3.6.5
4
4
  Summary: Find any nontrivial factor of a number
5
5
  Home-page: https://github.com/vm6502q/FindAFactor
6
6
  Author: Dan Strano
@@ -26,7 +26,7 @@ ext_modules = [
26
26
 
27
27
  setup(
28
28
  name='FindAFactor',
29
- version='3.6.3',
29
+ version='3.6.5',
30
30
  author='Dan Strano',
31
31
  author_email='dan@unitary.fund',
32
32
  description='Find any nontrivial factor of a number',
File without changes
File without changes
File without changes