FindAFactor 3.6.9__tar.gz → 3.7.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {findafactor-3.6.9 → findafactor-3.7.0}/FindAFactor/find_a_factor.py +3 -3
- {findafactor-3.6.9 → findafactor-3.7.0}/FindAFactor.egg-info/PKG-INFO +7 -7
- {findafactor-3.6.9 → findafactor-3.7.0}/PKG-INFO +7 -7
- {findafactor-3.6.9 → findafactor-3.7.0}/README.md +6 -6
- {findafactor-3.6.9 → findafactor-3.7.0}/setup.py +1 -1
- {findafactor-3.6.9 → findafactor-3.7.0}/FindAFactor/__init__.py +0 -0
- {findafactor-3.6.9 → findafactor-3.7.0}/FindAFactor/_find_a_factor.cpp +0 -0
- {findafactor-3.6.9 → findafactor-3.7.0}/FindAFactor/dispatchqueue.cpp +0 -0
- {findafactor-3.6.9 → findafactor-3.7.0}/FindAFactor/oclengine.cpp +0 -0
- {findafactor-3.6.9 → findafactor-3.7.0}/FindAFactor.egg-info/SOURCES.txt +0 -0
- {findafactor-3.6.9 → findafactor-3.7.0}/FindAFactor.egg-info/dependency_links.txt +0 -0
- {findafactor-3.6.9 → findafactor-3.7.0}/FindAFactor.egg-info/requires.txt +0 -0
- {findafactor-3.6.9 → findafactor-3.7.0}/FindAFactor.egg-info/top_level.txt +0 -0
- {findafactor-3.6.9 → findafactor-3.7.0}/LICENSE +0 -0
- {findafactor-3.6.9 → findafactor-3.7.0}/setup.cfg +0 -0
@@ -6,11 +6,11 @@ def find_a_factor(n,
|
|
6
6
|
use_gaussian_elimination=True if os.environ.get('FINDAFACTOR_USE_GAUSSIAN_ELIMINATION') else False,
|
7
7
|
node_count=int(os.environ.get('FINDAFACTOR_NODE_COUNT')) if os.environ.get('FINDAFACTOR_NODE_COUNT') else 1,
|
8
8
|
node_id=int(os.environ.get('FINDAFACTOR_NODE_ID')) if os.environ.get('FINDAFACTOR_NODE_ID') else 0,
|
9
|
-
trial_division_level=int(os.environ.get('FINDAFACTOR_TRIAL_DIVISION_LEVEL')) if os.environ.get('FINDAFACTOR_TRIAL_DIVISION_LEVEL') else
|
10
|
-
gear_factorization_level=int(os.environ.get('FINDAFACTOR_GEAR_FACTORIZATION_LEVEL')) if os.environ.get('FINDAFACTOR_GEAR_FACTORIZATION_LEVEL') else
|
9
|
+
trial_division_level=int(os.environ.get('FINDAFACTOR_TRIAL_DIVISION_LEVEL')) if os.environ.get('FINDAFACTOR_TRIAL_DIVISION_LEVEL') else (1<<20),
|
10
|
+
gear_factorization_level=int(os.environ.get('FINDAFACTOR_GEAR_FACTORIZATION_LEVEL')) if os.environ.get('FINDAFACTOR_GEAR_FACTORIZATION_LEVEL') else 13,
|
11
11
|
wheel_factorization_level=int(os.environ.get('FINDAFACTOR_WHEEL_FACTORIZATION_LEVEL')) if os.environ.get('FINDAFACTOR_WHEEL_FACTORIZATION_LEVEL') else 7,
|
12
12
|
smoothness_bound_multiplier=float(os.environ.get('FINDAFACTOR_SMOOTHNESS_BOUND_MULTIPLIER')) if os.environ.get('FINDAFACTOR_SMOOTHNESS_BOUND_MULTIPLIER') else 1.0,
|
13
|
-
batch_size_multiplier=float(os.environ.get('FINDAFACTOR_BATCH_SIZE_MULTIPLIER')) if os.environ.get('FINDAFACTOR_BATCH_SIZE_MULTIPLIER') else
|
13
|
+
batch_size_multiplier=float(os.environ.get('FINDAFACTOR_BATCH_SIZE_MULTIPLIER')) if os.environ.get('FINDAFACTOR_BATCH_SIZE_MULTIPLIER') else 2048.0):
|
14
14
|
return int(_find_a_factor._find_a_factor(str(n),
|
15
15
|
use_congruence_of_squares,
|
16
16
|
use_gaussian_elimination,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: FindAFactor
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.7.0
|
4
4
|
Summary: Find any nontrivial factor of a number
|
5
5
|
Home-page: https://github.com/vm6502q/FindAFactor
|
6
6
|
Author: Dan Strano
|
@@ -51,11 +51,11 @@ factor = find_a_factor(
|
|
51
51
|
use_congruence_of_squares=False,
|
52
52
|
use_gaussian_elimination=False,
|
53
53
|
node_count=1, node_id=0,
|
54
|
-
trial_division_level=
|
55
|
-
gear_factorization_level=
|
54
|
+
trial_division_level=2**20,
|
55
|
+
gear_factorization_level=13,
|
56
56
|
wheel_factorization_level=7,
|
57
57
|
smoothness_bound_multiplier=1.0,
|
58
|
-
batch_size_multiplier=
|
58
|
+
batch_size_multiplier=2048.0
|
59
59
|
)
|
60
60
|
```
|
61
61
|
|
@@ -65,11 +65,11 @@ The `find_a_factor()` function should return any nontrivial factor of `to_factor
|
|
65
65
|
- `use_gaussian_elimination` (default value: `False`): This option is only relevant if `use_congruence_of_squares=True`. In that case, if `use_gaussian_elimination` is `True`, then proper Gaussian elimination is used, with **O(N^3)** worst case complexity but using potentially much smaller "N" count of rows. If the option is `False`, rather than Gaussian elimination, the algorithm checks only for exact factorization parity duplicates in the "smooth" number rows, for **O(N^2)** worst case complexity, but using a potentially much larger "N" count of rows.
|
66
66
|
- `node_count` (default value: `1`): `FindAFactor` can perform factorization in a _distributed_ manner, across nodes, without network communication! When `node_count` is set higher than `1`, the search space for factors is segmented equally per node. If the number to factor is semiprime, and brute-force search is used instead of congruence of squares, for example, all nodes except the one that happens to contain the (unknown) prime factor less than the square root of `to_factor` will ultimately return `1`, while one node will find and return this factor. For best performance, every node involved in factorization should have roughly the same CPU throughput capacity.
|
67
67
|
- `node_id` (default value: `0`): This is the identifier of this node, when performing distributed factorization with `node_count` higher than `1`. `node_id` values start at `0` and go as high as `(node_count - 1)`.
|
68
|
-
- `trial_division_level` (default value: `
|
69
|
-
- `gear_factorization_level` (default value: `
|
68
|
+
- `trial_division_level` (default value: `2**20`): Trial division is carried out as a preliminary round for all primes up this number. If you need more primes for your smoothness bound, increase this level.
|
69
|
+
- `gear_factorization_level` (default value: `13`): This is the value up to which "wheel (and gear) factorization" and trial division are used to check factors and optimize "brute force," in general. The default value of `13` includes all prime factors of `13` and below and works well in general, though significantly higher might be preferred in certain cases.
|
70
70
|
- `wheel_factorization_level` (default value: `7`): "Wheel" vs. "gear" factorization balances two types of factorization wheel ("wheel" vs. "gear" design) that often work best when the "wheel" is only a few prime number levels lower than gear factorization. Optimized implementation for wheels is only available up to `13`. The primes above "wheel" level, up to "gear" level, are the primes used specifically for "gear" factorization.
|
71
71
|
- `smoothness_bound_multiplier` (default value: `1.0`): starting with the first prime number after wheel factorization, the congruence of squares approach (with Quadratic Sieve) takes a default "smoothness bound" with as many distinct prime numbers as bits in the number to factor (for default argument of `1.0` multiplier). To increase or decrease this number, consider it multiplied by the value of `smoothness_bound_multiplier`.
|
72
|
-
- `batch_size_multiplier` (default value: `
|
72
|
+
- `batch_size_multiplier` (default value: `2048.0`): Each `1.0` increment of the multiplier is 2 cycles of gear and wheel factorization, alternating every other cycle between bottom of guessing range and top of guessing range, for every thread in use.
|
73
73
|
|
74
74
|
All variables defaults can also be controlled by environment variables:
|
75
75
|
- `FINDAFACTOR_USE_CONGRUENCE_OF_SQUARES` (any value makes `True`, while default is `False`)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: FindAFactor
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.7.0
|
4
4
|
Summary: Find any nontrivial factor of a number
|
5
5
|
Home-page: https://github.com/vm6502q/FindAFactor
|
6
6
|
Author: Dan Strano
|
@@ -51,11 +51,11 @@ factor = find_a_factor(
|
|
51
51
|
use_congruence_of_squares=False,
|
52
52
|
use_gaussian_elimination=False,
|
53
53
|
node_count=1, node_id=0,
|
54
|
-
trial_division_level=
|
55
|
-
gear_factorization_level=
|
54
|
+
trial_division_level=2**20,
|
55
|
+
gear_factorization_level=13,
|
56
56
|
wheel_factorization_level=7,
|
57
57
|
smoothness_bound_multiplier=1.0,
|
58
|
-
batch_size_multiplier=
|
58
|
+
batch_size_multiplier=2048.0
|
59
59
|
)
|
60
60
|
```
|
61
61
|
|
@@ -65,11 +65,11 @@ The `find_a_factor()` function should return any nontrivial factor of `to_factor
|
|
65
65
|
- `use_gaussian_elimination` (default value: `False`): This option is only relevant if `use_congruence_of_squares=True`. In that case, if `use_gaussian_elimination` is `True`, then proper Gaussian elimination is used, with **O(N^3)** worst case complexity but using potentially much smaller "N" count of rows. If the option is `False`, rather than Gaussian elimination, the algorithm checks only for exact factorization parity duplicates in the "smooth" number rows, for **O(N^2)** worst case complexity, but using a potentially much larger "N" count of rows.
|
66
66
|
- `node_count` (default value: `1`): `FindAFactor` can perform factorization in a _distributed_ manner, across nodes, without network communication! When `node_count` is set higher than `1`, the search space for factors is segmented equally per node. If the number to factor is semiprime, and brute-force search is used instead of congruence of squares, for example, all nodes except the one that happens to contain the (unknown) prime factor less than the square root of `to_factor` will ultimately return `1`, while one node will find and return this factor. For best performance, every node involved in factorization should have roughly the same CPU throughput capacity.
|
67
67
|
- `node_id` (default value: `0`): This is the identifier of this node, when performing distributed factorization with `node_count` higher than `1`. `node_id` values start at `0` and go as high as `(node_count - 1)`.
|
68
|
-
- `trial_division_level` (default value: `
|
69
|
-
- `gear_factorization_level` (default value: `
|
68
|
+
- `trial_division_level` (default value: `2**20`): Trial division is carried out as a preliminary round for all primes up this number. If you need more primes for your smoothness bound, increase this level.
|
69
|
+
- `gear_factorization_level` (default value: `13`): This is the value up to which "wheel (and gear) factorization" and trial division are used to check factors and optimize "brute force," in general. The default value of `13` includes all prime factors of `13` and below and works well in general, though significantly higher might be preferred in certain cases.
|
70
70
|
- `wheel_factorization_level` (default value: `7`): "Wheel" vs. "gear" factorization balances two types of factorization wheel ("wheel" vs. "gear" design) that often work best when the "wheel" is only a few prime number levels lower than gear factorization. Optimized implementation for wheels is only available up to `13`. The primes above "wheel" level, up to "gear" level, are the primes used specifically for "gear" factorization.
|
71
71
|
- `smoothness_bound_multiplier` (default value: `1.0`): starting with the first prime number after wheel factorization, the congruence of squares approach (with Quadratic Sieve) takes a default "smoothness bound" with as many distinct prime numbers as bits in the number to factor (for default argument of `1.0` multiplier). To increase or decrease this number, consider it multiplied by the value of `smoothness_bound_multiplier`.
|
72
|
-
- `batch_size_multiplier` (default value: `
|
72
|
+
- `batch_size_multiplier` (default value: `2048.0`): Each `1.0` increment of the multiplier is 2 cycles of gear and wheel factorization, alternating every other cycle between bottom of guessing range and top of guessing range, for every thread in use.
|
73
73
|
|
74
74
|
All variables defaults can also be controlled by environment variables:
|
75
75
|
- `FINDAFACTOR_USE_CONGRUENCE_OF_SQUARES` (any value makes `True`, while default is `False`)
|
@@ -30,11 +30,11 @@ factor = find_a_factor(
|
|
30
30
|
use_congruence_of_squares=False,
|
31
31
|
use_gaussian_elimination=False,
|
32
32
|
node_count=1, node_id=0,
|
33
|
-
trial_division_level=
|
34
|
-
gear_factorization_level=
|
33
|
+
trial_division_level=2**20,
|
34
|
+
gear_factorization_level=13,
|
35
35
|
wheel_factorization_level=7,
|
36
36
|
smoothness_bound_multiplier=1.0,
|
37
|
-
batch_size_multiplier=
|
37
|
+
batch_size_multiplier=2048.0
|
38
38
|
)
|
39
39
|
```
|
40
40
|
|
@@ -44,11 +44,11 @@ The `find_a_factor()` function should return any nontrivial factor of `to_factor
|
|
44
44
|
- `use_gaussian_elimination` (default value: `False`): This option is only relevant if `use_congruence_of_squares=True`. In that case, if `use_gaussian_elimination` is `True`, then proper Gaussian elimination is used, with **O(N^3)** worst case complexity but using potentially much smaller "N" count of rows. If the option is `False`, rather than Gaussian elimination, the algorithm checks only for exact factorization parity duplicates in the "smooth" number rows, for **O(N^2)** worst case complexity, but using a potentially much larger "N" count of rows.
|
45
45
|
- `node_count` (default value: `1`): `FindAFactor` can perform factorization in a _distributed_ manner, across nodes, without network communication! When `node_count` is set higher than `1`, the search space for factors is segmented equally per node. If the number to factor is semiprime, and brute-force search is used instead of congruence of squares, for example, all nodes except the one that happens to contain the (unknown) prime factor less than the square root of `to_factor` will ultimately return `1`, while one node will find and return this factor. For best performance, every node involved in factorization should have roughly the same CPU throughput capacity.
|
46
46
|
- `node_id` (default value: `0`): This is the identifier of this node, when performing distributed factorization with `node_count` higher than `1`. `node_id` values start at `0` and go as high as `(node_count - 1)`.
|
47
|
-
- `trial_division_level` (default value: `
|
48
|
-
- `gear_factorization_level` (default value: `
|
47
|
+
- `trial_division_level` (default value: `2**20`): Trial division is carried out as a preliminary round for all primes up this number. If you need more primes for your smoothness bound, increase this level.
|
48
|
+
- `gear_factorization_level` (default value: `13`): This is the value up to which "wheel (and gear) factorization" and trial division are used to check factors and optimize "brute force," in general. The default value of `13` includes all prime factors of `13` and below and works well in general, though significantly higher might be preferred in certain cases.
|
49
49
|
- `wheel_factorization_level` (default value: `7`): "Wheel" vs. "gear" factorization balances two types of factorization wheel ("wheel" vs. "gear" design) that often work best when the "wheel" is only a few prime number levels lower than gear factorization. Optimized implementation for wheels is only available up to `13`. The primes above "wheel" level, up to "gear" level, are the primes used specifically for "gear" factorization.
|
50
50
|
- `smoothness_bound_multiplier` (default value: `1.0`): starting with the first prime number after wheel factorization, the congruence of squares approach (with Quadratic Sieve) takes a default "smoothness bound" with as many distinct prime numbers as bits in the number to factor (for default argument of `1.0` multiplier). To increase or decrease this number, consider it multiplied by the value of `smoothness_bound_multiplier`.
|
51
|
-
- `batch_size_multiplier` (default value: `
|
51
|
+
- `batch_size_multiplier` (default value: `2048.0`): Each `1.0` increment of the multiplier is 2 cycles of gear and wheel factorization, alternating every other cycle between bottom of guessing range and top of guessing range, for every thread in use.
|
52
52
|
|
53
53
|
All variables defaults can also be controlled by environment variables:
|
54
54
|
- `FINDAFACTOR_USE_CONGRUENCE_OF_SQUARES` (any value makes `True`, while default is `False`)
|
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
|