FindAFactor 3.9.0__cp313-cp313-macosx_15_0_arm64.whl → 4.0.0__cp313-cp313-macosx_15_0_arm64.whl

Sign up to get free protection for your applications and to get access to all the features.
FindAFactor/__init__.py CHANGED
@@ -1 +1 @@
1
- from .find_a_factor import find_a_factor
1
+ from .find_a_factor import find_a_factor, FactoringMethod
@@ -1,19 +1,25 @@
1
1
  import os
2
2
  import _find_a_factor
3
+ from enum import IntEnum
4
+
5
+
6
+ class FactoringMethod(IntEnum):
7
+ PRIME_SOLVER = 0
8
+ MIXED = 1
9
+ FACTOR_FINDER = 2
10
+
3
11
 
4
12
  def find_a_factor(n,
5
- use_congruence_of_squares=True if os.environ.get('FINDAFACTOR_USE_CONGRUENCE_OF_SQUARES') else False,
6
- use_gaussian_elimination=True if os.environ.get('FINDAFACTOR_USE_GAUSSIAN_ELIMINATION') else False,
13
+ method=FactoringMethod(int(os.environ.get('FINDAFACTOR_METHOD'))) if os.environ.get('FINDAFACTOR_METHOD') else FactoringMethod.PRIME_SOLVER,
7
14
  node_count=int(os.environ.get('FINDAFACTOR_NODE_COUNT')) if os.environ.get('FINDAFACTOR_NODE_COUNT') else 1,
8
15
  node_id=int(os.environ.get('FINDAFACTOR_NODE_ID')) if os.environ.get('FINDAFACTOR_NODE_ID') else 0,
9
16
  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 11,
11
- wheel_factorization_level=int(os.environ.get('FINDAFACTOR_WHEEL_FACTORIZATION_LEVEL')) if os.environ.get('FINDAFACTOR_WHEEL_FACTORIZATION_LEVEL') else 7,
17
+ gear_factorization_level=int(os.environ.get('FINDAFACTOR_GEAR_FACTORIZATION_LEVEL')) if os.environ.get('FINDAFACTOR_GEAR_FACTORIZATION_LEVEL') else 13,
18
+ wheel_factorization_level=int(os.environ.get('FINDAFACTOR_WHEEL_FACTORIZATION_LEVEL')) if os.environ.get('FINDAFACTOR_WHEEL_FACTORIZATION_LEVEL') else 11,
12
19
  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 2048.0):
20
+ batch_size_multiplier=float(os.environ.get('FINDAFACTOR_BATCH_SIZE_MULTIPLIER')) if os.environ.get('FINDAFACTOR_BATCH_SIZE_MULTIPLIER') else 128.0):
14
21
  return int(_find_a_factor._find_a_factor(str(n),
15
- use_congruence_of_squares,
16
- use_gaussian_elimination,
22
+ int(method),
17
23
  node_count, node_id,
18
24
  trial_division_level,
19
25
  gear_factorization_level,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: FindAFactor
3
- Version: 3.9.0
3
+ Version: 4.0.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
@@ -0,0 +1,8 @@
1
+ _find_a_factor.cpython-313-darwin.so,sha256=pcnmBZnfoxI6Cbi0cITo46a8mqdqsMufj14RdWWX-fE,274856
2
+ FindAFactor/__init__.py,sha256=HpY7jfatO8mUdIB7I572t5wwgwfzRQNDRW-egeSIEFo,57
3
+ FindAFactor/find_a_factor.py,sha256=KHBVInAS_n9hpjRWqWW1vlAbHIfWvDXetG5-CV2m3gA,1986
4
+ FindAFactor-4.0.0.dist-info/LICENSE,sha256=kM5ErD_w66mShD_pmEXez6Evb2_MTLRHykc0qdUWEFY,1085
5
+ FindAFactor-4.0.0.dist-info/METADATA,sha256=hLbiwp6vfe340Qr9mkYBnn7jS1U4MZCcgcNeDfFtPd4,1102
6
+ FindAFactor-4.0.0.dist-info/WHEEL,sha256=8MDYB8qOpICHXsmvikvrTDt0NBN7mgF9tE1rvEyJ6WE,109
7
+ FindAFactor-4.0.0.dist-info/top_level.txt,sha256=WoOrEcqIwo8A96WXAtimPshsFZfT5d00SvMC6rVKAn0,27
8
+ FindAFactor-4.0.0.dist-info/RECORD,,
Binary file
@@ -1,8 +0,0 @@
1
- _find_a_factor.cpython-313-darwin.so,sha256=RhOyjXatJ-FgQAJ9zL3g7-BeXFLU97k5b5KdoILpvIA,275016
2
- FindAFactor/__init__.py,sha256=z12lYiLTSXmc8FpKk4tqkSADlHxEV-NqWyA1d5OuQAQ,40
3
- FindAFactor/find_a_factor.py,sha256=5P_1BcoLIFr8JHeLe4smpect7G7TnEDuf4ZPNAqcD3Y,2027
4
- FindAFactor-3.9.0.dist-info/LICENSE,sha256=kM5ErD_w66mShD_pmEXez6Evb2_MTLRHykc0qdUWEFY,1085
5
- FindAFactor-3.9.0.dist-info/METADATA,sha256=BTi4znrYLp3zsOV9TnW8CL3S1IYmjRHz5_62GyDXIv8,1102
6
- FindAFactor-3.9.0.dist-info/WHEEL,sha256=8MDYB8qOpICHXsmvikvrTDt0NBN7mgF9tE1rvEyJ6WE,109
7
- FindAFactor-3.9.0.dist-info/top_level.txt,sha256=WoOrEcqIwo8A96WXAtimPshsFZfT5d00SvMC6rVKAn0,27
8
- FindAFactor-3.9.0.dist-info/RECORD,,