File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -390,12 +390,12 @@ struct Factorizer {
390390 {
391391 smoothNumberKeys.reserve (rowLimit);
392392 smoothNumberValues.reserve (rowLimit);
393- for (const size_t p : smoothPrimes) {
394- smoothWheelRadius *= p;
395- }
396393 while (smoothPrimes.size () && (smoothPrimes[0U ] <= wfl)) {
397394 smoothPrimes.erase (smoothPrimes.begin ());
398395 }
396+ for (const size_t p : smoothPrimes) {
397+ smoothWheelRadius *= p;
398+ }
399399 }
400400
401401 BigInteger getNextBatch () {
@@ -443,6 +443,10 @@ struct Factorizer {
443443
444444 // Sieving function
445445 BigInteger sievePolynomials (std::vector<boost::dynamic_bitset<size_t >> *inc_seqs) {
446+ if (smoothWheelRadius < 2U ) {
447+ throw std::invalid_argument (" Wheel factorization level setting excludes all smooth primes!" );
448+ }
449+
446450 for (BigInteger batchNum = getNextBatch (); isIncomplete; batchNum = getNextBatch ()) {
447451 // NOTE: If you want to add gear factorization back in, realize that these bounds
448452 // do not yet properly align to exact wheel boundaries, for full repetitions.
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
88
99[project ]
1010name = " findafactor"
11- version = " 6.8.1 "
11+ version = " 6.8.2 "
1212requires-python = " >=3.8"
1313description = " Find any nontrivial factor of a number"
1414readme = {file = " README.txt" , content-type = " text/markdown" }
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ def build_extension(self, ext):
4040
4141setup (
4242 name = 'findafactor' ,
43- version = '6.8.1 ' ,
43+ version = '6.8.2 ' ,
4444 author = 'Dan Strano' ,
4545 author_email = 'stranoj@gmail.com' ,
4646 description = 'Find any nontrivial factor of a number' ,
You can’t perform that action at this time.
0 commit comments