summaryrefslogtreecommitdiff
path: root/libre/sagemath/ecm-7.patch
blob: 617e18d98aa3e2d8f7aaa45f0759cf988b598376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
--- a/src/sage/interfaces/ecm.py.orig	2016-05-16 22:18:03.894827738 +0200
+++ b/src/sage/interfaces/ecm.py	2016-05-16 22:19:14.674904932 +0200
@@ -140,9 +140,6 @@
         - ``ve`` -- integer `n`. Verbosely show short (`< n`
           character) expressions on each loop
 
-        - ``cofdec`` -- boolean. Force cofactor output in decimal
-          (even if expressions are used )
-
         - ``B2scale`` -- integer. Multiplies the default B2 value
 
         - ``go`` -- integer. Preload with group order val, which can
@@ -395,15 +392,15 @@
             if m is not None:
                 factor = m.group('factor')
                 primality = m.group('primality')
-                assert primality in ['probable prime', 'composite']
-                result += [(ZZ(factor), primality == 'probable prime')]
+                assert primality in ['prime', 'composite']
+                result += [(ZZ(factor), primality == 'prime')]
                 continue  # cofactor on the next line
             m = self._found_cofactor_re.match(line)
             if m is not None:
                 cofactor = m.group('cofactor')
                 primality = m.group('primality')
-                assert primality in ['Probable prime', 'Composite']
-                result += [(ZZ(cofactor), primality == 'Probable prime')]
+                assert primality in ['Prime', 'Composite']
+                result += [(ZZ(cofactor), primality == 'Prime')]
                 # assert len(result) == 2
                 return result
         raise ValueError('failed to parse ECM output')
@@ -501,7 +498,6 @@
         if factor_digits is not None:
             B1 = self.recommended_B1(factor_digits)
         kwds['one'] = True
-        kwds['cofdec'] = True
         cmd = self._make_cmd(B1, None, kwds)
         out = self._run_ecm(cmd, n)
         return self._parse_output(n, out)
@@ -828,8 +828,8 @@
 Step 1 took 12ms
 Step 2 took 17ms
 ********** Factor found in step 2: 79792266297612017
-Found probable prime factor of 17 digits: 79792266297612017
-Probable prime cofactor 6366805760909027985741435139224233 has 34 digits
+Found prime factor of 17 digits: 79792266297612017
+Prime cofactor 6366805760909027985741435139224233 has 34 digits
 """
 
 TEST_ECM_OUTPUT_2 = """
@@ -839,8 +839,8 @@
 Step 1 took 2ms
 Step 2 took 3ms
 ********** Factor found in step 2: 179424673
-Found probable prime factor of  9 digits: 179424673
-Probable prime cofactor 179424673 has 9 digits
+Found prime factor of  9 digits: 179424673
+Prime cofactor 179424673 has 9 digits
 """
 
 TEST_ECM_OUTPUT_3 = """
@@ -858,7 +858,7 @@
 Step 1 took 5ms
 Step 2 took 4ms
 ********** Factor found in step 2: 197002597249
-Found probable prime factor of 12 digits: 197002597249
+Found prime factor of 12 digits: 197002597249
 Composite cofactor 339872432034468861533158743041639097889948066859 has 48 digits
 """
 
@@ -870,5 +870,5 @@
 Step 2 took 2ms
 ********** Factor found in step 2: 265748496095531068869578877937
 Found composite factor of 30 digits: 265748496095531068869578877937
-Probable prime cofactor 251951573867253012259144010843 has 30 digits
+Prime cofactor 251951573867253012259144010843 has 30 digits
 """