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.
@@ -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,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(), 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
  }
@@ -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 (!(factor % p)) {
843
- factor /= p;
844
- vec[pi] = !vec[pi];
845
- if (factor == 1U) {
846
- break;
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
- break;
851
+ return vec;
852
852
  }
853
- // Since we removed smooth primes,
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(), false);
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(), false);
900
+ fv = boost::dynamic_bitset<size_t>(primes.size(), 0);
904
901
  }
905
902
  }
906
903
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: FindAFactor
3
- Version: 3.6.4
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.4
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.4',
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