Merge tag 'upstream/1.6.2+ds'
Upstream version 1.6.2+ds
Jerome Benoit
5 years ago
0 | coverage: | |
1 | precision: 2 | |
2 | round: down | |
3 | range: "70...100" | |
4 | ||
5 | status: | |
6 | project: no | |
7 | patch: yes | |
8 | changes: no | |
9 | ||
10 | comment: | |
11 | layout: "header, diff, changes, tree" | |
12 | behavior: default | |
13 | ||
14 | ignore: | |
15 | - "PackageInfo.g" | |
16 | - "init.g" | |
17 | - "read.g" | |
18 | - "tst/*" # ignore test harness code | |
19 | - "tst/**/*" # ignore test harness code |
0 | language: c | |
1 | env: | |
2 | global: | |
3 | - GAPROOT=gaproot | |
4 | - COVDIR=coverage | |
5 | ||
6 | addons: | |
7 | apt_packages: | |
8 | - libgmp-dev | |
9 | - libreadline-dev | |
10 | - libgmp-dev:i386 | |
11 | - libreadline-dev:i386 | |
12 | - gcc-multilib | |
13 | - g++-multilib | |
14 | ||
15 | matrix: | |
16 | include: | |
17 | - env: CFLAGS="-O2" CC=clang CXX=clang++ | |
18 | compiler: clang | |
19 | - env: CFLAGS="-O2" | |
20 | compiler: gcc | |
21 | - env: ABI=32 | |
22 | ||
23 | branches: | |
24 | only: | |
25 | - master | |
26 | ||
27 | before_script: | |
28 | - export GAPROOT="$HOME/gap" | |
29 | - scripts/build_gap.sh | |
30 | script: | |
31 | - scripts/build_pkg.sh && scripts/run_tests.sh | |
32 | after_script: | |
33 | - bash scripts/gather-coverage.sh | |
34 | - bash <(curl -s https://codecov.io/bash) |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <title>GAP (FactInt) - Contents</title> | |
8 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
9 | <meta name="generator" content="GAPDoc2HTML" /> | |
10 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
11 | <script src="manual.js" type="text/javascript"></script> | |
12 | <script type="text/javascript">overwriteStyle();</script> | |
13 | </head> | |
14 | <body class="chap0" onload="jscontent()"> | |
15 | ||
16 | ||
17 | <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> | |
18 | ||
19 | <div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap1.html">[Next Chapter]</a> </div> | |
20 | ||
21 | <p id="mathjaxlink" class="pcenter"><a href="chap0_mj.html">[MathJax on]</a></p> | |
22 | <p><a id="X7D2C85EC87DD46E5" name="X7D2C85EC87DD46E5"></a></p> | |
23 | <div class="pcenter"> | |
24 | ||
25 | <h1>FactInt</h1> | |
26 | ||
27 | ||
28 | <h2>Advanced Methods for Factoring Integers</h2> | |
29 | ||
30 | <p> | |
31 | 1.6.2</p> | |
32 | ||
33 | <p> | |
34 | 18 February 2018 | |
35 | </p> | |
36 | ||
37 | </div> | |
38 | <p><b> | |
39 | Stefan Kohl | |
40 | ||
41 | ||
42 | ||
43 | </b> | |
44 | <br />Email: <span class="URL"><a href="mailto:stefan@gap-system.org">stefan@gap-system.org</a></span> | |
45 | <br />Homepage: <span class="URL"><a href="https://stefan-kohl.github.io/">https://stefan-kohl.github.io/</a></span> | |
46 | </p><p><b> | |
47 | Alexander Konovalov | |
48 | ||
49 | ||
50 | ||
51 | ||
52 | </b> | |
53 | <br />Email: <span class="URL"><a href="mailto:alexander.konovalov@st-andrews.ac.uk">alexander.konovalov@st-andrews.ac.uk</a></span> | |
54 | <br />Homepage: <span class="URL"><a href="https://alexk.host.cs.st-andrews.ac.uk">https://alexk.host.cs.st-andrews.ac.uk</a></span> | |
55 | <br />Address: <br />School of Computer Science<br /> University of St Andrews<br /> Jack Cole Building, North Haugh,<br /> St Andrews, Fife, KY16 9SX, Scotland<br /> | |
56 | </p> | |
57 | ||
58 | <p><a id="X7AA6C5737B711C89" name="X7AA6C5737B711C89"></a></p> | |
59 | <h3>Abstract</h3> | |
60 | <p>This package for <strong class="pkg">GAP</strong> 4 provides a general-purpose integer factorization routine, which makes use of a combination of factoring methods. In particular it contains implementations of the following algorithms:</p> | |
61 | ||
62 | ||
63 | <ul> | |
64 | <li><p>Pollard's <span class="SimpleMath">p-1</span></p> | |
65 | ||
66 | </li> | |
67 | <li><p>Williams' <span class="SimpleMath">p+1</span></p> | |
68 | ||
69 | </li> | |
70 | <li><p>Elliptic Curves Method (ECM)</p> | |
71 | ||
72 | </li> | |
73 | <li><p>Continued Fraction Algorithm (CFRAC)</p> | |
74 | ||
75 | </li> | |
76 | <li><p>Multiple Polynomial Quadratic Sieve (MPQS)</p> | |
77 | ||
78 | </li> | |
79 | </ul> | |
80 | <p>It also contains code by Frank Lübeck for making use of Richard P. Brent's tables of factors of integers of the form <span class="SimpleMath">b^k ± 1</span>. <strong class="pkg">FactInt</strong> is completely written in the <strong class="pkg">GAP</strong> language and contains / requires no external binaries. It needs <strong class="pkg">GAPDoc</strong> 1.6 <a href="chapBib.html#biBGAPDoc">[LN17]</a> or higher. <strong class="pkg">FactInt</strong> must be installed in the <code class="file">pkg</code> subdirectory of the <strong class="pkg">GAP</strong> distribution.</p> | |
81 | ||
82 | <p><a id="X81488B807F2A1CF1" name="X81488B807F2A1CF1"></a></p> | |
83 | <h3>Copyright</h3> | |
84 | <p>© 1999 - 2017 by Stefan Kohl.</p> | |
85 | ||
86 | <p><strong class="pkg">FactInt</strong> is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.</p> | |
87 | ||
88 | <p><strong class="pkg">FactInt</strong> is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p> | |
89 | ||
90 | <p>For a copy of the GNU General Public License, see the file <code class="file">GPL</code> in the <code class="file">etc</code> directory of the <strong class="pkg">GAP</strong> distribution or see <span class="URL"><a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></span>.</p> | |
91 | ||
92 | <p><a id="X82A988D47DFAFCFA" name="X82A988D47DFAFCFA"></a></p> | |
93 | <h3>Acknowledgements</h3> | |
94 | <p>I would like to thank Bettina Eick and Steve Linton for their support and many interesting discussions.</p> | |
95 | ||
96 | <p><a id="X8537FEB07AF2BEC8" name="X8537FEB07AF2BEC8"></a></p> | |
97 | ||
98 | <div class="contents"> | |
99 | <h3>Contents<a id="contents" name="contents"></a></h3> | |
100 | ||
101 | <div class="ContChap"><a href="chap1.html#X874E1D45845007FE">1 <span class="Heading">Preface</span></a> | |
102 | </div> | |
103 | <div class="ContChap"><a href="chap2.html#X7B1A84BB788FC526">2 <span class="Heading">The General Factorization Routine</span></a> | |
104 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2.html#X83BF2CD28017ABC5">2.1 <span class="Heading">The method for <code class="code">Factors</code></span></a> | |
105 | </span> | |
106 | <div class="ContSSBlock"> | |
107 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X833B087D7A83BC7A">2.1-1 Factors</a></span> | |
108 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X866CD23D78460060">2.1-2 FactInt</a></span> | |
109 | </div></div> | |
110 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2.html#X80EB87DD80462F80">2.2 <span class="Heading">Getting information about the factoring process</span></a> | |
111 | </span> | |
112 | <div class="ContSSBlock"> | |
113 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X8093BB787C2E764B">2.2-1 InfoFactInt</a></span> | |
114 | </div></div> | |
115 | </div> | |
116 | <div class="ContChap"><a href="chap3.html#X7E7EE1A1785A8009">3 <span class="Heading">The Routines for Specific Factorization Methods</span></a> | |
117 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X7A0392177E697956">3.1 <span class="Heading">Trial division</span></a> | |
118 | </span> | |
119 | <div class="ContSSBlock"> | |
120 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X7C4D255A789F54B4">3.1-1 FactorsTD</a></span> | |
121 | </div></div> | |
122 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X8081FF657DA9C674">3.2 <span class="Heading">Pollard's <span class="SimpleMath">p-1</span></span></a> | |
123 | </span> | |
124 | <div class="ContSSBlock"> | |
125 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X7AF95E2E87F58200">3.2-1 FactorsPminus1</a></span> | |
126 | </div></div> | |
127 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X860B4BE37DABDE10">3.3 <span class="Heading">Williams' <span class="SimpleMath">p+1</span></span></a> | |
128 | </span> | |
129 | <div class="ContSSBlock"> | |
130 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X8079A0367DE4FC35">3.3-1 FactorsPplus1</a></span> | |
131 | </div></div> | |
132 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X7837106783A5194B">3.4 <span class="Heading">The Elliptic Curves Method (ECM)</span></a> | |
133 | </span> | |
134 | <div class="ContSSBlock"> | |
135 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X87B162F878AD031C">3.4-1 FactorsECM</a></span> | |
136 | </div></div> | |
137 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X78466BB97BEE5495">3.5 <span class="Heading">The Continued Fraction Algorithm (CFRAC)</span></a> | |
138 | </span> | |
139 | <div class="ContSSBlock"> | |
140 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X7A5C8BC5861CFC8C">3.5-1 FactorsCFRAC</a></span> | |
141 | </div></div> | |
142 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X7A5C621C7FCFAA8A">3.6 <span class="Heading">The Multiple Polynomial Quadratic Sieve (MPQS)</span></a> | |
143 | </span> | |
144 | <div class="ContSSBlock"> | |
145 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X86F8DFB681442E05">3.6-1 FactorsMPQS</a></span> | |
146 | </div></div> | |
147 | </div> | |
148 | <div class="ContChap"><a href="chap4.html#X85B6B6E4796B99EE">4 <span class="Heading">How much Time does a Factorization take?</span></a> | |
149 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4.html#X825FC33479FE2B1D">4.1 <span class="Heading">Timings for the general factorization routine</span></a> | |
150 | </span> | |
151 | </div> | |
152 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4.html#X8131C8BD7F637545">4.2 <span class="Heading">Timings for the ECM</span></a> | |
153 | </span> | |
154 | </div> | |
155 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4.html#X7E2D09BD7AD0D77F">4.3 <span class="Heading">Timings for the MPQS</span></a> | |
156 | </span> | |
157 | </div> | |
158 | </div> | |
159 | <div class="ContChap"><a href="chapBib.html"><span class="Heading">References</span></a></div> | |
160 | <div class="ContChap"><a href="chapInd.html"><span class="Heading">Index</span></a></div> | |
161 | <br /> | |
162 | </div> | |
163 | ||
164 | <div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap1.html">[Next Chapter]</a> </div> | |
165 | ||
166 | ||
167 | <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> | |
168 | ||
169 | <hr /> | |
170 | <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> | |
171 | </body> | |
172 | </html> |
0 | ||
1 | ||
2 | [1X FactInt [101X | |
3 | ||
4 | ||
5 | [1X Advanced Methods for Factoring Integers [101X | |
6 | ||
7 | ||
8 | 1.6.2 | |
9 | ||
10 | ||
11 | 18 February 2018 | |
12 | ||
13 | ||
14 | Stefan Kohl | |
15 | ||
16 | Alexander Konovalov | |
17 | ||
18 | ||
19 | ||
20 | Stefan Kohl | |
21 | Email: [7Xmailto:stefan@gap-system.org[107X | |
22 | Homepage: [7Xhttps://stefan-kohl.github.io/[107X | |
23 | Alexander Konovalov | |
24 | Email: [7Xmailto:alexander.konovalov@st-andrews.ac.uk[107X | |
25 | Homepage: [7Xhttps://alexk.host.cs.st-andrews.ac.uk[107X | |
26 | Address: [33X[0;14YSchool of Computer Science[133X | |
27 | [33X[0;14YUniversity of St Andrews[133X | |
28 | [33X[0;14YJack Cole Building, North Haugh,[133X | |
29 | [33X[0;14YSt Andrews, Fife, KY16 9SX, Scotland[133X | |
30 | ||
31 | ||
32 | ||
33 | ------------------------------------------------------- | |
34 | [1XAbstract[101X | |
35 | [33X[0;0YThis package for [5XGAP[105X 4 provides a general-purpose integer factorization | |
36 | routine, which makes use of a combination of factoring methods. In | |
37 | particular it contains implementations of the following algorithms:[133X | |
38 | ||
39 | [30X [33X[0;6YPollard's [22Xp-1[122X[133X | |
40 | ||
41 | [30X [33X[0;6YWilliams' [22Xp+1[122X[133X | |
42 | ||
43 | [30X [33X[0;6YElliptic Curves Method (ECM)[133X | |
44 | ||
45 | [30X [33X[0;6YContinued Fraction Algorithm (CFRAC)[133X | |
46 | ||
47 | [30X [33X[0;6YMultiple Polynomial Quadratic Sieve (MPQS)[133X | |
48 | ||
49 | [33X[0;0YIt also contains code by Frank Lübeck for making use of Richard P. Brent's | |
50 | tables of factors of integers of the form [22Xb^k ± 1[122X. [5XFactInt[105X is completely | |
51 | written in the [5XGAP[105X language and contains / requires no external binaries. It | |
52 | needs [5XGAPDoc[105X 1.6 [LN17] or higher. [5XFactInt[105X must be installed in the [11Xpkg[111X | |
53 | subdirectory of the [5XGAP[105X distribution.[133X | |
54 | ||
55 | ||
56 | ------------------------------------------------------- | |
57 | [1XCopyright[101X | |
58 | [33X[0;0Y© 1999 - 2017 by Stefan Kohl.[133X | |
59 | ||
60 | [33X[0;0Y[5XFactInt[105X is free software: you can redistribute it and/or modify it under the | |
61 | terms of the GNU General Public License as published by the Free Software | |
62 | Foundation, either version 2 of the License, or (at your option) any later | |
63 | version.[133X | |
64 | ||
65 | [33X[0;0Y[5XFactInt[105X is distributed in the hope that it will be useful, but WITHOUT ANY | |
66 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
67 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | |
68 | details.[133X | |
69 | ||
70 | [33X[0;0YFor a copy of the GNU General Public License, see the file [11XGPL[111X in the [11Xetc[111X | |
71 | directory of the [5XGAP[105X distribution or see | |
72 | [7Xhttp://www.gnu.org/licenses/gpl.html[107X.[133X | |
73 | ||
74 | ||
75 | ------------------------------------------------------- | |
76 | [1XAcknowledgements[101X | |
77 | [33X[0;0YI would like to thank Bettina Eick and Steve Linton for their support and | |
78 | many interesting discussions.[133X | |
79 | ||
80 | ||
81 | ------------------------------------------------------- | |
82 | ||
83 | ||
84 | [1XContents (FactInt)[101X | |
85 | ||
86 | 1 [33X[0;0YPreface[133X | |
87 | 2 [33X[0;0YThe General Factorization Routine[133X | |
88 | 2.1 [33X[0;0YThe method for [10XFactors[110X[133X | |
89 | 2.1-1 Factors | |
90 | 2.1-2 FactInt | |
91 | 2.2 [33X[0;0YGetting information about the factoring process[133X | |
92 | 2.2-1 InfoFactInt | |
93 | 3 [33X[0;0YThe Routines for Specific Factorization Methods[133X | |
94 | 3.1 [33X[0;0YTrial division[133X | |
95 | 3.1-1 FactorsTD | |
96 | 3.2 [33X[0;0YPollard's [22Xp-1[122X[133X | |
97 | 3.2-1 FactorsPminus1 | |
98 | 3.3 [33X[0;0YWilliams' [22Xp+1[122X[133X | |
99 | 3.3-1 FactorsPplus1 | |
100 | 3.4 [33X[0;0YThe Elliptic Curves Method (ECM)[133X | |
101 | 3.4-1 FactorsECM | |
102 | 3.5 [33X[0;0YThe Continued Fraction Algorithm (CFRAC)[133X | |
103 | 3.5-1 FactorsCFRAC | |
104 | 3.6 [33X[0;0YThe Multiple Polynomial Quadratic Sieve (MPQS)[133X | |
105 | 3.6-1 FactorsMPQS | |
106 | 4 [33X[0;0YHow much Time does a Factorization take?[133X | |
107 | 4.1 [33X[0;0YTimings for the general factorization routine[133X | |
108 | 4.2 [33X[0;0YTimings for the ECM[133X | |
109 | 4.3 [33X[0;0YTimings for the MPQS[133X | |
110 | ||
111 | ||
112 | [32X |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <script type="text/javascript" | |
8 | src="http://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> | |
9 | </script> | |
10 | <title>GAP (FactInt) - Contents</title> | |
11 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
12 | <meta name="generator" content="GAPDoc2HTML" /> | |
13 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
14 | <script src="manual.js" type="text/javascript"></script> | |
15 | <script type="text/javascript">overwriteStyle();</script> | |
16 | </head> | |
17 | <body class="chap0" onload="jscontent()"> | |
18 | ||
19 | ||
20 | <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div> | |
21 | ||
22 | <div class="chlinkprevnexttop"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap1_mj.html">[Next Chapter]</a> </div> | |
23 | ||
24 | <p id="mathjaxlink" class="pcenter"><a href="chap0.html">[MathJax off]</a></p> | |
25 | <p><a id="X7D2C85EC87DD46E5" name="X7D2C85EC87DD46E5"></a></p> | |
26 | <div class="pcenter"> | |
27 | ||
28 | <h1>FactInt</h1> | |
29 | ||
30 | ||
31 | <h2>Advanced Methods for Factoring Integers</h2> | |
32 | ||
33 | <p> | |
34 | 1.6.2</p> | |
35 | ||
36 | <p> | |
37 | 18 February 2018 | |
38 | </p> | |
39 | ||
40 | </div> | |
41 | <p><b> | |
42 | Stefan Kohl | |
43 | ||
44 | ||
45 | ||
46 | </b> | |
47 | <br />Email: <span class="URL"><a href="mailto:stefan@gap-system.org">stefan@gap-system.org</a></span> | |
48 | <br />Homepage: <span class="URL"><a href="https://stefan-kohl.github.io/">https://stefan-kohl.github.io/</a></span> | |
49 | </p><p><b> | |
50 | Alexander Konovalov | |
51 | ||
52 | ||
53 | ||
54 | ||
55 | </b> | |
56 | <br />Email: <span class="URL"><a href="mailto:alexander.konovalov@st-andrews.ac.uk">alexander.konovalov@st-andrews.ac.uk</a></span> | |
57 | <br />Homepage: <span class="URL"><a href="https://alexk.host.cs.st-andrews.ac.uk">https://alexk.host.cs.st-andrews.ac.uk</a></span> | |
58 | <br />Address: <br />School of Computer Science<br /> University of St Andrews<br /> Jack Cole Building, North Haugh,<br /> St Andrews, Fife, KY16 9SX, Scotland<br /> | |
59 | </p> | |
60 | ||
61 | <p><a id="X7AA6C5737B711C89" name="X7AA6C5737B711C89"></a></p> | |
62 | <h3>Abstract</h3> | |
63 | <p>This package for <strong class="pkg">GAP</strong> 4 provides a general-purpose integer factorization routine, which makes use of a combination of factoring methods. In particular it contains implementations of the following algorithms:</p> | |
64 | ||
65 | ||
66 | <ul> | |
67 | <li><p>Pollard's <span class="SimpleMath">\(p-1\)</span></p> | |
68 | ||
69 | </li> | |
70 | <li><p>Williams' <span class="SimpleMath">\(p+1\)</span></p> | |
71 | ||
72 | </li> | |
73 | <li><p>Elliptic Curves Method (ECM)</p> | |
74 | ||
75 | </li> | |
76 | <li><p>Continued Fraction Algorithm (CFRAC)</p> | |
77 | ||
78 | </li> | |
79 | <li><p>Multiple Polynomial Quadratic Sieve (MPQS)</p> | |
80 | ||
81 | </li> | |
82 | </ul> | |
83 | <p>It also contains code by Frank Lübeck for making use of Richard P. Brent's tables of factors of integers of the form <span class="SimpleMath">\(b^k \pm 1\)</span>. <strong class="pkg">FactInt</strong> is completely written in the <strong class="pkg">GAP</strong> language and contains / requires no external binaries. It needs <strong class="pkg">GAPDoc</strong> 1.6 <a href="chapBib_mj.html#biBGAPDoc">[LN17]</a> or higher. <strong class="pkg">FactInt</strong> must be installed in the <code class="file">pkg</code> subdirectory of the <strong class="pkg">GAP</strong> distribution.</p> | |
84 | ||
85 | <p><a id="X81488B807F2A1CF1" name="X81488B807F2A1CF1"></a></p> | |
86 | <h3>Copyright</h3> | |
87 | <p>© 1999 - 2017 by Stefan Kohl.</p> | |
88 | ||
89 | <p><strong class="pkg">FactInt</strong> is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.</p> | |
90 | ||
91 | <p><strong class="pkg">FactInt</strong> is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p> | |
92 | ||
93 | <p>For a copy of the GNU General Public License, see the file <code class="file">GPL</code> in the <code class="file">etc</code> directory of the <strong class="pkg">GAP</strong> distribution or see <span class="URL"><a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></span>.</p> | |
94 | ||
95 | <p><a id="X82A988D47DFAFCFA" name="X82A988D47DFAFCFA"></a></p> | |
96 | <h3>Acknowledgements</h3> | |
97 | <p>I would like to thank Bettina Eick and Steve Linton for their support and many interesting discussions.</p> | |
98 | ||
99 | <p><a id="X8537FEB07AF2BEC8" name="X8537FEB07AF2BEC8"></a></p> | |
100 | ||
101 | <div class="contents"> | |
102 | <h3>Contents<a id="contents" name="contents"></a></h3> | |
103 | ||
104 | <div class="ContChap"><a href="chap1_mj.html#X874E1D45845007FE">1 <span class="Heading">Preface</span></a> | |
105 | </div> | |
106 | <div class="ContChap"><a href="chap2_mj.html#X7B1A84BB788FC526">2 <span class="Heading">The General Factorization Routine</span></a> | |
107 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2_mj.html#X83BF2CD28017ABC5">2.1 <span class="Heading">The method for <code class="code">Factors</code></span></a> | |
108 | </span> | |
109 | <div class="ContSSBlock"> | |
110 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap2_mj.html#X833B087D7A83BC7A">2.1-1 Factors</a></span> | |
111 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap2_mj.html#X866CD23D78460060">2.1-2 FactInt</a></span> | |
112 | </div></div> | |
113 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2_mj.html#X80EB87DD80462F80">2.2 <span class="Heading">Getting information about the factoring process</span></a> | |
114 | </span> | |
115 | <div class="ContSSBlock"> | |
116 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap2_mj.html#X8093BB787C2E764B">2.2-1 InfoFactInt</a></span> | |
117 | </div></div> | |
118 | </div> | |
119 | <div class="ContChap"><a href="chap3_mj.html#X7E7EE1A1785A8009">3 <span class="Heading">The Routines for Specific Factorization Methods</span></a> | |
120 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X7A0392177E697956">3.1 <span class="Heading">Trial division</span></a> | |
121 | </span> | |
122 | <div class="ContSSBlock"> | |
123 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X7C4D255A789F54B4">3.1-1 FactorsTD</a></span> | |
124 | </div></div> | |
125 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X8081FF657DA9C674">3.2 <span class="Heading">Pollard's <span class="SimpleMath">\(p-1\)</span></span></a> | |
126 | </span> | |
127 | <div class="ContSSBlock"> | |
128 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X7AF95E2E87F58200">3.2-1 FactorsPminus1</a></span> | |
129 | </div></div> | |
130 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X860B4BE37DABDE10">3.3 <span class="Heading">Williams' <span class="SimpleMath">\(p+1\)</span></span></a> | |
131 | </span> | |
132 | <div class="ContSSBlock"> | |
133 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X8079A0367DE4FC35">3.3-1 FactorsPplus1</a></span> | |
134 | </div></div> | |
135 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X7837106783A5194B">3.4 <span class="Heading">The Elliptic Curves Method (ECM)</span></a> | |
136 | </span> | |
137 | <div class="ContSSBlock"> | |
138 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X87B162F878AD031C">3.4-1 FactorsECM</a></span> | |
139 | </div></div> | |
140 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X78466BB97BEE5495">3.5 <span class="Heading">The Continued Fraction Algorithm (CFRAC)</span></a> | |
141 | </span> | |
142 | <div class="ContSSBlock"> | |
143 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X7A5C8BC5861CFC8C">3.5-1 FactorsCFRAC</a></span> | |
144 | </div></div> | |
145 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X7A5C621C7FCFAA8A">3.6 <span class="Heading">The Multiple Polynomial Quadratic Sieve (MPQS)</span></a> | |
146 | </span> | |
147 | <div class="ContSSBlock"> | |
148 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X86F8DFB681442E05">3.6-1 FactorsMPQS</a></span> | |
149 | </div></div> | |
150 | </div> | |
151 | <div class="ContChap"><a href="chap4_mj.html#X85B6B6E4796B99EE">4 <span class="Heading">How much Time does a Factorization take?</span></a> | |
152 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4_mj.html#X825FC33479FE2B1D">4.1 <span class="Heading">Timings for the general factorization routine</span></a> | |
153 | </span> | |
154 | </div> | |
155 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4_mj.html#X8131C8BD7F637545">4.2 <span class="Heading">Timings for the ECM</span></a> | |
156 | </span> | |
157 | </div> | |
158 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4_mj.html#X7E2D09BD7AD0D77F">4.3 <span class="Heading">Timings for the MPQS</span></a> | |
159 | </span> | |
160 | </div> | |
161 | </div> | |
162 | <div class="ContChap"><a href="chapBib_mj.html"><span class="Heading">References</span></a></div> | |
163 | <div class="ContChap"><a href="chapInd_mj.html"><span class="Heading">Index</span></a></div> | |
164 | <br /> | |
165 | </div> | |
166 | ||
167 | <div class="chlinkprevnextbot"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap1_mj.html">[Next Chapter]</a> </div> | |
168 | ||
169 | ||
170 | <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div> | |
171 | ||
172 | <hr /> | |
173 | <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> | |
174 | </body> | |
175 | </html> |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <title>GAP (FactInt) - Chapter 1: Preface</title> | |
8 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
9 | <meta name="generator" content="GAPDoc2HTML" /> | |
10 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
11 | <script src="manual.js" type="text/javascript"></script> | |
12 | <script type="text/javascript">overwriteStyle();</script> | |
13 | </head> | |
14 | <body class="chap1" onload="jscontent()"> | |
15 | ||
16 | ||
17 | <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> | |
18 | ||
19 | <div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap0.html">[Previous Chapter]</a> <a href="chap2.html">[Next Chapter]</a> </div> | |
20 | ||
21 | <p id="mathjaxlink" class="pcenter"><a href="chap1_mj.html">[MathJax on]</a></p> | |
22 | <p><a id="X874E1D45845007FE" name="X874E1D45845007FE"></a></p> | |
23 | <div class="ChapSects"><a href="chap1.html#X874E1D45845007FE">1 <span class="Heading">Preface</span></a> | |
24 | </div> | |
25 | ||
26 | <h3>1 <span class="Heading">Preface</span></h3> | |
27 | ||
28 | <p>Factoring large integers is a computationally very difficult problem, and there is no general factorization algorithm known which can be used for factoring products of two primes with more than about 100 decimal digits each on currently existing computers. But there are methods (not algorithms in the sense that it is guaranteed that they will give the desired result after a finite number of steps) for factoring integers with prime factors being far beyond the range where trial division is feasible.</p> | |
29 | ||
30 | <p>One important class of such methods is based on exponentiation in suitably chosen groups acting on subsets of the <span class="SimpleMath">k</span>-fold cartesian product of the set of residue classes (mod <span class="SimpleMath">n</span>), where <span class="SimpleMath">n</span> denotes the number to be factored. Representatives of this class are the Elliptic Curves Method (ECM), Pollard's <span class="SimpleMath">p-1</span> and Williams' <span class="SimpleMath">p+1</span>. These methods have the important property that they find smaller factors usually considerably faster than larger ones. This however comes along with the drawback of suboptimal performance for large factors.</p> | |
31 | ||
32 | <p>The other important class consists of the so-called factor base methods. Their run time depends only on the size of the number <span class="SimpleMath">n</span> to be factored, and not on the size of its factors. Factor base methods compute factorizations of perfect squares (mod <span class="SimpleMath">n</span>) over an appropriately chosen factor base. A factor base is a set of small prime numbers, or of prime ideals in the case of the Generalized Number Field Sieve. The factor base methods use these factorizations to determine a pair of integers <span class="SimpleMath">(x,y)</span> such that <span class="SimpleMath">x^2</span> and <span class="SimpleMath">y^2</span> are congruent (mod <span class="SimpleMath">n</span>), but <span class="SimpleMath">± x</span> and <span class="SimpleMath">± y</span> are not. In this situation, taking <span class="SimpleMath">gcd(n,x-y)</span> will yield a nontrivial divisor of <span class="SimpleMath">n</span>. Representatives of this class are the Continued Fraction Algorithm (CFRAC), the Multiple Polynomial Quadratic Sieve (MPQS) and the already mentioned Generalized Number Field Sieve (GNFS). The latter has the asymptotically lowest average-case complexity of all factoring methods known today. It has however the drawback of being more efficient than the MPQS only for numbers with more than about 100 decimal digits, which is probably not within the feasible range of such a function implemented in <strong class="pkg">GAP</strong>. The first two methods are implemented in this package.</p> | |
33 | ||
34 | <p>Except of the "naive" methods like trial division and some "historical" methods, the only method which I am aware of that does not fit into one of the two classes mentioned above is Pollard's Rho, which is already implemented in the <strong class="pkg">GAP</strong> Library.</p> | |
35 | ||
36 | <p>With respect to the current state-of-the-art in integer factorization, see the <span class="URL"><a href=" http://www.rsasecurity.com/rsalabs/node.asp?id=2093">Factoring Challenge</a></span> of the RSA Laboratories.</p> | |
37 | ||
38 | ||
39 | <div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap0.html">[Previous Chapter]</a> <a href="chap2.html">[Next Chapter]</a> </div> | |
40 | ||
41 | ||
42 | <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> | |
43 | ||
44 | <hr /> | |
45 | <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> | |
46 | </body> | |
47 | </html> |
0 | ||
1 | [1X1 [33X[0;0YPreface[133X[101X | |
2 | ||
3 | [33X[0;0YFactoring large integers is a computationally very difficult problem, and | |
4 | there is no general factorization algorithm known which can be used for | |
5 | factoring products of two primes with more than about 100 decimal digits | |
6 | each on currently existing computers. But there are methods (not algorithms | |
7 | in the sense that it is guaranteed that they will give the desired result | |
8 | after a finite number of steps) for factoring integers with prime factors | |
9 | being far beyond the range where trial division is feasible.[133X | |
10 | ||
11 | [33X[0;0YOne important class of such methods is based on exponentiation in suitably | |
12 | chosen groups acting on subsets of the [22Xk[122X-fold cartesian product of the set | |
13 | of residue classes (mod [22Xn[122X), where [22Xn[122X denotes the number to be factored. | |
14 | Representatives of this class are the Elliptic Curves Method (ECM), | |
15 | Pollard's [22Xp-1[122X and Williams' [22Xp+1[122X. These methods have the important property | |
16 | that they find smaller factors usually considerably faster than larger ones. | |
17 | This however comes along with the drawback of suboptimal performance for | |
18 | large factors.[133X | |
19 | ||
20 | [33X[0;0YThe other important class consists of the so-called factor base methods. | |
21 | Their run time depends only on the size of the number [22Xn[122X to be factored, and | |
22 | not on the size of its factors. Factor base methods compute factorizations | |
23 | of perfect squares (mod [22Xn[122X) over an appropriately chosen factor base. A | |
24 | factor base is a set of small prime numbers, or of prime ideals in the case | |
25 | of the Generalized Number Field Sieve. The factor base methods use these | |
26 | factorizations to determine a pair of integers [22X(x,y)[122X such that [22Xx^2[122X and [22Xy^2[122X | |
27 | are congruent (mod [22Xn[122X), but [22X± x[122X and [22X± y[122X are not. In this situation, taking | |
28 | [22Xgcd(n,x-y)[122X will yield a nontrivial divisor of [22Xn[122X. Representatives of this | |
29 | class are the Continued Fraction Algorithm (CFRAC), the Multiple Polynomial | |
30 | Quadratic Sieve (MPQS) and the already mentioned Generalized Number Field | |
31 | Sieve (GNFS). The latter has the asymptotically lowest average-case | |
32 | complexity of all factoring methods known today. It has however the drawback | |
33 | of being more efficient than the MPQS only for numbers with more than about | |
34 | 100 decimal digits, which is probably not within the feasible range of such | |
35 | a function implemented in [5XGAP[105X. The first two methods are implemented in this | |
36 | package.[133X | |
37 | ||
38 | [33X[0;0YExcept of the [21Xnaive[121X methods like trial division and some [21Xhistorical[121X methods, | |
39 | the only method which I am aware of that does not fit into one of the two | |
40 | classes mentioned above is Pollard's Rho, which is already implemented in | |
41 | the [5XGAP[105X Library.[133X | |
42 | ||
43 | [33X[0;0YWith respect to the current state-of-the-art in integer factorization, see | |
44 | the Factoring Challenge | |
45 | ([7Xhttp://www.rsasecurity.com/rsalabs/node.asp?id=2093[107X) of the RSA | |
46 | Laboratories.[133X | |
47 |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <script type="text/javascript" | |
8 | src="http://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> | |
9 | </script> | |
10 | <title>GAP (FactInt) - Chapter 1: Preface</title> | |
11 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
12 | <meta name="generator" content="GAPDoc2HTML" /> | |
13 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
14 | <script src="manual.js" type="text/javascript"></script> | |
15 | <script type="text/javascript">overwriteStyle();</script> | |
16 | </head> | |
17 | <body class="chap1" onload="jscontent()"> | |
18 | ||
19 | ||
20 | <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div> | |
21 | ||
22 | <div class="chlinkprevnexttop"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap0_mj.html">[Previous Chapter]</a> <a href="chap2_mj.html">[Next Chapter]</a> </div> | |
23 | ||
24 | <p id="mathjaxlink" class="pcenter"><a href="chap1.html">[MathJax off]</a></p> | |
25 | <p><a id="X874E1D45845007FE" name="X874E1D45845007FE"></a></p> | |
26 | <div class="ChapSects"><a href="chap1_mj.html#X874E1D45845007FE">1 <span class="Heading">Preface</span></a> | |
27 | </div> | |
28 | ||
29 | <h3>1 <span class="Heading">Preface</span></h3> | |
30 | ||
31 | <p>Factoring large integers is a computationally very difficult problem, and there is no general factorization algorithm known which can be used for factoring products of two primes with more than about 100 decimal digits each on currently existing computers. But there are methods (not algorithms in the sense that it is guaranteed that they will give the desired result after a finite number of steps) for factoring integers with prime factors being far beyond the range where trial division is feasible.</p> | |
32 | ||
33 | <p>One important class of such methods is based on exponentiation in suitably chosen groups acting on subsets of the <span class="SimpleMath">\(k\)</span>-fold cartesian product of the set of residue classes (mod <span class="SimpleMath">\(n\)</span>), where <span class="SimpleMath">\(n\)</span> denotes the number to be factored. Representatives of this class are the Elliptic Curves Method (ECM), Pollard's <span class="SimpleMath">\(p-1\)</span> and Williams' <span class="SimpleMath">\(p+1\)</span>. These methods have the important property that they find smaller factors usually considerably faster than larger ones. This however comes along with the drawback of suboptimal performance for large factors.</p> | |
34 | ||
35 | <p>The other important class consists of the so-called factor base methods. Their run time depends only on the size of the number <span class="SimpleMath">\(n\)</span> to be factored, and not on the size of its factors. Factor base methods compute factorizations of perfect squares (mod <span class="SimpleMath">\(n\)</span>) over an appropriately chosen factor base. A factor base is a set of small prime numbers, or of prime ideals in the case of the Generalized Number Field Sieve. The factor base methods use these factorizations to determine a pair of integers <span class="SimpleMath">\((x,y)\)</span> such that <span class="SimpleMath">\(x^2\)</span> and <span class="SimpleMath">\(y^2\)</span> are congruent (mod <span class="SimpleMath">\(n\)</span>), but <span class="SimpleMath">\(\pm x\)</span> and <span class="SimpleMath">\(\pm y\)</span> are not. In this situation, taking <span class="SimpleMath">\(\gcd(n,x-y)\)</span> will yield a nontrivial divisor of <span class="SimpleMath">\(n\)</span>. Representatives of this class are the Continued Fraction Algorithm (CFRAC), the Multiple Polynomial Quadratic Sieve (MPQS) and the already mentioned Generalized Number Field Sieve (GNFS). The latter has the asymptotically lowest average-case complexity of all factoring methods known today. It has however the drawback of being more efficient than the MPQS only for numbers with more than about 100 decimal digits, which is probably not within the feasible range of such a function implemented in <strong class="pkg">GAP</strong>. The first two methods are implemented in this package.</p> | |
36 | ||
37 | <p>Except of the "naive" methods like trial division and some "historical" methods, the only method which I am aware of that does not fit into one of the two classes mentioned above is Pollard's Rho, which is already implemented in the <strong class="pkg">GAP</strong> Library.</p> | |
38 | ||
39 | <p>With respect to the current state-of-the-art in integer factorization, see the <span class="URL"><a href=" http://www.rsasecurity.com/rsalabs/node.asp?id=2093">Factoring Challenge</a></span> of the RSA Laboratories.</p> | |
40 | ||
41 | ||
42 | <div class="chlinkprevnextbot"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap0_mj.html">[Previous Chapter]</a> <a href="chap2_mj.html">[Next Chapter]</a> </div> | |
43 | ||
44 | ||
45 | <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div> | |
46 | ||
47 | <hr /> | |
48 | <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> | |
49 | </body> | |
50 | </html> |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <title>GAP (FactInt) - Chapter 2: The General Factorization Routine</title> | |
8 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
9 | <meta name="generator" content="GAPDoc2HTML" /> | |
10 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
11 | <script src="manual.js" type="text/javascript"></script> | |
12 | <script type="text/javascript">overwriteStyle();</script> | |
13 | </head> | |
14 | <body class="chap2" onload="jscontent()"> | |
15 | ||
16 | ||
17 | <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> | |
18 | ||
19 | <div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap1.html">[Previous Chapter]</a> <a href="chap3.html">[Next Chapter]</a> </div> | |
20 | ||
21 | <p id="mathjaxlink" class="pcenter"><a href="chap2_mj.html">[MathJax on]</a></p> | |
22 | <p><a id="X7B1A84BB788FC526" name="X7B1A84BB788FC526"></a></p> | |
23 | <div class="ChapSects"><a href="chap2.html#X7B1A84BB788FC526">2 <span class="Heading">The General Factorization Routine</span></a> | |
24 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2.html#X83BF2CD28017ABC5">2.1 <span class="Heading">The method for <code class="code">Factors</code></span></a> | |
25 | </span> | |
26 | <div class="ContSSBlock"> | |
27 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X833B087D7A83BC7A">2.1-1 Factors</a></span> | |
28 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X866CD23D78460060">2.1-2 FactInt</a></span> | |
29 | </div></div> | |
30 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2.html#X80EB87DD80462F80">2.2 <span class="Heading">Getting information about the factoring process</span></a> | |
31 | </span> | |
32 | <div class="ContSSBlock"> | |
33 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X8093BB787C2E764B">2.2-1 InfoFactInt</a></span> | |
34 | </div></div> | |
35 | </div> | |
36 | ||
37 | <h3>2 <span class="Heading">The General Factorization Routine</span></h3> | |
38 | ||
39 | <p><a id="X83BF2CD28017ABC5" name="X83BF2CD28017ABC5"></a></p> | |
40 | ||
41 | <h4>2.1 <span class="Heading">The method for <code class="code">Factors</code></span></h4> | |
42 | ||
43 | <p>The <strong class="pkg">FactInt</strong> package provides a better method for the operation <code class="code">Factors</code> for integer arguments, which supersedes the one included in the <strong class="pkg">GAP</strong> Library:</p> | |
44 | ||
45 | <p><a id="X833B087D7A83BC7A" name="X833B087D7A83BC7A"></a></p> | |
46 | ||
47 | <h5>2.1-1 Factors</h5> | |
48 | ||
49 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Factors</code>( <var class="Arg">n</var> )</td><td class="tdright">( method )</td></tr></table></div> | |
50 | <p>Returns: a sorted list of the prime factors of <var class="Arg">n</var>.</p> | |
51 | ||
52 | <p>The returned factors pass the built-in probabilistic primality test of <strong class="pkg">GAP</strong> (<code class="code">IsProbablyPrimeInt</code>, Baillie-PSW Primality Test; see the <strong class="pkg">GAP</strong> Reference Manual). If the method fails to compute the prime factorization of <var class="Arg">n</var>, an error is signalled. The same holds for all other factorization routines provided by this package. It follows a rough description how the factorization method works:</p> | |
53 | ||
54 | <p>First of all, the method checks whether <span class="SimpleMath">n = b^k ± 1</span> for some <span class="SimpleMath">b</span>, <span class="SimpleMath">k</span> and looks for factors corresponding to polynomial factors of <span class="SimpleMath">x^k ± 1</span>. Provided that <span class="SimpleMath">b</span> and <span class="SimpleMath">k</span> are not too large, the factors that do not correspond to polynomial factors are taken from Richard P. Brent's Factor Tables <a href="chapBib.html#biBBrent04">[Bre04]</a>. The code for accessing these tables has been contributed by Frank Lübeck.</p> | |
55 | ||
56 | <p>Then the method uses trial division and a number of cheap methods for various common special cases. After the small and other "easy" factors have been found this way, <strong class="pkg">FactInt</strong>'s method searches for "medium-sized" factors using Pollard's Rho (by the library function <code class="code">FactorsRho</code>, see the <strong class="pkg">GAP</strong> Reference Manual), Pollard's <span class="SimpleMath">p-1</span> (see <code class="func">FactorsPminus1</code> (<a href="chap3.html#X7AF95E2E87F58200"><span class="RefLink">3.2-1</span></a>)), Williams' <span class="SimpleMath">p+1</span> (see <code class="func">FactorsPplus1</code> (<a href="chap3.html#X8079A0367DE4FC35"><span class="RefLink">3.3-1</span></a>)) and the Elliptic Curves Method (ECM, see <code class="func">FactorsECM</code> (<a href="chap3.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>)) in this order.</p> | |
57 | ||
58 | <p>If there is still an unfactored part remaining after that, it is factored using the Multiple Polynomial Quadratic Sieve (MPQS, see <code class="func">FactorsMPQS</code> (<a href="chap3.html#X86F8DFB681442E05"><span class="RefLink">3.6-1</span></a>)).</p> | |
59 | ||
60 | <p>The following options are interpreted:</p> | |
61 | ||
62 | ||
63 | <dl> | |
64 | <dt><strong class="Mark"><var class="Arg">TDHints</var></strong></dt> | |
65 | <dd><p>A list of additional trial divisors. This is useful only if certain primes <span class="SimpleMath">p</span> are expected to divide <span class="SimpleMath">n</span> with probability significantly larger than <span class="SimpleMath">frac1p</span>.</p> | |
66 | ||
67 | </dd> | |
68 | <dt><strong class="Mark"><var class="Arg">RhoSteps</var></strong></dt> | |
69 | <dd><p>The number of steps for Pollard's Rho.</p> | |
70 | ||
71 | </dd> | |
72 | <dt><strong class="Mark"><var class="Arg">RhoCluster</var></strong></dt> | |
73 | <dd><p>The number of steps between two gcd computations in Pollard's Rho.</p> | |
74 | ||
75 | </dd> | |
76 | <dt><strong class="Mark"><var class="Arg">Pminus1Limit1</var> / <var class="Arg">Pminus1Limit2</var></strong></dt> | |
77 | <dd><p>The first- / second stage limit for Pollard's <span class="SimpleMath">p-1</span> (see <code class="func">FactorsPminus1</code> (<a href="chap3.html#X7AF95E2E87F58200"><span class="RefLink">3.2-1</span></a>)).</p> | |
78 | ||
79 | </dd> | |
80 | <dt><strong class="Mark"><var class="Arg">Pplus1Residues</var></strong></dt> | |
81 | <dd><p>The number of residues to be tried by Williams' <span class="SimpleMath">p+1</span> (see <code class="func">FactorsPplus1</code> (<a href="chap3.html#X8079A0367DE4FC35"><span class="RefLink">3.3-1</span></a>)).</p> | |
82 | ||
83 | </dd> | |
84 | <dt><strong class="Mark"><var class="Arg">Pplus1Limit1</var> / <var class="Arg">Pplus1Limit2</var></strong></dt> | |
85 | <dd><p>The first- / second stage limit for Williams' <span class="SimpleMath">p+1</span> (see <code class="func">FactorsPplus1</code> (<a href="chap3.html#X8079A0367DE4FC35"><span class="RefLink">3.3-1</span></a>)).</p> | |
86 | ||
87 | </dd> | |
88 | <dt><strong class="Mark"><var class="Arg">ECMCurves</var></strong></dt> | |
89 | <dd><p>The number of elliptic curves to be tried by the Elliptic Curves Method (ECM) (see <code class="func">FactorsECM</code> (<a href="chap3.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>)). Also admissible: a function that takes the number <span class="SimpleMath">n</span> to be factored as an argument and returns the desired number of curves to be tried.</p> | |
90 | ||
91 | </dd> | |
92 | <dt><strong class="Mark"><var class="Arg">ECMLimit1</var> / <var class="Arg">ECMLimit2</var></strong></dt> | |
93 | <dd><p>The initial first- / second stage limit for ECM (see <code class="func">FactorsECM</code> (<a href="chap3.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>)).</p> | |
94 | ||
95 | </dd> | |
96 | <dt><strong class="Mark"><var class="Arg">ECMDelta</var></strong></dt> | |
97 | <dd><p>The increment per curve for the first stage limit in ECM. The second stage limit is adjusted appropriately (see <code class="func">FactorsECM</code> (<a href="chap3.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>)).</p> | |
98 | ||
99 | </dd> | |
100 | <dt><strong class="Mark"><var class="Arg">ECMDeterministic</var></strong></dt> | |
101 | <dd><p>If true, ECM chooses its curves deterministically, i.e. repeatable (see <code class="func">FactorsECM</code> (<a href="chap3.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>)).</p> | |
102 | ||
103 | </dd> | |
104 | <dt><strong class="Mark"><var class="Arg">FBMethod</var></strong></dt> | |
105 | <dd><p>Specifies which of the factor base methods should be used to do the "hard work". Currently implemented: <code class="code">"CFRAC"</code> and <code class="code">"MPQS"</code> (see <code class="func">FactorsCFRAC</code> (<a href="chap3.html#X7A5C8BC5861CFC8C"><span class="RefLink">3.5-1</span></a>) and <code class="func">FactorsMPQS</code> (<a href="chap3.html#X86F8DFB681442E05"><span class="RefLink">3.6-1</span></a>), respectively). Default: <code class="code">"MPQS"</code>.</p> | |
106 | ||
107 | </dd> | |
108 | </dl> | |
109 | <p>For the use of the <strong class="pkg">GAP</strong> Options Stack, see Chapter <em>Options Stack</em> in the <strong class="pkg">GAP</strong> Reference Manual.</p> | |
110 | ||
111 | <p>Setting <var class="Arg">RhoSteps</var>, <var class="Arg">Pminus1Limit1</var>, <var class="Arg">Pplus1Residues</var>, <var class="Arg">Pplus1Limit1</var>, <var class="Arg">ECMCurves</var> or <var class="Arg">ECMLimit1</var> equal to zero switches the respective method off. The method chooses defaults for all option values that are not explicitly set by the user. The option values are also interpreted by the routines for the particular factorization methods described in the next chapter.</p> | |
112 | ||
113 | ||
114 | <div class="example"><pre> | |
115 | ||
116 | <span class="GAPprompt">gap></span> <span class="GAPinput">Factors( Factorial(44) + 1 );</span> | |
117 | [ 694763, 9245226412016162109253, 413852053257739876455072359 ] | |
118 | <span class="GAPprompt">gap></span> <span class="GAPinput">Factors( 2^997 - 1 );</span> | |
119 | [ 167560816514084819488737767976263150405095191554732902607, | |
120 | 79934306053602222928609369601238840619880168466272137576868879760059\ | |
121 | 3002563860297371289151859287894468775962208410650878341385577817736702\ | |
122 | 2158878920741413700868182301410439178049533828082651513160945607018874\ | |
123 | 830040978453228378816647358334681553 ] | |
124 | ||
125 | </pre></div> | |
126 | ||
127 | <p>The above method for <code class="code">Factors</code> calls the following function, which is the actual "working horse" of this package:</p> | |
128 | ||
129 | <p><a id="X866CD23D78460060" name="X866CD23D78460060"></a></p> | |
130 | ||
131 | <h5>2.1-2 FactInt</h5> | |
132 | ||
133 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactInt</code>( <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div> | |
134 | <p>Returns: a list of two lists, where the first list contains the determined prime factors of <var class="Arg">n</var> and the second list contains the remaining unfactored parts of <var class="Arg">n</var>, if there are any.</p> | |
135 | ||
136 | <p>This function interprets all options which are interpreted by the method for <code class="code">Factors</code> described above. In addition, it interprets the options <var class="Arg">cheap</var> and <var class="Arg">FactIntPartial</var>. If the option <var class="Arg">cheap</var> is set, only usually cheap factorization attempts are made. If the option <var class="Arg">FactIntPartial</var> is set, the factorization process is stopped before invoking the (usually time-consuming) MPQS or CFRAC, if the number of digits of the remaining unfactored part exceeds the bound passed as option value <var class="Arg">MPQSLimit</var> or <var class="Arg">CFRACLimit</var>, respectively.</p> | |
137 | ||
138 | <p><code class="code">Factors(<var class="Arg">n</var>)</code> is equivalent to <code class="code">FactInt(<var class="Arg">n</var>:<var class="Arg">cheap</var>:=false, <var class="Arg">FactIntPartial</var>:=false)[1]</code>.</p> | |
139 | ||
140 | ||
141 | <div class="example"><pre> | |
142 | ||
143 | <span class="GAPprompt">gap></span> <span class="GAPinput">FactInt( Factorial(300) + 1 : cheap );</span> | |
144 | [ [ 461, 259856122109, 995121825812791, 3909669044842609, | |
145 | 4220826953750952739, 14841043839896940772689086214475144339 ], | |
146 | [ 104831288231765723173983836560438594053336296629073932563520618687\ | |
147 | 9287645058010688827246061541065631119345674081834085960064144597037243\ | |
148 | 9235869682208979384309498719255615067943353399357029226058930732298505\ | |
149 | 5816977495398426741656633461747046623641451042655247093315505417820370\ | |
150 | 9451745871701742000546384614472756584182478531880962594857275869690727\ | |
151 | 9733563594352516014206081210368516157890709802912711149521530885498556\ | |
152 | 1244667790208245620301404499928532222524585946881528337257061789593197\ | |
153 | 99211283640357942345263781351 ] ] | |
154 | ||
155 | </pre></div> | |
156 | ||
157 | <p><a id="X80EB87DD80462F80" name="X80EB87DD80462F80"></a></p> | |
158 | ||
159 | <h4>2.2 <span class="Heading">Getting information about the factoring process</span></h4> | |
160 | ||
161 | <p>Optionally, the <strong class="pkg">FactInt</strong> package prints information on the progress of the factorization process:</p> | |
162 | ||
163 | <p><a id="X8093BB787C2E764B" name="X8093BB787C2E764B"></a></p> | |
164 | ||
165 | <h5>2.2-1 InfoFactInt</h5> | |
166 | ||
167 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ InfoFactInt</code></td><td class="tdright">( info class )</td></tr></table></div> | |
168 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactIntInfo</code>( <var class="Arg">level</var> )</td><td class="tdright">( function )</td></tr></table></div> | |
169 | <p>This Info class allows to monitor what happens during the factoring process.</p> | |
170 | ||
171 | <p>If <code class="code">InfoLevel(InfoFactInt) = 1</code>, then basic information about the factoring techniques used is displayed. If this InfoLevel has value 2, then additionally all "relevant" steps in the factoring algorithms are mentioned. If it is set equal to 3, then large amounts of details of the progress of the factoring process are shown.</p> | |
172 | ||
173 | <p>Enter <code class="code">FactIntInfo(<var class="Arg">level</var>)</code> to set the <code class="code">InfoLevel</code> of <code class="code">InfoFactInt</code> to the positive integer <var class="Arg">level</var>. The call <code class="code">FactIntInfo(<var class="Arg">level</var>);</code> is equivalent to <code class="code">SetInfoLevel(InfoFactInt,<var class="Arg">level</var>);</code>.</p> | |
174 | ||
175 | <p>The informational output is usually not literally the same in each factorization attempt to a given integer with given parameters. For a description of the Info mechanism, see Section <em>Info Functions</em> in the <strong class="pkg">GAP</strong> Reference Manual.</p> | |
176 | ||
177 | ||
178 | <div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap1.html">[Previous Chapter]</a> <a href="chap3.html">[Next Chapter]</a> </div> | |
179 | ||
180 | ||
181 | <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> | |
182 | ||
183 | <hr /> | |
184 | <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> | |
185 | </body> | |
186 | </html> |
0 | ||
1 | [1X2 [33X[0;0YThe General Factorization Routine[133X[101X | |
2 | ||
3 | ||
4 | [1X2.1 [33X[0;0YThe method for [10XFactors[110X[101X[1X[133X[101X | |
5 | ||
6 | [33X[0;0YThe [5XFactInt[105X package provides a better method for the operation [10XFactors[110X for | |
7 | integer arguments, which supersedes the one included in the [5XGAP[105X Library:[133X | |
8 | ||
9 | [1X2.1-1 Factors[101X | |
10 | ||
11 | [33X[1;0Y[29X[2XFactors[102X( [3Xn[103X ) [32X method[133X | |
12 | [6XReturns:[106X [33X[0;10Ya sorted list of the prime factors of [3Xn[103X.[133X | |
13 | ||
14 | [33X[0;0YThe returned factors pass the built-in probabilistic primality test of [5XGAP[105X | |
15 | ([10XIsProbablyPrimeInt[110X, Baillie-PSW Primality Test; see the [5XGAP[105X Reference | |
16 | Manual). If the method fails to compute the prime factorization of [3Xn[103X, an | |
17 | error is signalled. The same holds for all other factorization routines | |
18 | provided by this package. It follows a rough description how the | |
19 | factorization method works:[133X | |
20 | ||
21 | [33X[0;0YFirst of all, the method checks whether [22Xn = b^k ± 1[122X for some [22Xb[122X, [22Xk[122X and looks | |
22 | for factors corresponding to polynomial factors of [22Xx^k ± 1[122X. Provided that [22Xb[122X | |
23 | and [22Xk[122X are not too large, the factors that do not correspond to polynomial | |
24 | factors are taken from Richard P. Brent's Factor Tables [Bre04]. The code | |
25 | for accessing these tables has been contributed by Frank Lübeck.[133X | |
26 | ||
27 | [33X[0;0YThen the method uses trial division and a number of cheap methods for | |
28 | various common special cases. After the small and other [21Xeasy[121X factors have | |
29 | been found this way, [5XFactInt[105X's method searches for [21Xmedium-sized[121X factors | |
30 | using Pollard's Rho (by the library function [10XFactorsRho[110X, see the [5XGAP[105X | |
31 | Reference Manual), Pollard's [22Xp-1[122X (see [2XFactorsPminus1[102X ([14X3.2-1[114X)), Williams' [22Xp+1[122X | |
32 | (see [2XFactorsPplus1[102X ([14X3.3-1[114X)) and the Elliptic Curves Method (ECM, | |
33 | see [2XFactorsECM[102X ([14X3.4-1[114X)) in this order.[133X | |
34 | ||
35 | [33X[0;0YIf there is still an unfactored part remaining after that, it is factored | |
36 | using the Multiple Polynomial Quadratic Sieve (MPQS, see [2XFactorsMPQS[102X | |
37 | ([14X3.6-1[114X)).[133X | |
38 | ||
39 | [33X[0;0YThe following options are interpreted:[133X | |
40 | ||
41 | [8X[3XTDHints[103X[8X[108X | |
42 | [33X[0;6YA list of additional trial divisors. This is useful only if certain | |
43 | primes [22Xp[122X are expected to divide [22Xn[122X with probability significantly | |
44 | larger than [22Xfrac1p[122X.[133X | |
45 | ||
46 | [8X[3XRhoSteps[103X[8X[108X | |
47 | [33X[0;6YThe number of steps for Pollard's Rho.[133X | |
48 | ||
49 | [8X[3XRhoCluster[103X[8X[108X | |
50 | [33X[0;6YThe number of steps between two gcd computations in Pollard's Rho.[133X | |
51 | ||
52 | [8X[3XPminus1Limit1[103X[8X / [3XPminus1Limit2[103X[8X[108X | |
53 | [33X[0;6YThe first- / second stage limit for Pollard's [22Xp-1[122X (see [2XFactorsPminus1[102X | |
54 | ([14X3.2-1[114X)).[133X | |
55 | ||
56 | [8X[3XPplus1Residues[103X[8X[108X | |
57 | [33X[0;6YThe number of residues to be tried by Williams' [22Xp+1[122X (see [2XFactorsPplus1[102X | |
58 | ([14X3.3-1[114X)).[133X | |
59 | ||
60 | [8X[3XPplus1Limit1[103X[8X / [3XPplus1Limit2[103X[8X[108X | |
61 | [33X[0;6YThe first- / second stage limit for Williams' [22Xp+1[122X (see [2XFactorsPplus1[102X | |
62 | ([14X3.3-1[114X)).[133X | |
63 | ||
64 | [8X[3XECMCurves[103X[8X[108X | |
65 | [33X[0;6YThe number of elliptic curves to be tried by the Elliptic Curves | |
66 | Method (ECM) (see [2XFactorsECM[102X ([14X3.4-1[114X)). Also admissible: a function | |
67 | that takes the number [22Xn[122X to be factored as an argument and returns the | |
68 | desired number of curves to be tried.[133X | |
69 | ||
70 | [8X[3XECMLimit1[103X[8X / [3XECMLimit2[103X[8X[108X | |
71 | [33X[0;6YThe initial first- / second stage limit for ECM (see [2XFactorsECM[102X | |
72 | ([14X3.4-1[114X)).[133X | |
73 | ||
74 | [8X[3XECMDelta[103X[8X[108X | |
75 | [33X[0;6YThe increment per curve for the first stage limit in ECM. The second | |
76 | stage limit is adjusted appropriately (see [2XFactorsECM[102X ([14X3.4-1[114X)).[133X | |
77 | ||
78 | [8X[3XECMDeterministic[103X[8X[108X | |
79 | [33X[0;6YIf true, ECM chooses its curves deterministically, i.e. repeatable | |
80 | (see [2XFactorsECM[102X ([14X3.4-1[114X)).[133X | |
81 | ||
82 | [8X[3XFBMethod[103X[8X[108X | |
83 | [33X[0;6YSpecifies which of the factor base methods should be used to do the | |
84 | [21Xhard work[121X. Currently implemented: [10X"CFRAC"[110X and [10X"MPQS"[110X (see [2XFactorsCFRAC[102X | |
85 | ([14X3.5-1[114X) and [2XFactorsMPQS[102X ([14X3.6-1[114X), respectively). Default: [10X"MPQS"[110X.[133X | |
86 | ||
87 | [33X[0;0YFor the use of the [5XGAP[105X Options Stack, see Chapter [13XOptions Stack[113X in the [5XGAP[105X | |
88 | Reference Manual.[133X | |
89 | ||
90 | [33X[0;0YSetting [3XRhoSteps[103X, [3XPminus1Limit1[103X, [3XPplus1Residues[103X, [3XPplus1Limit1[103X, [3XECMCurves[103X or | |
91 | [3XECMLimit1[103X equal to zero switches the respective method off. The method | |
92 | chooses defaults for all option values that are not explicitly set by the | |
93 | user. The option values are also interpreted by the routines for the | |
94 | particular factorization methods described in the next chapter.[133X | |
95 | ||
96 | [4X[32X Example [32X[104X | |
97 | [4X[28X[128X[104X | |
98 | [4X[25Xgap>[125X [27XFactors( Factorial(44) + 1 );[127X[104X | |
99 | [4X[28X[ 694763, 9245226412016162109253, 413852053257739876455072359 ][128X[104X | |
100 | [4X[25Xgap>[125X [27XFactors( 2^997 - 1 );[127X[104X | |
101 | [4X[28X[ 167560816514084819488737767976263150405095191554732902607, [128X[104X | |
102 | [4X[28X 79934306053602222928609369601238840619880168466272137576868879760059\[128X[104X | |
103 | [4X[28X3002563860297371289151859287894468775962208410650878341385577817736702\[128X[104X | |
104 | [4X[28X2158878920741413700868182301410439178049533828082651513160945607018874\[128X[104X | |
105 | [4X[28X830040978453228378816647358334681553 ][128X[104X | |
106 | [4X[28X[128X[104X | |
107 | [4X[32X[104X | |
108 | ||
109 | [33X[0;0YThe above method for [10XFactors[110X calls the following function, which is the | |
110 | actual [21Xworking horse[121X of this package:[133X | |
111 | ||
112 | [1X2.1-2 FactInt[101X | |
113 | ||
114 | [33X[1;0Y[29X[2XFactInt[102X( [3Xn[103X ) [32X function[133X | |
115 | [6XReturns:[106X [33X[0;10Ya list of two lists, where the first list contains the determined | |
116 | prime factors of [3Xn[103X and the second list contains the remaining | |
117 | unfactored parts of [3Xn[103X, if there are any.[133X | |
118 | ||
119 | [33X[0;0YThis function interprets all options which are interpreted by the method for | |
120 | [10XFactors[110X described above. In addition, it interprets the options [3Xcheap[103X and | |
121 | [3XFactIntPartial[103X. If the option [3Xcheap[103X is set, only usually cheap factorization | |
122 | attempts are made. If the option [3XFactIntPartial[103X is set, the factorization | |
123 | process is stopped before invoking the (usually time-consuming) MPQS or | |
124 | CFRAC, if the number of digits of the remaining unfactored part exceeds the | |
125 | bound passed as option value [3XMPQSLimit[103X or [3XCFRACLimit[103X, respectively.[133X | |
126 | ||
127 | [33X[0;0Y[10XFactors([3Xn[103X[10X)[110X is equivalent to [10XFactInt([3Xn[103X[10X:[3Xcheap[103X[10X:=false, | |
128 | [3XFactIntPartial[103X[10X:=false)[1][110X.[133X | |
129 | ||
130 | [4X[32X Example [32X[104X | |
131 | [4X[28X[128X[104X | |
132 | [4X[25Xgap>[125X [27XFactInt( Factorial(300) + 1 : cheap );[127X[104X | |
133 | [4X[28X[ [ 461, 259856122109, 995121825812791, 3909669044842609, [128X[104X | |
134 | [4X[28X 4220826953750952739, 14841043839896940772689086214475144339 ], [128X[104X | |
135 | [4X[28X [ 104831288231765723173983836560438594053336296629073932563520618687\[128X[104X | |
136 | [4X[28X9287645058010688827246061541065631119345674081834085960064144597037243\[128X[104X | |
137 | [4X[28X9235869682208979384309498719255615067943353399357029226058930732298505\[128X[104X | |
138 | [4X[28X5816977495398426741656633461747046623641451042655247093315505417820370\[128X[104X | |
139 | [4X[28X9451745871701742000546384614472756584182478531880962594857275869690727\[128X[104X | |
140 | [4X[28X9733563594352516014206081210368516157890709802912711149521530885498556\[128X[104X | |
141 | [4X[28X1244667790208245620301404499928532222524585946881528337257061789593197\[128X[104X | |
142 | [4X[28X99211283640357942345263781351 ] ][128X[104X | |
143 | [4X[28X[128X[104X | |
144 | [4X[32X[104X | |
145 | ||
146 | ||
147 | [1X2.2 [33X[0;0YGetting information about the factoring process[133X[101X | |
148 | ||
149 | [33X[0;0YOptionally, the [5XFactInt[105X package prints information on the progress of the | |
150 | factorization process:[133X | |
151 | ||
152 | [1X2.2-1 InfoFactInt[101X | |
153 | ||
154 | [33X[1;0Y[29X[2XInfoFactInt[102X[32X info class[133X | |
155 | [33X[1;0Y[29X[2XFactIntInfo[102X( [3Xlevel[103X ) [32X function[133X | |
156 | ||
157 | [33X[0;0YThis Info class allows to monitor what happens during the factoring process.[133X | |
158 | ||
159 | [33X[0;0YIf [10XInfoLevel(InfoFactInt) = 1[110X, then basic information about the factoring | |
160 | techniques used is displayed. If this InfoLevel has value 2, then | |
161 | additionally all [21Xrelevant[121X steps in the factoring algorithms are mentioned. | |
162 | If it is set equal to 3, then large amounts of details of the progress of | |
163 | the factoring process are shown.[133X | |
164 | ||
165 | [33X[0;0YEnter [10XFactIntInfo([3Xlevel[103X[10X)[110X to set the [10XInfoLevel[110X of [10XInfoFactInt[110X to the positive | |
166 | integer [3Xlevel[103X. The call [10XFactIntInfo([3Xlevel[103X[10X);[110X is equivalent to | |
167 | [10XSetInfoLevel(InfoFactInt,[3Xlevel[103X[10X);[110X.[133X | |
168 | ||
169 | [33X[0;0YThe informational output is usually not literally the same in each | |
170 | factorization attempt to a given integer with given parameters. For a | |
171 | description of the Info mechanism, see Section [13XInfo Functions[113X in the [5XGAP[105X | |
172 | Reference Manual.[133X | |
173 |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <script type="text/javascript" | |
8 | src="http://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> | |
9 | </script> | |
10 | <title>GAP (FactInt) - Chapter 2: The General Factorization Routine</title> | |
11 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
12 | <meta name="generator" content="GAPDoc2HTML" /> | |
13 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
14 | <script src="manual.js" type="text/javascript"></script> | |
15 | <script type="text/javascript">overwriteStyle();</script> | |
16 | </head> | |
17 | <body class="chap2" onload="jscontent()"> | |
18 | ||
19 | ||
20 | <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div> | |
21 | ||
22 | <div class="chlinkprevnexttop"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap1_mj.html">[Previous Chapter]</a> <a href="chap3_mj.html">[Next Chapter]</a> </div> | |
23 | ||
24 | <p id="mathjaxlink" class="pcenter"><a href="chap2.html">[MathJax off]</a></p> | |
25 | <p><a id="X7B1A84BB788FC526" name="X7B1A84BB788FC526"></a></p> | |
26 | <div class="ChapSects"><a href="chap2_mj.html#X7B1A84BB788FC526">2 <span class="Heading">The General Factorization Routine</span></a> | |
27 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2_mj.html#X83BF2CD28017ABC5">2.1 <span class="Heading">The method for <code class="code">Factors</code></span></a> | |
28 | </span> | |
29 | <div class="ContSSBlock"> | |
30 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap2_mj.html#X833B087D7A83BC7A">2.1-1 Factors</a></span> | |
31 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap2_mj.html#X866CD23D78460060">2.1-2 FactInt</a></span> | |
32 | </div></div> | |
33 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2_mj.html#X80EB87DD80462F80">2.2 <span class="Heading">Getting information about the factoring process</span></a> | |
34 | </span> | |
35 | <div class="ContSSBlock"> | |
36 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap2_mj.html#X8093BB787C2E764B">2.2-1 InfoFactInt</a></span> | |
37 | </div></div> | |
38 | </div> | |
39 | ||
40 | <h3>2 <span class="Heading">The General Factorization Routine</span></h3> | |
41 | ||
42 | <p><a id="X83BF2CD28017ABC5" name="X83BF2CD28017ABC5"></a></p> | |
43 | ||
44 | <h4>2.1 <span class="Heading">The method for <code class="code">Factors</code></span></h4> | |
45 | ||
46 | <p>The <strong class="pkg">FactInt</strong> package provides a better method for the operation <code class="code">Factors</code> for integer arguments, which supersedes the one included in the <strong class="pkg">GAP</strong> Library:</p> | |
47 | ||
48 | <p><a id="X833B087D7A83BC7A" name="X833B087D7A83BC7A"></a></p> | |
49 | ||
50 | <h5>2.1-1 Factors</h5> | |
51 | ||
52 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Factors</code>( <var class="Arg">n</var> )</td><td class="tdright">( method )</td></tr></table></div> | |
53 | <p>Returns: a sorted list of the prime factors of <var class="Arg">n</var>.</p> | |
54 | ||
55 | <p>The returned factors pass the built-in probabilistic primality test of <strong class="pkg">GAP</strong> (<code class="code">IsProbablyPrimeInt</code>, Baillie-PSW Primality Test; see the <strong class="pkg">GAP</strong> Reference Manual). If the method fails to compute the prime factorization of <var class="Arg">n</var>, an error is signalled. The same holds for all other factorization routines provided by this package. It follows a rough description how the factorization method works:</p> | |
56 | ||
57 | <p>First of all, the method checks whether <span class="SimpleMath">\(n = b^k \pm 1\)</span> for some <span class="SimpleMath">\(b\)</span>, <span class="SimpleMath">\(k\)</span> and looks for factors corresponding to polynomial factors of <span class="SimpleMath">\(x^k \pm 1\)</span>. Provided that <span class="SimpleMath">\(b\)</span> and <span class="SimpleMath">\(k\)</span> are not too large, the factors that do not correspond to polynomial factors are taken from Richard P. Brent's Factor Tables <a href="chapBib_mj.html#biBBrent04">[Bre04]</a>. The code for accessing these tables has been contributed by Frank Lübeck.</p> | |
58 | ||
59 | <p>Then the method uses trial division and a number of cheap methods for various common special cases. After the small and other "easy" factors have been found this way, <strong class="pkg">FactInt</strong>'s method searches for "medium-sized" factors using Pollard's Rho (by the library function <code class="code">FactorsRho</code>, see the <strong class="pkg">GAP</strong> Reference Manual), Pollard's <span class="SimpleMath">\(p-1\)</span> (see <code class="func">FactorsPminus1</code> (<a href="chap3_mj.html#X7AF95E2E87F58200"><span class="RefLink">3.2-1</span></a>)), Williams' <span class="SimpleMath">\(p+1\)</span> (see <code class="func">FactorsPplus1</code> (<a href="chap3_mj.html#X8079A0367DE4FC35"><span class="RefLink">3.3-1</span></a>)) and the Elliptic Curves Method (ECM, see <code class="func">FactorsECM</code> (<a href="chap3_mj.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>)) in this order.</p> | |
60 | ||
61 | <p>If there is still an unfactored part remaining after that, it is factored using the Multiple Polynomial Quadratic Sieve (MPQS, see <code class="func">FactorsMPQS</code> (<a href="chap3_mj.html#X86F8DFB681442E05"><span class="RefLink">3.6-1</span></a>)).</p> | |
62 | ||
63 | <p>The following options are interpreted:</p> | |
64 | ||
65 | ||
66 | <dl> | |
67 | <dt><strong class="Mark"><var class="Arg">TDHints</var></strong></dt> | |
68 | <dd><p>A list of additional trial divisors. This is useful only if certain primes <span class="SimpleMath">\(p\)</span> are expected to divide <span class="SimpleMath">\(n\)</span> with probability significantly larger than <span class="SimpleMath">\(\frac{1}{p}\)</span>.</p> | |
69 | ||
70 | </dd> | |
71 | <dt><strong class="Mark"><var class="Arg">RhoSteps</var></strong></dt> | |
72 | <dd><p>The number of steps for Pollard's Rho.</p> | |
73 | ||
74 | </dd> | |
75 | <dt><strong class="Mark"><var class="Arg">RhoCluster</var></strong></dt> | |
76 | <dd><p>The number of steps between two gcd computations in Pollard's Rho.</p> | |
77 | ||
78 | </dd> | |
79 | <dt><strong class="Mark"><var class="Arg">Pminus1Limit1</var> / <var class="Arg">Pminus1Limit2</var></strong></dt> | |
80 | <dd><p>The first- / second stage limit for Pollard's <span class="SimpleMath">\(p-1\)</span> (see <code class="func">FactorsPminus1</code> (<a href="chap3_mj.html#X7AF95E2E87F58200"><span class="RefLink">3.2-1</span></a>)).</p> | |
81 | ||
82 | </dd> | |
83 | <dt><strong class="Mark"><var class="Arg">Pplus1Residues</var></strong></dt> | |
84 | <dd><p>The number of residues to be tried by Williams' <span class="SimpleMath">\(p+1\)</span> (see <code class="func">FactorsPplus1</code> (<a href="chap3_mj.html#X8079A0367DE4FC35"><span class="RefLink">3.3-1</span></a>)).</p> | |
85 | ||
86 | </dd> | |
87 | <dt><strong class="Mark"><var class="Arg">Pplus1Limit1</var> / <var class="Arg">Pplus1Limit2</var></strong></dt> | |
88 | <dd><p>The first- / second stage limit for Williams' <span class="SimpleMath">\(p+1\)</span> (see <code class="func">FactorsPplus1</code> (<a href="chap3_mj.html#X8079A0367DE4FC35"><span class="RefLink">3.3-1</span></a>)).</p> | |
89 | ||
90 | </dd> | |
91 | <dt><strong class="Mark"><var class="Arg">ECMCurves</var></strong></dt> | |
92 | <dd><p>The number of elliptic curves to be tried by the Elliptic Curves Method (ECM) (see <code class="func">FactorsECM</code> (<a href="chap3_mj.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>)). Also admissible: a function that takes the number <span class="SimpleMath">\(n\)</span> to be factored as an argument and returns the desired number of curves to be tried.</p> | |
93 | ||
94 | </dd> | |
95 | <dt><strong class="Mark"><var class="Arg">ECMLimit1</var> / <var class="Arg">ECMLimit2</var></strong></dt> | |
96 | <dd><p>The initial first- / second stage limit for ECM (see <code class="func">FactorsECM</code> (<a href="chap3_mj.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>)).</p> | |
97 | ||
98 | </dd> | |
99 | <dt><strong class="Mark"><var class="Arg">ECMDelta</var></strong></dt> | |
100 | <dd><p>The increment per curve for the first stage limit in ECM. The second stage limit is adjusted appropriately (see <code class="func">FactorsECM</code> (<a href="chap3_mj.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>)).</p> | |
101 | ||
102 | </dd> | |
103 | <dt><strong class="Mark"><var class="Arg">ECMDeterministic</var></strong></dt> | |
104 | <dd><p>If true, ECM chooses its curves deterministically, i.e. repeatable (see <code class="func">FactorsECM</code> (<a href="chap3_mj.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>)).</p> | |
105 | ||
106 | </dd> | |
107 | <dt><strong class="Mark"><var class="Arg">FBMethod</var></strong></dt> | |
108 | <dd><p>Specifies which of the factor base methods should be used to do the "hard work". Currently implemented: <code class="code">"CFRAC"</code> and <code class="code">"MPQS"</code> (see <code class="func">FactorsCFRAC</code> (<a href="chap3_mj.html#X7A5C8BC5861CFC8C"><span class="RefLink">3.5-1</span></a>) and <code class="func">FactorsMPQS</code> (<a href="chap3_mj.html#X86F8DFB681442E05"><span class="RefLink">3.6-1</span></a>), respectively). Default: <code class="code">"MPQS"</code>.</p> | |
109 | ||
110 | </dd> | |
111 | </dl> | |
112 | <p>For the use of the <strong class="pkg">GAP</strong> Options Stack, see Chapter <em>Options Stack</em> in the <strong class="pkg">GAP</strong> Reference Manual.</p> | |
113 | ||
114 | <p>Setting <var class="Arg">RhoSteps</var>, <var class="Arg">Pminus1Limit1</var>, <var class="Arg">Pplus1Residues</var>, <var class="Arg">Pplus1Limit1</var>, <var class="Arg">ECMCurves</var> or <var class="Arg">ECMLimit1</var> equal to zero switches the respective method off. The method chooses defaults for all option values that are not explicitly set by the user. The option values are also interpreted by the routines for the particular factorization methods described in the next chapter.</p> | |
115 | ||
116 | ||
117 | <div class="example"><pre> | |
118 | ||
119 | <span class="GAPprompt">gap></span> <span class="GAPinput">Factors( Factorial(44) + 1 );</span> | |
120 | [ 694763, 9245226412016162109253, 413852053257739876455072359 ] | |
121 | <span class="GAPprompt">gap></span> <span class="GAPinput">Factors( 2^997 - 1 );</span> | |
122 | [ 167560816514084819488737767976263150405095191554732902607, | |
123 | 79934306053602222928609369601238840619880168466272137576868879760059\ | |
124 | 3002563860297371289151859287894468775962208410650878341385577817736702\ | |
125 | 2158878920741413700868182301410439178049533828082651513160945607018874\ | |
126 | 830040978453228378816647358334681553 ] | |
127 | ||
128 | </pre></div> | |
129 | ||
130 | <p>The above method for <code class="code">Factors</code> calls the following function, which is the actual "working horse" of this package:</p> | |
131 | ||
132 | <p><a id="X866CD23D78460060" name="X866CD23D78460060"></a></p> | |
133 | ||
134 | <h5>2.1-2 FactInt</h5> | |
135 | ||
136 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactInt</code>( <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div> | |
137 | <p>Returns: a list of two lists, where the first list contains the determined prime factors of <var class="Arg">n</var> and the second list contains the remaining unfactored parts of <var class="Arg">n</var>, if there are any.</p> | |
138 | ||
139 | <p>This function interprets all options which are interpreted by the method for <code class="code">Factors</code> described above. In addition, it interprets the options <var class="Arg">cheap</var> and <var class="Arg">FactIntPartial</var>. If the option <var class="Arg">cheap</var> is set, only usually cheap factorization attempts are made. If the option <var class="Arg">FactIntPartial</var> is set, the factorization process is stopped before invoking the (usually time-consuming) MPQS or CFRAC, if the number of digits of the remaining unfactored part exceeds the bound passed as option value <var class="Arg">MPQSLimit</var> or <var class="Arg">CFRACLimit</var>, respectively.</p> | |
140 | ||
141 | <p><code class="code">Factors(<var class="Arg">n</var>)</code> is equivalent to <code class="code">FactInt(<var class="Arg">n</var>:<var class="Arg">cheap</var>:=false, <var class="Arg">FactIntPartial</var>:=false)[1]</code>.</p> | |
142 | ||
143 | ||
144 | <div class="example"><pre> | |
145 | ||
146 | <span class="GAPprompt">gap></span> <span class="GAPinput">FactInt( Factorial(300) + 1 : cheap );</span> | |
147 | [ [ 461, 259856122109, 995121825812791, 3909669044842609, | |
148 | 4220826953750952739, 14841043839896940772689086214475144339 ], | |
149 | [ 104831288231765723173983836560438594053336296629073932563520618687\ | |
150 | 9287645058010688827246061541065631119345674081834085960064144597037243\ | |
151 | 9235869682208979384309498719255615067943353399357029226058930732298505\ | |
152 | 5816977495398426741656633461747046623641451042655247093315505417820370\ | |
153 | 9451745871701742000546384614472756584182478531880962594857275869690727\ | |
154 | 9733563594352516014206081210368516157890709802912711149521530885498556\ | |
155 | 1244667790208245620301404499928532222524585946881528337257061789593197\ | |
156 | 99211283640357942345263781351 ] ] | |
157 | ||
158 | </pre></div> | |
159 | ||
160 | <p><a id="X80EB87DD80462F80" name="X80EB87DD80462F80"></a></p> | |
161 | ||
162 | <h4>2.2 <span class="Heading">Getting information about the factoring process</span></h4> | |
163 | ||
164 | <p>Optionally, the <strong class="pkg">FactInt</strong> package prints information on the progress of the factorization process:</p> | |
165 | ||
166 | <p><a id="X8093BB787C2E764B" name="X8093BB787C2E764B"></a></p> | |
167 | ||
168 | <h5>2.2-1 InfoFactInt</h5> | |
169 | ||
170 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ InfoFactInt</code></td><td class="tdright">( info class )</td></tr></table></div> | |
171 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactIntInfo</code>( <var class="Arg">level</var> )</td><td class="tdright">( function )</td></tr></table></div> | |
172 | <p>This Info class allows to monitor what happens during the factoring process.</p> | |
173 | ||
174 | <p>If <code class="code">InfoLevel(InfoFactInt) = 1</code>, then basic information about the factoring techniques used is displayed. If this InfoLevel has value 2, then additionally all "relevant" steps in the factoring algorithms are mentioned. If it is set equal to 3, then large amounts of details of the progress of the factoring process are shown.</p> | |
175 | ||
176 | <p>Enter <code class="code">FactIntInfo(<var class="Arg">level</var>)</code> to set the <code class="code">InfoLevel</code> of <code class="code">InfoFactInt</code> to the positive integer <var class="Arg">level</var>. The call <code class="code">FactIntInfo(<var class="Arg">level</var>);</code> is equivalent to <code class="code">SetInfoLevel(InfoFactInt,<var class="Arg">level</var>);</code>.</p> | |
177 | ||
178 | <p>The informational output is usually not literally the same in each factorization attempt to a given integer with given parameters. For a description of the Info mechanism, see Section <em>Info Functions</em> in the <strong class="pkg">GAP</strong> Reference Manual.</p> | |
179 | ||
180 | ||
181 | <div class="chlinkprevnextbot"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap1_mj.html">[Previous Chapter]</a> <a href="chap3_mj.html">[Next Chapter]</a> </div> | |
182 | ||
183 | ||
184 | <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div> | |
185 | ||
186 | <hr /> | |
187 | <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> | |
188 | </body> | |
189 | </html> |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <title>GAP (FactInt) - Chapter 3: The Routines for Specific Factorization Methods</title> | |
8 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
9 | <meta name="generator" content="GAPDoc2HTML" /> | |
10 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
11 | <script src="manual.js" type="text/javascript"></script> | |
12 | <script type="text/javascript">overwriteStyle();</script> | |
13 | </head> | |
14 | <body class="chap3" onload="jscontent()"> | |
15 | ||
16 | ||
17 | <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> | |
18 | ||
19 | <div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap2.html">[Previous Chapter]</a> <a href="chap4.html">[Next Chapter]</a> </div> | |
20 | ||
21 | <p id="mathjaxlink" class="pcenter"><a href="chap3_mj.html">[MathJax on]</a></p> | |
22 | <p><a id="X7E7EE1A1785A8009" name="X7E7EE1A1785A8009"></a></p> | |
23 | <div class="ChapSects"><a href="chap3.html#X7E7EE1A1785A8009">3 <span class="Heading">The Routines for Specific Factorization Methods</span></a> | |
24 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X7A0392177E697956">3.1 <span class="Heading">Trial division</span></a> | |
25 | </span> | |
26 | <div class="ContSSBlock"> | |
27 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X7C4D255A789F54B4">3.1-1 FactorsTD</a></span> | |
28 | </div></div> | |
29 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X8081FF657DA9C674">3.2 <span class="Heading">Pollard's <span class="SimpleMath">p-1</span></span></a> | |
30 | </span> | |
31 | <div class="ContSSBlock"> | |
32 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X7AF95E2E87F58200">3.2-1 FactorsPminus1</a></span> | |
33 | </div></div> | |
34 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X860B4BE37DABDE10">3.3 <span class="Heading">Williams' <span class="SimpleMath">p+1</span></span></a> | |
35 | </span> | |
36 | <div class="ContSSBlock"> | |
37 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X8079A0367DE4FC35">3.3-1 FactorsPplus1</a></span> | |
38 | </div></div> | |
39 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X7837106783A5194B">3.4 <span class="Heading">The Elliptic Curves Method (ECM)</span></a> | |
40 | </span> | |
41 | <div class="ContSSBlock"> | |
42 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X87B162F878AD031C">3.4-1 FactorsECM</a></span> | |
43 | </div></div> | |
44 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X78466BB97BEE5495">3.5 <span class="Heading">The Continued Fraction Algorithm (CFRAC)</span></a> | |
45 | </span> | |
46 | <div class="ContSSBlock"> | |
47 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X7A5C8BC5861CFC8C">3.5-1 FactorsCFRAC</a></span> | |
48 | </div></div> | |
49 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X7A5C621C7FCFAA8A">3.6 <span class="Heading">The Multiple Polynomial Quadratic Sieve (MPQS)</span></a> | |
50 | </span> | |
51 | <div class="ContSSBlock"> | |
52 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X86F8DFB681442E05">3.6-1 FactorsMPQS</a></span> | |
53 | </div></div> | |
54 | </div> | |
55 | ||
56 | <h3>3 <span class="Heading">The Routines for Specific Factorization Methods</span></h3> | |
57 | ||
58 | <p>Descriptions of the factoring methods implemented in this package can be found in <a href="chapBib.html#biBBressoud89">[Bre89]</a> and <a href="chapBib.html#biBCohen93">[Coh93]</a>. Cohen's book contains also descriptions of the other methods mentioned in the preface.</p> | |
59 | ||
60 | <p><a id="X7A0392177E697956" name="X7A0392177E697956"></a></p> | |
61 | ||
62 | <h4>3.1 <span class="Heading">Trial division</span></h4> | |
63 | ||
64 | <p><a id="X7C4D255A789F54B4" name="X7C4D255A789F54B4"></a></p> | |
65 | ||
66 | <h5>3.1-1 FactorsTD</h5> | |
67 | ||
68 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactorsTD</code>( <var class="Arg">n</var>[, <var class="Arg">Divisors</var>] )</td><td class="tdright">( function )</td></tr></table></div> | |
69 | <p>Returns: a list of two lists: The first list contains the prime factors found, and the second list contains remaining unfactored parts of <var class="Arg">n</var>, if there are any.</p> | |
70 | ||
71 | <p>This function tries to factor <var class="Arg">n</var> by trial division. The optional argument <var class="Arg">Divisors</var> is the list of trial divisors. If not given, it defaults to the list of primes <span class="SimpleMath">p < 1000</span>.</p> | |
72 | ||
73 | ||
74 | <div class="example"><pre> | |
75 | ||
76 | <span class="GAPprompt">gap></span> <span class="GAPinput">FactorsTD(12^25+25^12);</span> | |
77 | [ [ 13, 19, 727 ], [ 5312510324723614735153 ] ] | |
78 | ||
79 | </pre></div> | |
80 | ||
81 | <p><a id="X8081FF657DA9C674" name="X8081FF657DA9C674"></a></p> | |
82 | ||
83 | <h4>3.2 <span class="Heading">Pollard's <span class="SimpleMath">p-1</span></span></h4> | |
84 | ||
85 | <p><a id="X7AF95E2E87F58200" name="X7AF95E2E87F58200"></a></p> | |
86 | ||
87 | <h5>3.2-1 FactorsPminus1</h5> | |
88 | ||
89 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactorsPminus1</code>( <var class="Arg">n</var>[[, <var class="Arg">a</var>], <var class="Arg">Limit1</var>[, <var class="Arg">Limit2</var>]] )</td><td class="tdright">( function )</td></tr></table></div> | |
90 | <p>Returns: a list of two lists: The first list contains the prime factors found, and the second list contains remaining unfactored parts of <var class="Arg">n</var>, if there are any.</p> | |
91 | ||
92 | <p>This function tries to factor <var class="Arg">n</var> using Pollard's <span class="SimpleMath">p-1</span>. It uses <var class="Arg">a</var> as base for exponentiation, <var class="Arg">Limit1</var> as first stage limit and <var class="Arg">Limit2</var> as second stage limit. If the function is called with three arguments, these arguments are interpreted as <var class="Arg">n</var>, <var class="Arg">Limit1</var> and <var class="Arg">Limit2</var>. Defaults are chosen for all arguments which are omitted.</p> | |
93 | ||
94 | <p>Pollard's <span class="SimpleMath">p-1</span> is based on the fact that exponentiation (mod <span class="SimpleMath">n</span>) can be done efficiently enough to compute <span class="SimpleMath">a^k!</span> mod <span class="SimpleMath">n</span> for sufficiently large <span class="SimpleMath">k</span> in a reasonable amount of time. Assume that <span class="SimpleMath">p</span> is a prime factor of <span class="SimpleMath">n</span> which does not divide <span class="SimpleMath">a</span>, and that <span class="SimpleMath">k!</span> is a multiple of <span class="SimpleMath">p-1</span>. Then Lagrange's Theorem states that <span class="SimpleMath">a^k! ≡ 1</span> (mod <span class="SimpleMath">p</span>). If <span class="SimpleMath">k!</span> is not a multiple of <span class="SimpleMath">q-1</span> for another prime factor <span class="SimpleMath">q</span> of <span class="SimpleMath">n</span>, it is likely that the factor <span class="SimpleMath">p</span> can be determined by computing <span class="SimpleMath">gcd(a^k!-1,n)</span>. A prime factor <span class="SimpleMath">p</span> is usually found if the largest prime factor of <span class="SimpleMath">p-1</span> is not larger than <var class="Arg">Limit2</var>, and the second-largest one is not larger than <var class="Arg">Limit1</var>. (Compare with <code class="func">FactorsPplus1</code> (<a href="chap3.html#X8079A0367DE4FC35"><span class="RefLink">3.3-1</span></a>) and <code class="func">FactorsECM</code> (<a href="chap3.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>).)</p> | |
95 | ||
96 | ||
97 | <div class="example"><pre> | |
98 | ||
99 | <span class="GAPprompt">gap></span> <span class="GAPinput">FactorsPminus1( Factorial(158) + 1, 100000, 1000000 );</span> | |
100 | [ [ 2879, 5227, 1452486383317, 9561906969931, 18331561438319, | |
101 | 4837142997094837608115811103417329505064932181226548534006749213\ | |
102 | 4508231090637045229565481657130504121732305287984292482612133314325471\ | |
103 | 3674832962773107806789945715570386038565256719614524924705165110048148\ | |
104 | 7161609649806290811760570095669 ], [ ] ] | |
105 | <span class="GAPprompt">gap></span> <span class="GAPinput">List( last[ 1 ]{[ 3, 4, 5 ]}, p -> Factors( p - 1 ) );</span> | |
106 | [ [ 2, 2, 3, 3, 81937, 492413 ], [ 2, 3, 3, 3, 5, 7, 7, 1481, 488011 ] | |
107 | , [ 2, 3001, 7643, 399613 ] ] | |
108 | ||
109 | </pre></div> | |
110 | ||
111 | <p><a id="X860B4BE37DABDE10" name="X860B4BE37DABDE10"></a></p> | |
112 | ||
113 | <h4>3.3 <span class="Heading">Williams' <span class="SimpleMath">p+1</span></span></h4> | |
114 | ||
115 | <p><a id="X8079A0367DE4FC35" name="X8079A0367DE4FC35"></a></p> | |
116 | ||
117 | <h5>3.3-1 FactorsPplus1</h5> | |
118 | ||
119 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactorsPplus1</code>( <var class="Arg">n</var>[[, <var class="Arg">Residues</var>], <var class="Arg">Limit1</var>[, <var class="Arg">Limit2</var>]] )</td><td class="tdright">( function )</td></tr></table></div> | |
120 | <p>Returns: a list of two lists: The first list contains the prime factors found, and the second list contains remaining unfactored parts of <var class="Arg">n</var>, if there are any.</p> | |
121 | ||
122 | <p>This function tries to factor <var class="Arg">n</var> using Williams' <span class="SimpleMath">p+1</span>. It tries <var class="Arg">Residues</var> different residues, and uses <var class="Arg">Limit1</var> as first stage limit and <var class="Arg">Limit2</var> as second stage limit. If the function is called with three arguments, these arguments are interpreted as <var class="Arg">n</var>, <var class="Arg">Limit1</var> and <var class="Arg">Limit2</var>. Defaults are chosen for all arguments which are omitted.</p> | |
123 | ||
124 | <p>Williams' <span class="SimpleMath">p+1</span> is very similar to Pollard's <span class="SimpleMath">p-1</span> (see <code class="func">FactorsPminus1</code> (<a href="chap3.html#X7AF95E2E87F58200"><span class="RefLink">3.2-1</span></a>)). The difference is that the underlying group here can either have order <span class="SimpleMath">p+1</span> or <span class="SimpleMath">p-1</span>, and that the group operation takes more time. A prime factor <span class="SimpleMath">p</span> is usually found if the largest prime factor of the group order is at most <var class="Arg">Limit2</var> and the second-largest one is not larger than <var class="Arg">Limit1</var>. (Compare also with <code class="func">FactorsECM</code> (<a href="chap3.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>).)</p> | |
125 | ||
126 | ||
127 | <div class="example"><pre> | |
128 | ||
129 | <span class="GAPprompt">gap></span> <span class="GAPinput">FactorsPplus1( Factorial(55) - 1, 10, 10000, 100000 );</span> | |
130 | [ [ 73, 39619, 277914269, 148257413069 ], | |
131 | [ 106543529120049954955085076634537262459718863957 ] ] | |
132 | <span class="GAPprompt">gap></span> <span class="GAPinput">List( last[ 1 ], p -> [ Factors( p - 1 ), Factors( p + 1 ) ] );</span> | |
133 | [ [ [ 2, 2, 2, 3, 3 ], [ 2, 37 ] ], | |
134 | [ [ 2, 3, 3, 31, 71 ], [ 2, 2, 5, 7, 283 ] ], | |
135 | [ [ 2, 2, 2207, 31481 ], [ 2, 3, 5, 9263809 ] ], | |
136 | [ [ 2, 2, 47, 788603261 ], [ 2, 3, 5, 13, 37, 67, 89, 1723 ] ] ] | |
137 | ||
138 | </pre></div> | |
139 | ||
140 | <p><a id="X7837106783A5194B" name="X7837106783A5194B"></a></p> | |
141 | ||
142 | <h4>3.4 <span class="Heading">The Elliptic Curves Method (ECM)</span></h4> | |
143 | ||
144 | <p><a id="X87B162F878AD031C" name="X87B162F878AD031C"></a></p> | |
145 | ||
146 | <h5>3.4-1 FactorsECM</h5> | |
147 | ||
148 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactorsECM</code>( <var class="Arg">n</var>[, <var class="Arg">Curves</var>[, <var class="Arg">Limit1</var>[, <var class="Arg">Limit2</var>[, <var class="Arg">Delta</var>]]]] )</td><td class="tdright">( function )</td></tr></table></div> | |
149 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ECM</code>( <var class="Arg">n</var>[, <var class="Arg">Curves</var>[, <var class="Arg">Limit1</var>[, <var class="Arg">Limit2</var>[, <var class="Arg">Delta</var>]]]] )</td><td class="tdright">( function )</td></tr></table></div> | |
150 | <p>Returns: a list of two lists: The first list contains the prime factors found, and the second list contains remaining unfactored parts of <var class="Arg">n</var>, if there are any.</p> | |
151 | ||
152 | <p>This function tries to factor <var class="Arg">n</var> using the Elliptic Curves Method (ECM). The argument <var class="Arg">Curves</var> is the number of curves to be tried. The argument <var class="Arg">Limit1</var> is the initial first stage limit, and <var class="Arg">Limit2</var> is the initial second stage limit. The argument <var class="Arg">Delta</var> is the increment per curve for the first stage limit. The second stage limit is adjusted appropriately. Defaults are chosen for all arguments which are omitted.</p> | |
153 | ||
154 | <p><code class="code">FactorsECM</code> recognizes the option <var class="Arg">ECMDeterministic</var>. If set, the choice of the curves is deterministic. This means that in repeated runs of <code class="code">FactorsECM</code> the same curves are used, and hence for the same <span class="SimpleMath">n</span> the same factors are found after the same number of trials.</p> | |
155 | ||
156 | <p>The Elliptic Curves Method is based on the fact that exponentiation in the elliptic curve groups <span class="SimpleMath">E(a,b)/n</span> can be performed fast enough to compute for example <span class="SimpleMath">g^k!</span> for <span class="SimpleMath">k</span> large enough (e.g. 100000 or so) in a reasonable amount of time and without using much memory, and on Lagrange's Theorem. Assume that <span class="SimpleMath">p</span> is a prime divisor of <span class="SimpleMath">n</span>. Then Lagrange's Theorem states that if <span class="SimpleMath">k!</span> is a multiple of <span class="SimpleMath">|E(a,b)/p|</span>, then for any elliptic curve point <span class="SimpleMath">g</span>, the power <span class="SimpleMath">g^k!</span> is the identity element of <span class="SimpleMath">E(a,b)/p</span>. In this situation -- under reasonable circumstances -- the factor <span class="SimpleMath">p</span> can be determined by taking an appropriate gcd.</p> | |
157 | ||
158 | <p>In practice, the algorithm chooses in some sense "better" products <span class="SimpleMath">P_k</span> of small primes rather than <span class="SimpleMath">k!</span> as exponents. After reaching the first stage limit with <span class="SimpleMath">P_Limit1</span>, it considers further products <span class="SimpleMath">P_Limit1q</span> for primes <span class="SimpleMath">q</span> up to the second stage limit <var class="Arg">Limit2</var>, which is usually set equal to something like 100 times the first stage limit. The prime <span class="SimpleMath">q</span> corresponds to the largest prime factor of the order of the group <span class="SimpleMath">E(a,b)/p</span>.</p> | |
159 | ||
160 | <p>A prime divisor <span class="SimpleMath">p</span> is usually found if the largest prime factor of the order of one of the examined elliptic curve groups <span class="SimpleMath">E(a,b)/p</span> is at most <var class="Arg">Limit2</var> and the second-largest one is at most <var class="Arg">Limit1</var>. Thus trying a larger number of curves increases the chance of factoring <var class="Arg">n</var> as well as choosing a larger value for <var class="Arg">Limit1</var> and/or <var class="Arg">Limit2</var>. It turns out to be not optimal either to try a large number of curves with very small <var class="Arg">Limit1</var> and <var class="Arg">Limit2</var> or to try only a few curves with very large limits. (Compare with <code class="func">FactorsPminus1</code> (<a href="chap3.html#X7AF95E2E87F58200"><span class="RefLink">3.2-1</span></a>).)</p> | |
161 | ||
162 | <p>The elements of the group <span class="SimpleMath">E(a,b)/n</span> are the points <span class="SimpleMath">(x,y)</span> given by the solutions of <span class="SimpleMath">y^2 = x^3 + ax + by</span> in the residue class ring (mod <span class="SimpleMath">n</span>), and an additional point <span class="SimpleMath">∞</span> at infinity, which serves as identity element. To turn this set into a group, define the product (although elliptic curve groups are usually written additively, I prefer using the multiplicative notation here to retain the analogy to <code class="func">FactorsPminus1</code> (<a href="chap3.html#X7AF95E2E87F58200"><span class="RefLink">3.2-1</span></a>) and <code class="func">FactorsPplus1</code> (<a href="chap3.html#X8079A0367DE4FC35"><span class="RefLink">3.3-1</span></a>)) of two points <span class="SimpleMath">p_1</span> and <span class="SimpleMath">p_2</span> as follows: If <span class="SimpleMath">p_1 ≠ p_2</span>, let <span class="SimpleMath">l</span> be the line through <span class="SimpleMath">p_1</span> and <span class="SimpleMath">p_2</span>, otherwise let <span class="SimpleMath">l</span> be the tangent to the curve <span class="SimpleMath">C</span> given by the above equation in the point <span class="SimpleMath">p_1 = p_2</span>. The line <span class="SimpleMath">l</span> intersects <span class="SimpleMath">C</span> in a third point, say <span class="SimpleMath">p_3</span>. If <span class="SimpleMath">l</span> does not intersect the curve in a third affine point, then set <span class="SimpleMath">p_3 := ∞</span>. Define <span class="SimpleMath">p_1 ⋅ p_2</span> by the image of <span class="SimpleMath">p_3</span> under the reflection across the <span class="SimpleMath">x</span>-axis. Define the product of any curve point <span class="SimpleMath">p</span> and <span class="SimpleMath">∞</span> by <span class="SimpleMath">p</span> itself. This -- more or less obviously, checking associativity requires some calculation -- turns the set of points on the given curve into an abelian group <span class="SimpleMath">E(a,b)/n</span>.</p> | |
163 | ||
164 | <p>However, the calculations are done in projective coordinates to have an explicit representation of the identity element and to avoid calculating inverses (mod <span class="SimpleMath">n</span>) for the group operation. Otherwise this would require using an <span class="SimpleMath">O((log n)^3)</span>-algorithm, while multiplication (mod <span class="SimpleMath">n</span>) is only <span class="SimpleMath">O((log n)^2)</span>. The corresponding equation is given by <span class="SimpleMath">bY^2Z = X^3 + aX^2Z + XZ^2</span>. This form allows even more efficient computations than the Weierstrass model <span class="SimpleMath">Y^2Z = X^3 + aXZ^2 + bZ^3</span>, which is the projective equivalent of the affine representation <span class="SimpleMath">y^2 = x^3 + ax + by</span> mentioned above. The algorithm only keeps track of two of the three coordinates, namely <span class="SimpleMath">X</span> and <span class="SimpleMath">Z</span>. The curves are chosen in a way that ensures the order of the corresponding group to be divisible by 12. This increases the chance that it is smooth enough to find a factor of <span class="SimpleMath">n</span>. The implementation follows the description of R. P. Brent given in <a href="chapBib.html#biBBrent96">[Bre96]</a>, pp. 5 -- 8. In terms of this paper, for the second stage the "improved standard continuation" is used.</p> | |
165 | ||
166 | ||
167 | <div class="example"><pre> | |
168 | ||
169 | <span class="GAPprompt">gap></span> <span class="GAPinput">FactorsECM(2^256+1,100,10000,1000000,100);</span> | |
170 | [ [ 1238926361552897, | |
171 | 93461639715357977769163558199606896584051237541638188580280321 ] | |
172 | , [ ] ] | |
173 | ||
174 | </pre></div> | |
175 | ||
176 | <p><a id="X78466BB97BEE5495" name="X78466BB97BEE5495"></a></p> | |
177 | ||
178 | <h4>3.5 <span class="Heading">The Continued Fraction Algorithm (CFRAC)</span></h4> | |
179 | ||
180 | <p><a id="X7A5C8BC5861CFC8C" name="X7A5C8BC5861CFC8C"></a></p> | |
181 | ||
182 | <h5>3.5-1 FactorsCFRAC</h5> | |
183 | ||
184 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactorsCFRAC</code>( <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div> | |
185 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CFRAC</code>( <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div> | |
186 | <p>Returns: a list of the prime factors of <var class="Arg">n</var>.</p> | |
187 | ||
188 | <p>This function tries to factor <var class="Arg">n</var> using the Continued Fraction Algorithm (CFRAC), also known as Brillhart-Morrison Algorithm. In case of failure an error is signalled.</p> | |
189 | ||
190 | <p>Caution: The run time of this function depends only on the size of <var class="Arg">n</var>, and not on the size of the factors. Thus if a small factor is not found during the preprocessing which is done before invoking the sieving process, the run time is as long as if <var class="Arg">n</var> would have two prime factors of roughly equal size.</p> | |
191 | ||
192 | <p>The Continued Fraction Algorithm tries to find integers <span class="SimpleMath">x</span> and <span class="SimpleMath">y</span> such that <span class="SimpleMath">x^2 ≡ y^2</span> (mod <span class="SimpleMath">n</span>), but not <span class="SimpleMath">± x ≡ ± y</span> (mod <span class="SimpleMath">n</span>). In this situation, taking <span class="SimpleMath">gcd(x - y,n)</span> yields a nontrivial divisor of <span class="SimpleMath">n</span>. For determining such a pair <span class="SimpleMath">(x,y)</span>, the algorithm uses the continued fraction expansion of the square root of <span class="SimpleMath">n</span>. If <span class="SimpleMath">x_i/y_i</span> is a continued fraction approximation of the square root of <span class="SimpleMath">n</span>, then <span class="SimpleMath">c_i := x_i^2 - ny_i^2</span> is bounded by a small constant times the square root of <span class="SimpleMath">n</span>. The algorithm tries to find as many <span class="SimpleMath">c_i</span> as possible which factor completely over a chosen factor base (a list of small primes) or with only one factor not in the factor base. The latter ones can be used if and only if a second <span class="SimpleMath">c_i</span> with the same "large" factor is found. Once enough values <span class="SimpleMath">c_i</span> have been factored, as a final stage Gaussian Elimination over GF(2) is used to determine which of the congruences <span class="SimpleMath">x_i^2 ≡ c_i</span> (mod <span class="SimpleMath">n</span>) have to be multiplied together to obtain a congruence of the desired form <span class="SimpleMath">x^2 ≡ y^2</span> (mod <span class="SimpleMath">n</span>). Let <span class="SimpleMath">M</span> be the corresponding matrix. Then the entries of <span class="SimpleMath">M</span> are given by <span class="SimpleMath">M_ij = 1</span> if an odd power of the <span class="SimpleMath">j</span>-th element of the factor base divides the <span class="SimpleMath">i</span>-th usable factored value, and <span class="SimpleMath">M_ij = 0</span> otherwise. To obtain the desired congruence, it is necessary that the rows of <span class="SimpleMath">M</span> are linearly dependent. In other words, this means that the number of factored <span class="SimpleMath">c_i</span> needs to be larger than the rank of <span class="SimpleMath">M</span>, which is approximately given by the size of the factor base. (Compare with <code class="func">FactorsMPQS</code> (<a href="chap3.html#X86F8DFB681442E05"><span class="RefLink">3.6-1</span></a>).)</p> | |
193 | ||
194 | ||
195 | <div class="example"><pre> | |
196 | ||
197 | <span class="GAPprompt">gap></span> <span class="GAPinput">FactorsCFRAC( Factorial(34) - 1 );</span> | |
198 | [ 10398560889846739639, 28391697867333973241 ] | |
199 | ||
200 | </pre></div> | |
201 | ||
202 | <p><a id="X7A5C621C7FCFAA8A" name="X7A5C621C7FCFAA8A"></a></p> | |
203 | ||
204 | <h4>3.6 <span class="Heading">The Multiple Polynomial Quadratic Sieve (MPQS)</span></h4> | |
205 | ||
206 | <p><a id="X86F8DFB681442E05" name="X86F8DFB681442E05"></a></p> | |
207 | ||
208 | <h5>3.6-1 FactorsMPQS</h5> | |
209 | ||
210 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactorsMPQS</code>( <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div> | |
211 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ MPQS</code>( <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div> | |
212 | <p>Returns: a list of the prime factors of <var class="Arg">n</var>.</p> | |
213 | ||
214 | <p>This function tries to factor <var class="Arg">n</var> using the Single Large Prime Variation of the Multiple Polynomial Quadratic Sieve (MPQS). In case of failure an error is signalled.</p> | |
215 | ||
216 | <p>Caution: The run time of this function depends only on the size of <var class="Arg">n</var>, and not on the size of the factors. Thus if a small factor is not found during the preprocessing which is done before invoking the sieving process, the run time is as long as if <var class="Arg">n</var> would have two prime factors of roughly equal size.</p> | |
217 | ||
218 | <p>The intermediate results of a computation can be saved by interrupting it with <code class="code">[Ctrl][C]</code> and calling <code class="code">Pause();</code> from the break loop. This causes all data needed for resuming the computation again to be pushed as a record <var class="Arg">MPQSTmp</var> on the options stack. When called again with the same argument <var class="Arg">n</var>, <code class="code">FactorsMPQS</code> takes the record from the options stack and continues with the previously computed factorization data. For continuing the factorization process in another session, one needs to write this record to a file. This can be done by the function <code class="code">SaveMPQSTmp(<var class="Arg">filename</var>)</code>. The file written by this function can be read by the standard <code class="code">Read</code>-function of <strong class="pkg">GAP</strong>.</p> | |
219 | ||
220 | <p>The Multiple Polynomial Quadratic Sieve tries to find integers <span class="SimpleMath">x</span> and <span class="SimpleMath">y</span> such that <span class="SimpleMath">x^2 ≡ y^2</span> (mod <span class="SimpleMath">n</span>), but not <span class="SimpleMath">± x ≡ ± y</span> (mod <span class="SimpleMath">n</span>). In this situation, taking <span class="SimpleMath">gcd(x - y,n)</span> yields a nontrivial divisor of <span class="SimpleMath">n</span>. For determining such a pair <span class="SimpleMath">(x,y)</span>, the algorithm chooses polynomials <span class="SimpleMath">f_a</span> of the form <span class="SimpleMath">f_a(r) = ar^2 + 2br + c</span> with suitably chosen coefficients <span class="SimpleMath">a</span>, <span class="SimpleMath">b</span> and <span class="SimpleMath">c</span> which satisfy <span class="SimpleMath">b^2 ≡ n</span> (mod <span class="SimpleMath">a</span>) and <span class="SimpleMath">c = (b^2 - n)/a</span>. The identity <span class="SimpleMath">a ⋅ f_a(r) = (ar + b)^2 - n</span> yields a congruence (mod <span class="SimpleMath">n</span>) with a perfect square on one side and <span class="SimpleMath">a ⋅ f_a(r)</span> on the other. The algorithm uses a sieving technique similar to the Sieve of Eratosthenes over an appropriately chosen sieving interval to search for factorizations of values <span class="SimpleMath">f_a(r)</span> over a chosen factor base. Any two factorizations with the same single "large" factor which does not belong to the factor base can also be used. Taking more polynomials and hence shorter sieving intervals has the advantage of having to factor smaller values <span class="SimpleMath">f_a(r)</span> over the factor base.</p> | |
221 | ||
222 | <p>Once enough values <span class="SimpleMath">f_a(r)</span> have been factored, as a final stage Gaussian Elimination over GF(2) is used to determine which congruences have to be multiplied together to obtain a congruence of the desired form <span class="SimpleMath">x^2 ≡ y^2</span> (mod <span class="SimpleMath">n</span>). Let <span class="SimpleMath">M</span> be the corresponding matrix. Then the entries of <span class="SimpleMath">M</span> are given by <span class="SimpleMath">M_ij = 1</span> if an odd power of the <span class="SimpleMath">j</span>-th element of the factor base divides the <span class="SimpleMath">i</span>-th usable factored value, and <span class="SimpleMath">M_ij = 0</span> otherwise. To obtain the desired congruence, it is necessary that the rows of <span class="SimpleMath">M</span> are linearly dependent. In other words, this means that the number of usable factorizations of values <span class="SimpleMath">f_a(r)</span> needs to be larger than the rank of <span class="SimpleMath">M</span>. The latter is approximately equal to the size of the factor base. (Compare with <code class="func">FactorsCFRAC</code> (<a href="chap3.html#X7A5C8BC5861CFC8C"><span class="RefLink">3.5-1</span></a>).)</p> | |
223 | ||
224 | ||
225 | <div class="example"><pre> | |
226 | ||
227 | <span class="GAPprompt">gap></span> <span class="GAPinput">FactorsMPQS( Factorial(38) + 1 );</span> | |
228 | [ 14029308060317546154181, 37280713718589679646221 ] | |
229 | ||
230 | </pre></div> | |
231 | ||
232 | <p> </p> | |
233 | ||
234 | ||
235 | <div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap2.html">[Previous Chapter]</a> <a href="chap4.html">[Next Chapter]</a> </div> | |
236 | ||
237 | ||
238 | <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> | |
239 | ||
240 | <hr /> | |
241 | <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> | |
242 | </body> | |
243 | </html> |
0 | ||
1 | [1X3 [33X[0;0YThe Routines for Specific Factorization Methods[133X[101X | |
2 | ||
3 | [33X[0;0YDescriptions of the factoring methods implemented in this package can be | |
4 | found in [Bre89] and [Coh93]. Cohen's book contains also descriptions of the | |
5 | other methods mentioned in the preface.[133X | |
6 | ||
7 | ||
8 | [1X3.1 [33X[0;0YTrial division[133X[101X | |
9 | ||
10 | [1X3.1-1 FactorsTD[101X | |
11 | ||
12 | [33X[1;0Y[29X[2XFactorsTD[102X( [3Xn[103X[, [3XDivisors[103X] ) [32X function[133X | |
13 | [6XReturns:[106X [33X[0;10Ya list of two lists: The first list contains the prime factors | |
14 | found, and the second list contains remaining unfactored parts of | |
15 | [3Xn[103X, if there are any.[133X | |
16 | ||
17 | [33X[0;0YThis function tries to factor [3Xn[103X by trial division. The optional argument | |
18 | [3XDivisors[103X is the list of trial divisors. If not given, it defaults to the | |
19 | list of primes [22Xp < 1000[122X.[133X | |
20 | ||
21 | [4X[32X Example [32X[104X | |
22 | [4X[28X[128X[104X | |
23 | [4X[25Xgap>[125X [27XFactorsTD(12^25+25^12);[127X[104X | |
24 | [4X[28X[ [ 13, 19, 727 ], [ 5312510324723614735153 ] ][128X[104X | |
25 | [4X[28X[128X[104X | |
26 | [4X[32X[104X | |
27 | ||
28 | ||
29 | [1X3.2 [33X[0;0YPollard's [22Xp-1[122X[101X[1X[133X[101X | |
30 | ||
31 | [1X3.2-1 FactorsPminus1[101X | |
32 | ||
33 | [33X[1;0Y[29X[2XFactorsPminus1[102X( [3Xn[103X[[, [3Xa[103X], [3XLimit1[103X[, [3XLimit2[103X]] ) [32X function[133X | |
34 | [6XReturns:[106X [33X[0;10Ya list of two lists: The first list contains the prime factors | |
35 | found, and the second list contains remaining unfactored parts of | |
36 | [3Xn[103X, if there are any.[133X | |
37 | ||
38 | [33X[0;0YThis function tries to factor [3Xn[103X using Pollard's [22Xp-1[122X. It uses [3Xa[103X as base for | |
39 | exponentiation, [3XLimit1[103X as first stage limit and [3XLimit2[103X as second stage | |
40 | limit. If the function is called with three arguments, these arguments are | |
41 | interpreted as [3Xn[103X, [3XLimit1[103X and [3XLimit2[103X. Defaults are chosen for all arguments | |
42 | which are omitted.[133X | |
43 | ||
44 | [33X[0;0YPollard's [22Xp-1[122X is based on the fact that exponentiation (mod [22Xn[122X) can be done | |
45 | efficiently enough to compute [22Xa^k![122X mod [22Xn[122X for sufficiently large [22Xk[122X in a | |
46 | reasonable amount of time. Assume that [22Xp[122X is a prime factor of [22Xn[122X which does | |
47 | not divide [22Xa[122X, and that [22Xk![122X is a multiple of [22Xp-1[122X. Then Lagrange's Theorem | |
48 | states that [22Xa^k! ≡ 1[122X (mod [22Xp[122X). If [22Xk![122X is not a multiple of [22Xq-1[122X for another | |
49 | prime factor [22Xq[122X of [22Xn[122X, it is likely that the factor [22Xp[122X can be determined by | |
50 | computing [22Xgcd(a^k!-1,n)[122X. A prime factor [22Xp[122X is usually found if the largest | |
51 | prime factor of [22Xp-1[122X is not larger than [3XLimit2[103X, and the second-largest one is | |
52 | not larger than [3XLimit1[103X. (Compare with [2XFactorsPplus1[102X ([14X3.3-1[114X) and [2XFactorsECM[102X | |
53 | ([14X3.4-1[114X).)[133X | |
54 | ||
55 | [4X[32X Example [32X[104X | |
56 | [4X[28X[128X[104X | |
57 | [4X[25Xgap>[125X [27XFactorsPminus1( Factorial(158) + 1, 100000, 1000000 );[127X[104X | |
58 | [4X[28X[ [ 2879, 5227, 1452486383317, 9561906969931, 18331561438319, [128X[104X | |
59 | [4X[28X 4837142997094837608115811103417329505064932181226548534006749213\[128X[104X | |
60 | [4X[28X4508231090637045229565481657130504121732305287984292482612133314325471\[128X[104X | |
61 | [4X[28X3674832962773107806789945715570386038565256719614524924705165110048148\[128X[104X | |
62 | [4X[28X7161609649806290811760570095669 ], [ ] ][128X[104X | |
63 | [4X[25Xgap>[125X [27XList( last[ 1 ]{[ 3, 4, 5 ]}, p -> Factors( p - 1 ) );[127X[104X | |
64 | [4X[28X[ [ 2, 2, 3, 3, 81937, 492413 ], [ 2, 3, 3, 3, 5, 7, 7, 1481, 488011 ][128X[104X | |
65 | [4X[28X , [ 2, 3001, 7643, 399613 ] ][128X[104X | |
66 | [4X[28X[128X[104X | |
67 | [4X[32X[104X | |
68 | ||
69 | ||
70 | [1X3.3 [33X[0;0YWilliams' [22Xp+1[122X[101X[1X[133X[101X | |
71 | ||
72 | [1X3.3-1 FactorsPplus1[101X | |
73 | ||
74 | [33X[1;0Y[29X[2XFactorsPplus1[102X( [3Xn[103X[[, [3XResidues[103X], [3XLimit1[103X[, [3XLimit2[103X]] ) [32X function[133X | |
75 | [6XReturns:[106X [33X[0;10Ya list of two lists: The first list contains the prime factors | |
76 | found, and the second list contains remaining unfactored parts of | |
77 | [3Xn[103X, if there are any.[133X | |
78 | ||
79 | [33X[0;0YThis function tries to factor [3Xn[103X using Williams' [22Xp+1[122X. It tries [3XResidues[103X | |
80 | different residues, and uses [3XLimit1[103X as first stage limit and [3XLimit2[103X as | |
81 | second stage limit. If the function is called with three arguments, these | |
82 | arguments are interpreted as [3Xn[103X, [3XLimit1[103X and [3XLimit2[103X. Defaults are chosen for | |
83 | all arguments which are omitted.[133X | |
84 | ||
85 | [33X[0;0YWilliams' [22Xp+1[122X is very similar to Pollard's [22Xp-1[122X (see [2XFactorsPminus1[102X ([14X3.2-1[114X)). | |
86 | The difference is that the underlying group here can either have order [22Xp+1[122X | |
87 | or [22Xp-1[122X, and that the group operation takes more time. A prime factor [22Xp[122X is | |
88 | usually found if the largest prime factor of the group order is at most | |
89 | [3XLimit2[103X and the second-largest one is not larger than [3XLimit1[103X. (Compare also | |
90 | with [2XFactorsECM[102X ([14X3.4-1[114X).)[133X | |
91 | ||
92 | [4X[32X Example [32X[104X | |
93 | [4X[28X[128X[104X | |
94 | [4X[25Xgap>[125X [27XFactorsPplus1( Factorial(55) - 1, 10, 10000, 100000 );[127X[104X | |
95 | [4X[28X[ [ 73, 39619, 277914269, 148257413069 ], [128X[104X | |
96 | [4X[28X [ 106543529120049954955085076634537262459718863957 ] ][128X[104X | |
97 | [4X[25Xgap>[125X [27XList( last[ 1 ], p -> [ Factors( p - 1 ), Factors( p + 1 ) ] );[127X[104X | |
98 | [4X[28X[ [ [ 2, 2, 2, 3, 3 ], [ 2, 37 ] ], [128X[104X | |
99 | [4X[28X [ [ 2, 3, 3, 31, 71 ], [ 2, 2, 5, 7, 283 ] ], [128X[104X | |
100 | [4X[28X [ [ 2, 2, 2207, 31481 ], [ 2, 3, 5, 9263809 ] ], [128X[104X | |
101 | [4X[28X [ [ 2, 2, 47, 788603261 ], [ 2, 3, 5, 13, 37, 67, 89, 1723 ] ] ][128X[104X | |
102 | [4X[28X[128X[104X | |
103 | [4X[32X[104X | |
104 | ||
105 | ||
106 | [1X3.4 [33X[0;0YThe Elliptic Curves Method (ECM)[133X[101X | |
107 | ||
108 | [1X3.4-1 FactorsECM[101X | |
109 | ||
110 | [33X[1;0Y[29X[2XFactorsECM[102X( [3Xn[103X[, [3XCurves[103X[, [3XLimit1[103X[, [3XLimit2[103X[, [3XDelta[103X]]]] ) [32X function[133X | |
111 | [33X[1;0Y[29X[2XECM[102X( [3Xn[103X[, [3XCurves[103X[, [3XLimit1[103X[, [3XLimit2[103X[, [3XDelta[103X]]]] ) [32X function[133X | |
112 | [6XReturns:[106X [33X[0;10Ya list of two lists: The first list contains the prime factors | |
113 | found, and the second list contains remaining unfactored parts of | |
114 | [3Xn[103X, if there are any.[133X | |
115 | ||
116 | [33X[0;0YThis function tries to factor [3Xn[103X using the Elliptic Curves Method (ECM). The | |
117 | argument [3XCurves[103X is the number of curves to be tried. The argument [3XLimit1[103X is | |
118 | the initial first stage limit, and [3XLimit2[103X is the initial second stage limit. | |
119 | The argument [3XDelta[103X is the increment per curve for the first stage limit. The | |
120 | second stage limit is adjusted appropriately. Defaults are chosen for all | |
121 | arguments which are omitted.[133X | |
122 | ||
123 | [33X[0;0Y[10XFactorsECM[110X recognizes the option [3XECMDeterministic[103X. If set, the choice of the | |
124 | curves is deterministic. This means that in repeated runs of [10XFactorsECM[110X the | |
125 | same curves are used, and hence for the same [22Xn[122X the same factors are found | |
126 | after the same number of trials.[133X | |
127 | ||
128 | [33X[0;0YThe Elliptic Curves Method is based on the fact that exponentiation in the | |
129 | elliptic curve groups [22XE(a,b)/n[122X can be performed fast enough to compute for | |
130 | example [22Xg^k![122X for [22Xk[122X large enough (e.g. 100000 or so) in a reasonable amount | |
131 | of time and without using much memory, and on Lagrange's Theorem. Assume | |
132 | that [22Xp[122X is a prime divisor of [22Xn[122X. Then Lagrange's Theorem states that if [22Xk![122X is | |
133 | a multiple of [22X|E(a,b)/p|[122X, then for any elliptic curve point [22Xg[122X, the power | |
134 | [22Xg^k![122X is the identity element of [22XE(a,b)/p[122X. In this situation -- under | |
135 | reasonable circumstances -- the factor [22Xp[122X can be determined by taking an | |
136 | appropriate gcd.[133X | |
137 | ||
138 | [33X[0;0YIn practice, the algorithm chooses in some sense [21Xbetter[121X products [22XP_k[122X of | |
139 | small primes rather than [22Xk![122X as exponents. After reaching the first stage | |
140 | limit with [22XP_Limit1[122X, it considers further products [22XP_Limit1q[122X for primes [22Xq[122X up | |
141 | to the second stage limit [3XLimit2[103X, which is usually set equal to something | |
142 | like 100 times the first stage limit. The prime [22Xq[122X corresponds to the largest | |
143 | prime factor of the order of the group [22XE(a,b)/p[122X.[133X | |
144 | ||
145 | [33X[0;0YA prime divisor [22Xp[122X is usually found if the largest prime factor of the order | |
146 | of one of the examined elliptic curve groups [22XE(a,b)/p[122X is at most [3XLimit2[103X and | |
147 | the second-largest one is at most [3XLimit1[103X. Thus trying a larger number of | |
148 | curves increases the chance of factoring [3Xn[103X as well as choosing a larger | |
149 | value for [3XLimit1[103X and/or [3XLimit2[103X. It turns out to be not optimal either to try | |
150 | a large number of curves with very small [3XLimit1[103X and [3XLimit2[103X or to try only a | |
151 | few curves with very large limits. (Compare with [2XFactorsPminus1[102X ([14X3.2-1[114X).)[133X | |
152 | ||
153 | [33X[0;0YThe elements of the group [22XE(a,b)/n[122X are the points [22X(x,y)[122X given by the | |
154 | solutions of [22Xy^2 = x^3 + ax + by[122X in the residue class ring (mod [22Xn[122X), and an | |
155 | additional point [22X∞[122X at infinity, which serves as identity element. To turn | |
156 | this set into a group, define the product (although elliptic curve groups | |
157 | are usually written additively, I prefer using the multiplicative notation | |
158 | here to retain the analogy to [2XFactorsPminus1[102X ([14X3.2-1[114X) and [2XFactorsPplus1[102X | |
159 | ([14X3.3-1[114X)) of two points [22Xp_1[122X and [22Xp_2[122X as follows: If [22Xp_1 ≠ p_2[122X, let [22Xl[122X be the | |
160 | line through [22Xp_1[122X and [22Xp_2[122X, otherwise let [22Xl[122X be the tangent to the curve [22XC[122X | |
161 | given by the above equation in the point [22Xp_1 = p_2[122X. The line [22Xl[122X intersects [22XC[122X | |
162 | in a third point, say [22Xp_3[122X. If [22Xl[122X does not intersect the curve in a third | |
163 | affine point, then set [22Xp_3 := ∞[122X. Define [22Xp_1 ⋅ p_2[122X by the image of [22Xp_3[122X under | |
164 | the reflection across the [22Xx[122X-axis. Define the product of any curve point [22Xp[122X | |
165 | and [22X∞[122X by [22Xp[122X itself. This -- more or less obviously, checking associativity | |
166 | requires some calculation -- turns the set of points on the given curve into | |
167 | an abelian group [22XE(a,b)/n[122X.[133X | |
168 | ||
169 | [33X[0;0YHowever, the calculations are done in projective coordinates to have an | |
170 | explicit representation of the identity element and to avoid calculating | |
171 | inverses (mod [22Xn[122X) for the group operation. Otherwise this would require using | |
172 | an [22XO((log n)^3)[122X-algorithm, while multiplication (mod [22Xn[122X) is only [22XO((log | |
173 | n)^2)[122X. The corresponding equation is given by [22XbY^2Z = X^3 + aX^2Z + XZ^2[122X. | |
174 | This form allows even more efficient computations than the Weierstrass model | |
175 | [22XY^2Z = X^3 + aXZ^2 + bZ^3[122X, which is the projective equivalent of the affine | |
176 | representation [22Xy^2 = x^3 + ax + by[122X mentioned above. The algorithm only keeps | |
177 | track of two of the three coordinates, namely [22XX[122X and [22XZ[122X. The curves are chosen | |
178 | in a way that ensures the order of the corresponding group to be divisible | |
179 | by 12. This increases the chance that it is smooth enough to find a factor | |
180 | of [22Xn[122X. The implementation follows the description of R. P. Brent given in | |
181 | [Bre96], pp. 5 -- 8. In terms of this paper, for the second stage the | |
182 | [21Ximproved standard continuation[121X is used.[133X | |
183 | ||
184 | [4X[32X Example [32X[104X | |
185 | [4X[28X[128X[104X | |
186 | [4X[25Xgap>[125X [27XFactorsECM(2^256+1,100,10000,1000000,100);[127X[104X | |
187 | [4X[28X[ [ 1238926361552897, [128X[104X | |
188 | [4X[28X 93461639715357977769163558199606896584051237541638188580280321 ][128X[104X | |
189 | [4X[28X , [ ] ][128X[104X | |
190 | [4X[28X[128X[104X | |
191 | [4X[32X[104X | |
192 | ||
193 | ||
194 | [1X3.5 [33X[0;0YThe Continued Fraction Algorithm (CFRAC)[133X[101X | |
195 | ||
196 | [1X3.5-1 FactorsCFRAC[101X | |
197 | ||
198 | [33X[1;0Y[29X[2XFactorsCFRAC[102X( [3Xn[103X ) [32X function[133X | |
199 | [33X[1;0Y[29X[2XCFRAC[102X( [3Xn[103X ) [32X function[133X | |
200 | [6XReturns:[106X [33X[0;10Ya list of the prime factors of [3Xn[103X.[133X | |
201 | ||
202 | [33X[0;0YThis function tries to factor [3Xn[103X using the Continued Fraction Algorithm | |
203 | (CFRAC), also known as Brillhart-Morrison Algorithm. In case of failure an | |
204 | error is signalled.[133X | |
205 | ||
206 | [33X[0;0YCaution: The run time of this function depends only on the size of [3Xn[103X, and | |
207 | not on the size of the factors. Thus if a small factor is not found during | |
208 | the preprocessing which is done before invoking the sieving process, the run | |
209 | time is as long as if [3Xn[103X would have two prime factors of roughly equal size.[133X | |
210 | ||
211 | [33X[0;0YThe Continued Fraction Algorithm tries to find integers [22Xx[122X and [22Xy[122X such that | |
212 | [22Xx^2 ≡ y^2[122X (mod [22Xn[122X), but not [22X± x ≡ ± y[122X (mod [22Xn[122X). In this situation, taking | |
213 | [22Xgcd(x - y,n)[122X yields a nontrivial divisor of [22Xn[122X. For determining such a pair | |
214 | [22X(x,y)[122X, the algorithm uses the continued fraction expansion of the square | |
215 | root of [22Xn[122X. If [22Xx_i/y_i[122X is a continued fraction approximation of the square | |
216 | root of [22Xn[122X, then [22Xc_i := x_i^2 - ny_i^2[122X is bounded by a small constant times | |
217 | the square root of [22Xn[122X. The algorithm tries to find as many [22Xc_i[122X as possible | |
218 | which factor completely over a chosen factor base (a list of small primes) | |
219 | or with only one factor not in the factor base. The latter ones can be used | |
220 | if and only if a second [22Xc_i[122X with the same [21Xlarge[121X factor is found. Once enough | |
221 | values [22Xc_i[122X have been factored, as a final stage Gaussian Elimination over | |
222 | GF(2) is used to determine which of the congruences [22Xx_i^2 ≡ c_i[122X (mod [22Xn[122X) have | |
223 | to be multiplied together to obtain a congruence of the desired form [22Xx^2 ≡ | |
224 | y^2[122X (mod [22Xn[122X). Let [22XM[122X be the corresponding matrix. Then the entries of [22XM[122X are | |
225 | given by [22XM_ij = 1[122X if an odd power of the [22Xj[122X-th element of the factor base | |
226 | divides the [22Xi[122X-th usable factored value, and [22XM_ij = 0[122X otherwise. To obtain | |
227 | the desired congruence, it is necessary that the rows of [22XM[122X are linearly | |
228 | dependent. In other words, this means that the number of factored [22Xc_i[122X needs | |
229 | to be larger than the rank of [22XM[122X, which is approximately given by the size of | |
230 | the factor base. (Compare with [2XFactorsMPQS[102X ([14X3.6-1[114X).)[133X | |
231 | ||
232 | [4X[32X Example [32X[104X | |
233 | [4X[28X[128X[104X | |
234 | [4X[25Xgap>[125X [27XFactorsCFRAC( Factorial(34) - 1 );[127X[104X | |
235 | [4X[28X[ 10398560889846739639, 28391697867333973241 ][128X[104X | |
236 | [4X[28X[128X[104X | |
237 | [4X[32X[104X | |
238 | ||
239 | ||
240 | [1X3.6 [33X[0;0YThe Multiple Polynomial Quadratic Sieve (MPQS)[133X[101X | |
241 | ||
242 | [1X3.6-1 FactorsMPQS[101X | |
243 | ||
244 | [33X[1;0Y[29X[2XFactorsMPQS[102X( [3Xn[103X ) [32X function[133X | |
245 | [33X[1;0Y[29X[2XMPQS[102X( [3Xn[103X ) [32X function[133X | |
246 | [6XReturns:[106X [33X[0;10Ya list of the prime factors of [3Xn[103X.[133X | |
247 | ||
248 | [33X[0;0YThis function tries to factor [3Xn[103X using the Single Large Prime Variation of | |
249 | the Multiple Polynomial Quadratic Sieve (MPQS). In case of failure an error | |
250 | is signalled.[133X | |
251 | ||
252 | [33X[0;0YCaution: The run time of this function depends only on the size of [3Xn[103X, and | |
253 | not on the size of the factors. Thus if a small factor is not found during | |
254 | the preprocessing which is done before invoking the sieving process, the run | |
255 | time is as long as if [3Xn[103X would have two prime factors of roughly equal size.[133X | |
256 | ||
257 | [33X[0;0YThe intermediate results of a computation can be saved by interrupting it | |
258 | with [10X[Ctrl][C][110X and calling [10XPause();[110X from the break loop. This causes all | |
259 | data needed for resuming the computation again to be pushed as a record | |
260 | [3XMPQSTmp[103X on the options stack. When called again with the same argument [3Xn[103X, | |
261 | [10XFactorsMPQS[110X takes the record from the options stack and continues with the | |
262 | previously computed factorization data. For continuing the factorization | |
263 | process in another session, one needs to write this record to a file. This | |
264 | can be done by the function [10XSaveMPQSTmp([3Xfilename[103X[10X)[110X. The file written by this | |
265 | function can be read by the standard [10XRead[110X-function of [5XGAP[105X.[133X | |
266 | ||
267 | [33X[0;0YThe Multiple Polynomial Quadratic Sieve tries to find integers [22Xx[122X and [22Xy[122X such | |
268 | that [22Xx^2 ≡ y^2[122X (mod [22Xn[122X), but not [22X± x ≡ ± y[122X (mod [22Xn[122X). In this situation, taking | |
269 | [22Xgcd(x - y,n)[122X yields a nontrivial divisor of [22Xn[122X. For determining such a pair | |
270 | [22X(x,y)[122X, the algorithm chooses polynomials [22Xf_a[122X of the form [22Xf_a(r) = ar^2 + 2br | |
271 | + c[122X with suitably chosen coefficients [22Xa[122X, [22Xb[122X and [22Xc[122X which satisfy [22Xb^2 ≡ n[122X | |
272 | (mod [22Xa[122X) and [22Xc = (b^2 - n)/a[122X. The identity [22Xa ⋅ f_a(r) = (ar + b)^2 - n[122X yields | |
273 | a congruence (mod [22Xn[122X) with a perfect square on one side and [22Xa ⋅ f_a(r)[122X on the | |
274 | other. The algorithm uses a sieving technique similar to the Sieve of | |
275 | Eratosthenes over an appropriately chosen sieving interval to search for | |
276 | factorizations of values [22Xf_a(r)[122X over a chosen factor base. Any two | |
277 | factorizations with the same single [21Xlarge[121X factor which does not belong to | |
278 | the factor base can also be used. Taking more polynomials and hence shorter | |
279 | sieving intervals has the advantage of having to factor smaller values | |
280 | [22Xf_a(r)[122X over the factor base.[133X | |
281 | ||
282 | [33X[0;0YOnce enough values [22Xf_a(r)[122X have been factored, as a final stage Gaussian | |
283 | Elimination over GF(2) is used to determine which congruences have to be | |
284 | multiplied together to obtain a congruence of the desired form [22Xx^2 ≡ y^2[122X | |
285 | (mod [22Xn[122X). Let [22XM[122X be the corresponding matrix. Then the entries of [22XM[122X are given | |
286 | by [22XM_ij = 1[122X if an odd power of the [22Xj[122X-th element of the factor base divides | |
287 | the [22Xi[122X-th usable factored value, and [22XM_ij = 0[122X otherwise. To obtain the | |
288 | desired congruence, it is necessary that the rows of [22XM[122X are linearly | |
289 | dependent. In other words, this means that the number of usable | |
290 | factorizations of values [22Xf_a(r)[122X needs to be larger than the rank of [22XM[122X. The | |
291 | latter is approximately equal to the size of the factor base. (Compare | |
292 | with [2XFactorsCFRAC[102X ([14X3.5-1[114X).)[133X | |
293 | ||
294 | [4X[32X Example [32X[104X | |
295 | [4X[28X[128X[104X | |
296 | [4X[25Xgap>[125X [27XFactorsMPQS( Factorial(38) + 1 );[127X[104X | |
297 | [4X[28X[ 14029308060317546154181, 37280713718589679646221 ][128X[104X | |
298 | [4X[28X[128X[104X | |
299 | [4X[32X[104X | |
300 |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <script type="text/javascript" | |
8 | src="http://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> | |
9 | </script> | |
10 | <title>GAP (FactInt) - Chapter 3: The Routines for Specific Factorization Methods</title> | |
11 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
12 | <meta name="generator" content="GAPDoc2HTML" /> | |
13 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
14 | <script src="manual.js" type="text/javascript"></script> | |
15 | <script type="text/javascript">overwriteStyle();</script> | |
16 | </head> | |
17 | <body class="chap3" onload="jscontent()"> | |
18 | ||
19 | ||
20 | <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div> | |
21 | ||
22 | <div class="chlinkprevnexttop"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap2_mj.html">[Previous Chapter]</a> <a href="chap4_mj.html">[Next Chapter]</a> </div> | |
23 | ||
24 | <p id="mathjaxlink" class="pcenter"><a href="chap3.html">[MathJax off]</a></p> | |
25 | <p><a id="X7E7EE1A1785A8009" name="X7E7EE1A1785A8009"></a></p> | |
26 | <div class="ChapSects"><a href="chap3_mj.html#X7E7EE1A1785A8009">3 <span class="Heading">The Routines for Specific Factorization Methods</span></a> | |
27 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X7A0392177E697956">3.1 <span class="Heading">Trial division</span></a> | |
28 | </span> | |
29 | <div class="ContSSBlock"> | |
30 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X7C4D255A789F54B4">3.1-1 FactorsTD</a></span> | |
31 | </div></div> | |
32 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X8081FF657DA9C674">3.2 <span class="Heading">Pollard's <span class="SimpleMath">\(p-1\)</span></span></a> | |
33 | </span> | |
34 | <div class="ContSSBlock"> | |
35 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X7AF95E2E87F58200">3.2-1 FactorsPminus1</a></span> | |
36 | </div></div> | |
37 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X860B4BE37DABDE10">3.3 <span class="Heading">Williams' <span class="SimpleMath">\(p+1\)</span></span></a> | |
38 | </span> | |
39 | <div class="ContSSBlock"> | |
40 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X8079A0367DE4FC35">3.3-1 FactorsPplus1</a></span> | |
41 | </div></div> | |
42 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X7837106783A5194B">3.4 <span class="Heading">The Elliptic Curves Method (ECM)</span></a> | |
43 | </span> | |
44 | <div class="ContSSBlock"> | |
45 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X87B162F878AD031C">3.4-1 FactorsECM</a></span> | |
46 | </div></div> | |
47 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X78466BB97BEE5495">3.5 <span class="Heading">The Continued Fraction Algorithm (CFRAC)</span></a> | |
48 | </span> | |
49 | <div class="ContSSBlock"> | |
50 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X7A5C8BC5861CFC8C">3.5-1 FactorsCFRAC</a></span> | |
51 | </div></div> | |
52 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X7A5C621C7FCFAA8A">3.6 <span class="Heading">The Multiple Polynomial Quadratic Sieve (MPQS)</span></a> | |
53 | </span> | |
54 | <div class="ContSSBlock"> | |
55 | <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X86F8DFB681442E05">3.6-1 FactorsMPQS</a></span> | |
56 | </div></div> | |
57 | </div> | |
58 | ||
59 | <h3>3 <span class="Heading">The Routines for Specific Factorization Methods</span></h3> | |
60 | ||
61 | <p>Descriptions of the factoring methods implemented in this package can be found in <a href="chapBib_mj.html#biBBressoud89">[Bre89]</a> and <a href="chapBib_mj.html#biBCohen93">[Coh93]</a>. Cohen's book contains also descriptions of the other methods mentioned in the preface.</p> | |
62 | ||
63 | <p><a id="X7A0392177E697956" name="X7A0392177E697956"></a></p> | |
64 | ||
65 | <h4>3.1 <span class="Heading">Trial division</span></h4> | |
66 | ||
67 | <p><a id="X7C4D255A789F54B4" name="X7C4D255A789F54B4"></a></p> | |
68 | ||
69 | <h5>3.1-1 FactorsTD</h5> | |
70 | ||
71 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactorsTD</code>( <var class="Arg">n</var>[, <var class="Arg">Divisors</var>] )</td><td class="tdright">( function )</td></tr></table></div> | |
72 | <p>Returns: a list of two lists: The first list contains the prime factors found, and the second list contains remaining unfactored parts of <var class="Arg">n</var>, if there are any.</p> | |
73 | ||
74 | <p>This function tries to factor <var class="Arg">n</var> by trial division. The optional argument <var class="Arg">Divisors</var> is the list of trial divisors. If not given, it defaults to the list of primes <span class="SimpleMath">\(p < 1000\)</span>.</p> | |
75 | ||
76 | ||
77 | <div class="example"><pre> | |
78 | ||
79 | <span class="GAPprompt">gap></span> <span class="GAPinput">FactorsTD(12^25+25^12);</span> | |
80 | [ [ 13, 19, 727 ], [ 5312510324723614735153 ] ] | |
81 | ||
82 | </pre></div> | |
83 | ||
84 | <p><a id="X8081FF657DA9C674" name="X8081FF657DA9C674"></a></p> | |
85 | ||
86 | <h4>3.2 <span class="Heading">Pollard's <span class="SimpleMath">\(p-1\)</span></span></h4> | |
87 | ||
88 | <p><a id="X7AF95E2E87F58200" name="X7AF95E2E87F58200"></a></p> | |
89 | ||
90 | <h5>3.2-1 FactorsPminus1</h5> | |
91 | ||
92 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactorsPminus1</code>( <var class="Arg">n</var>[[, <var class="Arg">a</var>], <var class="Arg">Limit1</var>[, <var class="Arg">Limit2</var>]] )</td><td class="tdright">( function )</td></tr></table></div> | |
93 | <p>Returns: a list of two lists: The first list contains the prime factors found, and the second list contains remaining unfactored parts of <var class="Arg">n</var>, if there are any.</p> | |
94 | ||
95 | <p>This function tries to factor <var class="Arg">n</var> using Pollard's <span class="SimpleMath">\(p-1\)</span>. It uses <var class="Arg">a</var> as base for exponentiation, <var class="Arg">Limit1</var> as first stage limit and <var class="Arg">Limit2</var> as second stage limit. If the function is called with three arguments, these arguments are interpreted as <var class="Arg">n</var>, <var class="Arg">Limit1</var> and <var class="Arg">Limit2</var>. Defaults are chosen for all arguments which are omitted.</p> | |
96 | ||
97 | <p>Pollard's <span class="SimpleMath">\(p-1\)</span> is based on the fact that exponentiation (mod <span class="SimpleMath">\(n\)</span>) can be done efficiently enough to compute <span class="SimpleMath">\(a^{k!}\)</span> mod <span class="SimpleMath">\(n\)</span> for sufficiently large <span class="SimpleMath">\(k\)</span> in a reasonable amount of time. Assume that <span class="SimpleMath">\(p\)</span> is a prime factor of <span class="SimpleMath">\(n\)</span> which does not divide <span class="SimpleMath">\(a\)</span>, and that <span class="SimpleMath">\(k!\)</span> is a multiple of <span class="SimpleMath">\(p-1\)</span>. Then Lagrange's Theorem states that <span class="SimpleMath">\(a^{k!} \equiv 1\)</span> (mod <span class="SimpleMath">\(p\)</span>). If <span class="SimpleMath">\(k!\)</span> is not a multiple of <span class="SimpleMath">\(q-1\)</span> for another prime factor <span class="SimpleMath">\(q\)</span> of <span class="SimpleMath">\(n\)</span>, it is likely that the factor <span class="SimpleMath">\(p\)</span> can be determined by computing <span class="SimpleMath">\(\gcd(a^{k!}-1,n)\)</span>. A prime factor <span class="SimpleMath">\(p\)</span> is usually found if the largest prime factor of <span class="SimpleMath">\(p-1\)</span> is not larger than <var class="Arg">Limit2</var>, and the second-largest one is not larger than <var class="Arg">Limit1</var>. (Compare with <code class="func">FactorsPplus1</code> (<a href="chap3_mj.html#X8079A0367DE4FC35"><span class="RefLink">3.3-1</span></a>) and <code class="func">FactorsECM</code> (<a href="chap3_mj.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>).)</p> | |
98 | ||
99 | ||
100 | <div class="example"><pre> | |
101 | ||
102 | <span class="GAPprompt">gap></span> <span class="GAPinput">FactorsPminus1( Factorial(158) + 1, 100000, 1000000 );</span> | |
103 | [ [ 2879, 5227, 1452486383317, 9561906969931, 18331561438319, | |
104 | 4837142997094837608115811103417329505064932181226548534006749213\ | |
105 | 4508231090637045229565481657130504121732305287984292482612133314325471\ | |
106 | 3674832962773107806789945715570386038565256719614524924705165110048148\ | |
107 | 7161609649806290811760570095669 ], [ ] ] | |
108 | <span class="GAPprompt">gap></span> <span class="GAPinput">List( last[ 1 ]{[ 3, 4, 5 ]}, p -> Factors( p - 1 ) );</span> | |
109 | [ [ 2, 2, 3, 3, 81937, 492413 ], [ 2, 3, 3, 3, 5, 7, 7, 1481, 488011 ] | |
110 | , [ 2, 3001, 7643, 399613 ] ] | |
111 | ||
112 | </pre></div> | |
113 | ||
114 | <p><a id="X860B4BE37DABDE10" name="X860B4BE37DABDE10"></a></p> | |
115 | ||
116 | <h4>3.3 <span class="Heading">Williams' <span class="SimpleMath">\(p+1\)</span></span></h4> | |
117 | ||
118 | <p><a id="X8079A0367DE4FC35" name="X8079A0367DE4FC35"></a></p> | |
119 | ||
120 | <h5>3.3-1 FactorsPplus1</h5> | |
121 | ||
122 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactorsPplus1</code>( <var class="Arg">n</var>[[, <var class="Arg">Residues</var>], <var class="Arg">Limit1</var>[, <var class="Arg">Limit2</var>]] )</td><td class="tdright">( function )</td></tr></table></div> | |
123 | <p>Returns: a list of two lists: The first list contains the prime factors found, and the second list contains remaining unfactored parts of <var class="Arg">n</var>, if there are any.</p> | |
124 | ||
125 | <p>This function tries to factor <var class="Arg">n</var> using Williams' <span class="SimpleMath">\(p+1\)</span>. It tries <var class="Arg">Residues</var> different residues, and uses <var class="Arg">Limit1</var> as first stage limit and <var class="Arg">Limit2</var> as second stage limit. If the function is called with three arguments, these arguments are interpreted as <var class="Arg">n</var>, <var class="Arg">Limit1</var> and <var class="Arg">Limit2</var>. Defaults are chosen for all arguments which are omitted.</p> | |
126 | ||
127 | <p>Williams' <span class="SimpleMath">\(p+1\)</span> is very similar to Pollard's <span class="SimpleMath">\(p-1\)</span> (see <code class="func">FactorsPminus1</code> (<a href="chap3_mj.html#X7AF95E2E87F58200"><span class="RefLink">3.2-1</span></a>)). The difference is that the underlying group here can either have order <span class="SimpleMath">\(p+1\)</span> or <span class="SimpleMath">\(p-1\)</span>, and that the group operation takes more time. A prime factor <span class="SimpleMath">\(p\)</span> is usually found if the largest prime factor of the group order is at most <var class="Arg">Limit2</var> and the second-largest one is not larger than <var class="Arg">Limit1</var>. (Compare also with <code class="func">FactorsECM</code> (<a href="chap3_mj.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>).)</p> | |
128 | ||
129 | ||
130 | <div class="example"><pre> | |
131 | ||
132 | <span class="GAPprompt">gap></span> <span class="GAPinput">FactorsPplus1( Factorial(55) - 1, 10, 10000, 100000 );</span> | |
133 | [ [ 73, 39619, 277914269, 148257413069 ], | |
134 | [ 106543529120049954955085076634537262459718863957 ] ] | |
135 | <span class="GAPprompt">gap></span> <span class="GAPinput">List( last[ 1 ], p -> [ Factors( p - 1 ), Factors( p + 1 ) ] );</span> | |
136 | [ [ [ 2, 2, 2, 3, 3 ], [ 2, 37 ] ], | |
137 | [ [ 2, 3, 3, 31, 71 ], [ 2, 2, 5, 7, 283 ] ], | |
138 | [ [ 2, 2, 2207, 31481 ], [ 2, 3, 5, 9263809 ] ], | |
139 | [ [ 2, 2, 47, 788603261 ], [ 2, 3, 5, 13, 37, 67, 89, 1723 ] ] ] | |
140 | ||
141 | </pre></div> | |
142 | ||
143 | <p><a id="X7837106783A5194B" name="X7837106783A5194B"></a></p> | |
144 | ||
145 | <h4>3.4 <span class="Heading">The Elliptic Curves Method (ECM)</span></h4> | |
146 | ||
147 | <p><a id="X87B162F878AD031C" name="X87B162F878AD031C"></a></p> | |
148 | ||
149 | <h5>3.4-1 FactorsECM</h5> | |
150 | ||
151 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactorsECM</code>( <var class="Arg">n</var>[, <var class="Arg">Curves</var>[, <var class="Arg">Limit1</var>[, <var class="Arg">Limit2</var>[, <var class="Arg">Delta</var>]]]] )</td><td class="tdright">( function )</td></tr></table></div> | |
152 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ECM</code>( <var class="Arg">n</var>[, <var class="Arg">Curves</var>[, <var class="Arg">Limit1</var>[, <var class="Arg">Limit2</var>[, <var class="Arg">Delta</var>]]]] )</td><td class="tdright">( function )</td></tr></table></div> | |
153 | <p>Returns: a list of two lists: The first list contains the prime factors found, and the second list contains remaining unfactored parts of <var class="Arg">n</var>, if there are any.</p> | |
154 | ||
155 | <p>This function tries to factor <var class="Arg">n</var> using the Elliptic Curves Method (ECM). The argument <var class="Arg">Curves</var> is the number of curves to be tried. The argument <var class="Arg">Limit1</var> is the initial first stage limit, and <var class="Arg">Limit2</var> is the initial second stage limit. The argument <var class="Arg">Delta</var> is the increment per curve for the first stage limit. The second stage limit is adjusted appropriately. Defaults are chosen for all arguments which are omitted.</p> | |
156 | ||
157 | <p><code class="code">FactorsECM</code> recognizes the option <var class="Arg">ECMDeterministic</var>. If set, the choice of the curves is deterministic. This means that in repeated runs of <code class="code">FactorsECM</code> the same curves are used, and hence for the same <span class="SimpleMath">\(n\)</span> the same factors are found after the same number of trials.</p> | |
158 | ||
159 | <p>The Elliptic Curves Method is based on the fact that exponentiation in the elliptic curve groups <span class="SimpleMath">\(E(a,b)/n\)</span> can be performed fast enough to compute for example <span class="SimpleMath">\(g^{k!}\)</span> for <span class="SimpleMath">\(k\)</span> large enough (e.g. 100000 or so) in a reasonable amount of time and without using much memory, and on Lagrange's Theorem. Assume that <span class="SimpleMath">\(p\)</span> is a prime divisor of <span class="SimpleMath">\(n\)</span>. Then Lagrange's Theorem states that if <span class="SimpleMath">\(k!\)</span> is a multiple of <span class="SimpleMath">\(|E(a,b)/p|\)</span>, then for any elliptic curve point <span class="SimpleMath">\(g\)</span>, the power <span class="SimpleMath">\(g^{k!}\)</span> is the identity element of <span class="SimpleMath">\(E(a,b)/p\)</span>. In this situation -- under reasonable circumstances -- the factor <span class="SimpleMath">\(p\)</span> can be determined by taking an appropriate gcd.</p> | |
160 | ||
161 | <p>In practice, the algorithm chooses in some sense "better" products <span class="SimpleMath">\(P_k\)</span> of small primes rather than <span class="SimpleMath">\(k!\)</span> as exponents. After reaching the first stage limit with <span class="SimpleMath">\(P_{Limit1}\)</span>, it considers further products <span class="SimpleMath">\(P_{Limit1}q\)</span> for primes <span class="SimpleMath">\(q\)</span> up to the second stage limit <var class="Arg">Limit2</var>, which is usually set equal to something like 100 times the first stage limit. The prime <span class="SimpleMath">\(q\)</span> corresponds to the largest prime factor of the order of the group <span class="SimpleMath">\(E(a,b)/p\)</span>.</p> | |
162 | ||
163 | <p>A prime divisor <span class="SimpleMath">\(p\)</span> is usually found if the largest prime factor of the order of one of the examined elliptic curve groups <span class="SimpleMath">\(E(a,b)/p\)</span> is at most <var class="Arg">Limit2</var> and the second-largest one is at most <var class="Arg">Limit1</var>. Thus trying a larger number of curves increases the chance of factoring <var class="Arg">n</var> as well as choosing a larger value for <var class="Arg">Limit1</var> and/or <var class="Arg">Limit2</var>. It turns out to be not optimal either to try a large number of curves with very small <var class="Arg">Limit1</var> and <var class="Arg">Limit2</var> or to try only a few curves with very large limits. (Compare with <code class="func">FactorsPminus1</code> (<a href="chap3_mj.html#X7AF95E2E87F58200"><span class="RefLink">3.2-1</span></a>).)</p> | |
164 | ||
165 | <p>The elements of the group <span class="SimpleMath">\(E(a,b)/n\)</span> are the points <span class="SimpleMath">\((x,y)\)</span> given by the solutions of <span class="SimpleMath">\(y^2 = x^3 + ax + by\)</span> in the residue class ring (mod <span class="SimpleMath">\(n\)</span>), and an additional point <span class="SimpleMath">\(\infty\)</span> at infinity, which serves as identity element. To turn this set into a group, define the product (although elliptic curve groups are usually written additively, I prefer using the multiplicative notation here to retain the analogy to <code class="func">FactorsPminus1</code> (<a href="chap3_mj.html#X7AF95E2E87F58200"><span class="RefLink">3.2-1</span></a>) and <code class="func">FactorsPplus1</code> (<a href="chap3_mj.html#X8079A0367DE4FC35"><span class="RefLink">3.3-1</span></a>)) of two points <span class="SimpleMath">\(p_1\)</span> and <span class="SimpleMath">\(p_2\)</span> as follows: If <span class="SimpleMath">\(p_1 \neq p_2\)</span>, let <span class="SimpleMath">\(l\)</span> be the line through <span class="SimpleMath">\(p_1\)</span> and <span class="SimpleMath">\(p_2\)</span>, otherwise let <span class="SimpleMath">\(l\)</span> be the tangent to the curve <span class="SimpleMath">\(C\)</span> given by the above equation in the point <span class="SimpleMath">\(p_1 = p_2\)</span>. The line <span class="SimpleMath">\(l\)</span> intersects <span class="SimpleMath">\(C\)</span> in a third point, say <span class="SimpleMath">\(p_3\)</span>. If <span class="SimpleMath">\(l\)</span> does not intersect the curve in a third affine point, then set <span class="SimpleMath">\(p_3 := \infty\)</span>. Define <span class="SimpleMath">\(p_1 \cdot p_2\)</span> by the image of <span class="SimpleMath">\(p_3\)</span> under the reflection across the <span class="SimpleMath">\(x\)</span>-axis. Define the product of any curve point <span class="SimpleMath">\(p\)</span> and <span class="SimpleMath">\(\infty\)</span> by <span class="SimpleMath">\(p\)</span> itself. This -- more or less obviously, checking associativity requires some calculation -- turns the set of points on the given curve into an abelian group <span class="SimpleMath">\(E(a,b)/n\)</span>.</p> | |
166 | ||
167 | <p>However, the calculations are done in projective coordinates to have an explicit representation of the identity element and to avoid calculating inverses (mod <span class="SimpleMath">\(n\)</span>) for the group operation. Otherwise this would require using an <span class="SimpleMath">\(O((log \ n)^3)\)</span>-algorithm, while multiplication (mod <span class="SimpleMath">\(n\)</span>) is only <span class="SimpleMath">\(O((log \ n)^2)\)</span>. The corresponding equation is given by <span class="SimpleMath">\(bY^2Z = X^3 + aX^2Z + XZ^2\)</span>. This form allows even more efficient computations than the Weierstrass model <span class="SimpleMath">\(Y^2Z = X^3 + aXZ^2 + bZ^3\)</span>, which is the projective equivalent of the affine representation <span class="SimpleMath">\(y^2 = x^3 + ax + by\)</span> mentioned above. The algorithm only keeps track of two of the three coordinates, namely <span class="SimpleMath">\(X\)</span> and <span class="SimpleMath">\(Z\)</span>. The curves are chosen in a way that ensures the order of the corresponding group to be divisible by 12. This increases the chance that it is smooth enough to find a factor of <span class="SimpleMath">\(n\)</span>. The implementation follows the description of R. P. Brent given in <a href="chapBib_mj.html#biBBrent96">[Bre96]</a>, pp. 5 -- 8. In terms of this paper, for the second stage the "improved standard continuation" is used.</p> | |
168 | ||
169 | ||
170 | <div class="example"><pre> | |
171 | ||
172 | <span class="GAPprompt">gap></span> <span class="GAPinput">FactorsECM(2^256+1,100,10000,1000000,100);</span> | |
173 | [ [ 1238926361552897, | |
174 | 93461639715357977769163558199606896584051237541638188580280321 ] | |
175 | , [ ] ] | |
176 | ||
177 | </pre></div> | |
178 | ||
179 | <p><a id="X78466BB97BEE5495" name="X78466BB97BEE5495"></a></p> | |
180 | ||
181 | <h4>3.5 <span class="Heading">The Continued Fraction Algorithm (CFRAC)</span></h4> | |
182 | ||
183 | <p><a id="X7A5C8BC5861CFC8C" name="X7A5C8BC5861CFC8C"></a></p> | |
184 | ||
185 | <h5>3.5-1 FactorsCFRAC</h5> | |
186 | ||
187 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactorsCFRAC</code>( <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div> | |
188 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CFRAC</code>( <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div> | |
189 | <p>Returns: a list of the prime factors of <var class="Arg">n</var>.</p> | |
190 | ||
191 | <p>This function tries to factor <var class="Arg">n</var> using the Continued Fraction Algorithm (CFRAC), also known as Brillhart-Morrison Algorithm. In case of failure an error is signalled.</p> | |
192 | ||
193 | <p>Caution: The run time of this function depends only on the size of <var class="Arg">n</var>, and not on the size of the factors. Thus if a small factor is not found during the preprocessing which is done before invoking the sieving process, the run time is as long as if <var class="Arg">n</var> would have two prime factors of roughly equal size.</p> | |
194 | ||
195 | <p>The Continued Fraction Algorithm tries to find integers <span class="SimpleMath">\(x\)</span> and <span class="SimpleMath">\(y\)</span> such that <span class="SimpleMath">\(x^2 \equiv y^2\)</span> (mod <span class="SimpleMath">\(n\)</span>), but not <span class="SimpleMath">\(\pm x \equiv \pm y\)</span> (mod <span class="SimpleMath">\(n\)</span>). In this situation, taking <span class="SimpleMath">\(\gcd(x - y,n)\)</span> yields a nontrivial divisor of <span class="SimpleMath">\(n\)</span>. For determining such a pair <span class="SimpleMath">\((x,y)\)</span>, the algorithm uses the continued fraction expansion of the square root of <span class="SimpleMath">\(n\)</span>. If <span class="SimpleMath">\(x_i/y_i\)</span> is a continued fraction approximation of the square root of <span class="SimpleMath">\(n\)</span>, then <span class="SimpleMath">\(c_i := x_i^2 - ny_i^2\)</span> is bounded by a small constant times the square root of <span class="SimpleMath">\(n\)</span>. The algorithm tries to find as many <span class="SimpleMath">\(c_i\)</span> as possible which factor completely over a chosen factor base (a list of small primes) or with only one factor not in the factor base. The latter ones can be used if and only if a second <span class="SimpleMath">\(c_i\)</span> with the same "large" factor is found. Once enough values <span class="SimpleMath">\(c_i\)</span> have been factored, as a final stage Gaussian Elimination over GF(2) is used to determine which of the congruences <span class="SimpleMath">\(x_i^2 \equiv c_i\)</span> (mod <span class="SimpleMath">\(n\)</span>) have to be multiplied together to obtain a congruence of the desired form <span class="SimpleMath">\(x^2 \equiv y^2\)</span> (mod <span class="SimpleMath">\(n\)</span>). Let <span class="SimpleMath">\(M\)</span> be the corresponding matrix. Then the entries of <span class="SimpleMath">\(M\)</span> are given by <span class="SimpleMath">\(M_{ij} = 1\)</span> if an odd power of the <span class="SimpleMath">\(j\)</span>-th element of the factor base divides the <span class="SimpleMath">\(i\)</span>-th usable factored value, and <span class="SimpleMath">\(M_{ij} = 0\)</span> otherwise. To obtain the desired congruence, it is necessary that the rows of <span class="SimpleMath">\(M\)</span> are linearly dependent. In other words, this means that the number of factored <span class="SimpleMath">\(c_i\)</span> needs to be larger than the rank of <span class="SimpleMath">\(M\)</span>, which is approximately given by the size of the factor base. (Compare with <code class="func">FactorsMPQS</code> (<a href="chap3_mj.html#X86F8DFB681442E05"><span class="RefLink">3.6-1</span></a>).)</p> | |
196 | ||
197 | ||
198 | <div class="example"><pre> | |
199 | ||
200 | <span class="GAPprompt">gap></span> <span class="GAPinput">FactorsCFRAC( Factorial(34) - 1 );</span> | |
201 | [ 10398560889846739639, 28391697867333973241 ] | |
202 | ||
203 | </pre></div> | |
204 | ||
205 | <p><a id="X7A5C621C7FCFAA8A" name="X7A5C621C7FCFAA8A"></a></p> | |
206 | ||
207 | <h4>3.6 <span class="Heading">The Multiple Polynomial Quadratic Sieve (MPQS)</span></h4> | |
208 | ||
209 | <p><a id="X86F8DFB681442E05" name="X86F8DFB681442E05"></a></p> | |
210 | ||
211 | <h5>3.6-1 FactorsMPQS</h5> | |
212 | ||
213 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FactorsMPQS</code>( <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div> | |
214 | <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ MPQS</code>( <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div> | |
215 | <p>Returns: a list of the prime factors of <var class="Arg">n</var>.</p> | |
216 | ||
217 | <p>This function tries to factor <var class="Arg">n</var> using the Single Large Prime Variation of the Multiple Polynomial Quadratic Sieve (MPQS). In case of failure an error is signalled.</p> | |
218 | ||
219 | <p>Caution: The run time of this function depends only on the size of <var class="Arg">n</var>, and not on the size of the factors. Thus if a small factor is not found during the preprocessing which is done before invoking the sieving process, the run time is as long as if <var class="Arg">n</var> would have two prime factors of roughly equal size.</p> | |
220 | ||
221 | <p>The intermediate results of a computation can be saved by interrupting it with <code class="code">[Ctrl][C]</code> and calling <code class="code">Pause();</code> from the break loop. This causes all data needed for resuming the computation again to be pushed as a record <var class="Arg">MPQSTmp</var> on the options stack. When called again with the same argument <var class="Arg">n</var>, <code class="code">FactorsMPQS</code> takes the record from the options stack and continues with the previously computed factorization data. For continuing the factorization process in another session, one needs to write this record to a file. This can be done by the function <code class="code">SaveMPQSTmp(<var class="Arg">filename</var>)</code>. The file written by this function can be read by the standard <code class="code">Read</code>-function of <strong class="pkg">GAP</strong>.</p> | |
222 | ||
223 | <p>The Multiple Polynomial Quadratic Sieve tries to find integers <span class="SimpleMath">\(x\)</span> and <span class="SimpleMath">\(y\)</span> such that <span class="SimpleMath">\(x^2 \equiv y^2\)</span> (mod <span class="SimpleMath">\(n\)</span>), but not <span class="SimpleMath">\(\pm x \equiv \pm y\)</span> (mod <span class="SimpleMath">\(n\)</span>). In this situation, taking <span class="SimpleMath">\(\gcd(x - y,n)\)</span> yields a nontrivial divisor of <span class="SimpleMath">\(n\)</span>. For determining such a pair <span class="SimpleMath">\((x,y)\)</span>, the algorithm chooses polynomials <span class="SimpleMath">\(f_a\)</span> of the form <span class="SimpleMath">\(f_a(r) = ar^2 + 2br + c\)</span> with suitably chosen coefficients <span class="SimpleMath">\(a\)</span>, <span class="SimpleMath">\(b\)</span> and <span class="SimpleMath">\(c\)</span> which satisfy <span class="SimpleMath">\(b^2 \equiv n\)</span> (mod <span class="SimpleMath">\(a\)</span>) and <span class="SimpleMath">\(c = (b^2 - n)/a\)</span>. The identity <span class="SimpleMath">\(a \cdot f_a(r) = (ar + b)^2 - n\)</span> yields a congruence (mod <span class="SimpleMath">\(n\)</span>) with a perfect square on one side and <span class="SimpleMath">\(a \cdot f_a(r)\)</span> on the other. The algorithm uses a sieving technique similar to the Sieve of Eratosthenes over an appropriately chosen sieving interval to search for factorizations of values <span class="SimpleMath">\(f_a(r)\)</span> over a chosen factor base. Any two factorizations with the same single "large" factor which does not belong to the factor base can also be used. Taking more polynomials and hence shorter sieving intervals has the advantage of having to factor smaller values <span class="SimpleMath">\(f_a(r)\)</span> over the factor base.</p> | |
224 | ||
225 | <p>Once enough values <span class="SimpleMath">\(f_a(r)\)</span> have been factored, as a final stage Gaussian Elimination over GF(2) is used to determine which congruences have to be multiplied together to obtain a congruence of the desired form <span class="SimpleMath">\(x^2 \equiv y^2\)</span> (mod <span class="SimpleMath">\(n\)</span>). Let <span class="SimpleMath">\(M\)</span> be the corresponding matrix. Then the entries of <span class="SimpleMath">\(M\)</span> are given by <span class="SimpleMath">\(M_{ij} = 1\)</span> if an odd power of the <span class="SimpleMath">\(j\)</span>-th element of the factor base divides the <span class="SimpleMath">\(i\)</span>-th usable factored value, and <span class="SimpleMath">\(M_{ij} = 0\)</span> otherwise. To obtain the desired congruence, it is necessary that the rows of <span class="SimpleMath">\(M\)</span> are linearly dependent. In other words, this means that the number of usable factorizations of values <span class="SimpleMath">\(f_a(r)\)</span> needs to be larger than the rank of <span class="SimpleMath">\(M\)</span>. The latter is approximately equal to the size of the factor base. (Compare with <code class="func">FactorsCFRAC</code> (<a href="chap3_mj.html#X7A5C8BC5861CFC8C"><span class="RefLink">3.5-1</span></a>).)</p> | |
226 | ||
227 | ||
228 | <div class="example"><pre> | |
229 | ||
230 | <span class="GAPprompt">gap></span> <span class="GAPinput">FactorsMPQS( Factorial(38) + 1 );</span> | |
231 | [ 14029308060317546154181, 37280713718589679646221 ] | |
232 | ||
233 | </pre></div> | |
234 | ||
235 | <p> </p> | |
236 | ||
237 | ||
238 | <div class="chlinkprevnextbot"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap2_mj.html">[Previous Chapter]</a> <a href="chap4_mj.html">[Next Chapter]</a> </div> | |
239 | ||
240 | ||
241 | <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div> | |
242 | ||
243 | <hr /> | |
244 | <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> | |
245 | </body> | |
246 | </html> |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <title>GAP (FactInt) - Chapter 4: How much Time does a Factorization take?</title> | |
8 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
9 | <meta name="generator" content="GAPDoc2HTML" /> | |
10 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
11 | <script src="manual.js" type="text/javascript"></script> | |
12 | <script type="text/javascript">overwriteStyle();</script> | |
13 | </head> | |
14 | <body class="chap4" onload="jscontent()"> | |
15 | ||
16 | ||
17 | <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> | |
18 | ||
19 | <div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap3.html">[Previous Chapter]</a> <a href="chapBib.html">[Next Chapter]</a> </div> | |
20 | ||
21 | <p id="mathjaxlink" class="pcenter"><a href="chap4_mj.html">[MathJax on]</a></p> | |
22 | <p><a id="X85B6B6E4796B99EE" name="X85B6B6E4796B99EE"></a></p> | |
23 | <div class="ChapSects"><a href="chap4.html#X85B6B6E4796B99EE">4 <span class="Heading">How much Time does a Factorization take?</span></a> | |
24 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4.html#X825FC33479FE2B1D">4.1 <span class="Heading">Timings for the general factorization routine</span></a> | |
25 | </span> | |
26 | </div> | |
27 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4.html#X8131C8BD7F637545">4.2 <span class="Heading">Timings for the ECM</span></a> | |
28 | </span> | |
29 | </div> | |
30 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4.html#X7E2D09BD7AD0D77F">4.3 <span class="Heading">Timings for the MPQS</span></a> | |
31 | </span> | |
32 | </div> | |
33 | </div> | |
34 | ||
35 | <h3>4 <span class="Heading">How much Time does a Factorization take?</span></h3> | |
36 | ||
37 | <p><a id="X825FC33479FE2B1D" name="X825FC33479FE2B1D"></a></p> | |
38 | ||
39 | <h4>4.1 <span class="Heading">Timings for the general factorization routine</span></h4> | |
40 | ||
41 | <p>A few words in advance: In general, it is not possible to give a precise prediction for the CPU time needed for factoring a given integer. This time depends heavily on the sizes of the factors of the given number and on some other properties which cannot be tested before actually doing the factorization. But nevertheless, rough run time estimates can be given for numbers with factors of given orders of magnitude.</p> | |
42 | ||
43 | <p>After casting out the small and other "easy" factors -- which should not take more than at most a few minutes for numbers of "reasonable" size -- the general factorization routine uses first ECM (see <code class="func">FactorsECM</code> (<a href="chap3.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>)) for finding factors very roughly up to the third root of the remaining composite and then the MPQS (see <code class="func">FactorsMPQS</code> (<a href="chap3.html#X86F8DFB681442E05"><span class="RefLink">3.6-1</span></a>)) for doing the "rest" of the work. The latter is often the most time-consuming part.</p> | |
44 | ||
45 | <p>In the sequel, some timings for the ECM and for the MPQS are given. These methods are by far the most important ones with respect to run time statistics (the <span class="SimpleMath">p ± 1</span>-methods (see <code class="func">FactorsPminus1</code> (<a href="chap3.html#X7AF95E2E87F58200"><span class="RefLink">3.2-1</span></a>) and <code class="func">FactorsPplus1</code> (<a href="chap3.html#X8079A0367DE4FC35"><span class="RefLink">3.3-1</span></a>)) are only suitable for finding factors with certain properties and CFRAC (see <code class="func">FactorsCFRAC</code> (<a href="chap3.html#X7A5C8BC5861CFC8C"><span class="RefLink">3.5-1</span></a>)) is just a slower predecessor of the MPQS). All absolute timings are given for a Pentium 200 under Windows as a reference machine (this was a fast machine at the time the first version of this package has been written).</p> | |
46 | ||
47 | <p><a id="X8131C8BD7F637545" name="X8131C8BD7F637545"></a></p> | |
48 | ||
49 | <h4>4.2 <span class="Heading">Timings for the ECM</span></h4> | |
50 | ||
51 | <p>The run time of <code class="code">FactorsECM</code> depends mainly on the size of the factors of the input number. On average, finding a 12-digit factor of a 100-digit number takes about 1 min 40 s, finding a 15-digit factor of a 100-digit number takes about 10 min and finding an 18-digit factor of a 100-digit number takes about 50 min. A general rule of thumb is the following: one digit more increases the run time by a bit less than a factor of two. These timings are very rough, and they may vary by a factor of 10 or more. You can compare trying an elliptic curve with throwing a couple of dice, where a success corresponds to the case where all of them show the same side -- it is possible to be successful with the first trial, but it is also possible that this takes much longer. In particular, all trials are independent of one another. In general, ECM is superior to Pollard's Rho for finding factors with at least 10 decimal digits. In the same time needed by Pollard's Rho for finding a 13-digit factor one can reasonably expect to find a 17-digit factor when using ECM, for which Pollard's Rho in turn would need about 100 times as long as ECM. For larger factors this difference grows rapidly. From theory it can be said that finding a 20-digit factor requires about 500 times as much work as finding a 10-digit factor, finding a 30-digit factor requires about 160 times as much work as finding a 20-digit factor and finding a 40-digit factor requires about 80 times as much work as finding a 30-digit factor.</p> | |
52 | ||
53 | <p>The default parameters are optimized for finding factors with about 15 -- 35 digits. This seems to be a sensible choice, since this is the most important range for the application of ECM. The function <code class="code">FactorsECM</code> usually gives up when the input number <span class="SimpleMath">n</span> has two factors which are both larger than its third root. This is of course only a "probabilistic" statement. Sometimes -- but seldom -- the remaining composite has 3 factors, 4 factors should occur (almost) never.</p> | |
54 | ||
55 | <p>The user can of course specify other parameters than the default ones, but giving timings for all possible choices is obviously impossible. The interested reader should follow the references given in the bibliography at the end of this manual for getting information on how many curves with which parameters are usually needed for finding factors of a given size. This depends mainly on the distribution of primes, respectively of numbers with prime factors not exceeding a certain bound.</p> | |
56 | ||
57 | <p>For benchmarking purposes, the amount of time needed for trying a single curve with given smoothness bounds for a number of given size is suited best. A typical example is the following: one curve with (<var class="Arg">Limit1</var>,<var class="Arg">Limit2</var>) = (100000,10000000) applied to a 100-digit integer requires a total of 10 min 20 s, where 6 min 45 s are spent for the first stage and 3 min 35 s are spent for the second stage. The time needed for the first stage is approximately linear in <var class="Arg">Limit1</var> and the time needed for the second stage is a bit less than linear in <var class="Arg">Limit2</var>.</p> | |
58 | ||
59 | <p><a id="X7E2D09BD7AD0D77F" name="X7E2D09BD7AD0D77F"></a></p> | |
60 | ||
61 | <h4>4.3 <span class="Heading">Timings for the MPQS</span></h4> | |
62 | ||
63 | <p>The run time of <code class="code">FactorsMPQS</code> depends only on the size of the input number, and not on the size of its factors. Rough timings are as follows: 90 s for a 40-digit number, 10 min for a 50-digit number, 2 h for a 60-digit number, 20 h for a 70-digit number and 100 h for a 75-digit number. These timings are much more precise than those given for ECM, but they may also vary by a factor of 2 or 3 depending on whether a good factor base can be found without using a large multiplier or not. A general rule of thumb is the following: 10 digits more cause 10 times as much work. For benchmarking purposes, precise timings for some integers are given: <span class="SimpleMath">38!+1</span> (45 digits, good factor base with multiplier 1): 2 min 22 s, <span class="SimpleMath">40!-1</span> (48 digits, not so good factor base even with multiplier 7): 8 min 58 s, cofactor of <span class="SimpleMath">1093^33+1</span> (61 digits, good factor base with multiplier 1): 1 h 12 min.</p> | |
64 | ||
65 | ||
66 | <div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap3.html">[Previous Chapter]</a> <a href="chapBib.html">[Next Chapter]</a> </div> | |
67 | ||
68 | ||
69 | <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> | |
70 | ||
71 | <hr /> | |
72 | <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> | |
73 | </body> | |
74 | </html> |
0 | ||
1 | [1X4 [33X[0;0YHow much Time does a Factorization take?[133X[101X | |
2 | ||
3 | ||
4 | [1X4.1 [33X[0;0YTimings for the general factorization routine[133X[101X | |
5 | ||
6 | [33X[0;0YA few words in advance: In general, it is not possible to give a precise | |
7 | prediction for the CPU time needed for factoring a given integer. This time | |
8 | depends heavily on the sizes of the factors of the given number and on some | |
9 | other properties which cannot be tested before actually doing the | |
10 | factorization. But nevertheless, rough run time estimates can be given for | |
11 | numbers with factors of given orders of magnitude.[133X | |
12 | ||
13 | [33X[0;0YAfter casting out the small and other [21Xeasy[121X factors -- which should not take | |
14 | more than at most a few minutes for numbers of [21Xreasonable[121X size -- the | |
15 | general factorization routine uses first ECM (see [2XFactorsECM[102X ([14X3.4-1[114X)) for | |
16 | finding factors very roughly up to the third root of the remaining composite | |
17 | and then the MPQS (see [2XFactorsMPQS[102X ([14X3.6-1[114X)) for doing the [21Xrest[121X of the work. | |
18 | The latter is often the most time-consuming part.[133X | |
19 | ||
20 | [33X[0;0YIn the sequel, some timings for the ECM and for the MPQS are given. These | |
21 | methods are by far the most important ones with respect to run time | |
22 | statistics (the [22Xp ± 1[122X-methods (see [2XFactorsPminus1[102X ([14X3.2-1[114X) and [2XFactorsPplus1[102X | |
23 | ([14X3.3-1[114X)) are only suitable for finding factors with certain properties and | |
24 | CFRAC (see [2XFactorsCFRAC[102X ([14X3.5-1[114X)) is just a slower predecessor of the MPQS). | |
25 | All absolute timings are given for a Pentium 200 under Windows as a | |
26 | reference machine (this was a fast machine at the time the first version of | |
27 | this package has been written).[133X | |
28 | ||
29 | ||
30 | [1X4.2 [33X[0;0YTimings for the ECM[133X[101X | |
31 | ||
32 | [33X[0;0YThe run time of [10XFactorsECM[110X depends mainly on the size of the factors of the | |
33 | input number. On average, finding a 12-digit factor of a 100-digit number | |
34 | takes about 1 min 40 s, finding a 15-digit factor of a 100-digit number | |
35 | takes about 10 min and finding an 18-digit factor of a 100-digit number | |
36 | takes about 50 min. A general rule of thumb is the following: one digit more | |
37 | increases the run time by a bit less than a factor of two. These timings are | |
38 | very rough, and they may vary by a factor of 10 or more. You can compare | |
39 | trying an elliptic curve with throwing a couple of dice, where a success | |
40 | corresponds to the case where all of them show the same side -- it is | |
41 | possible to be successful with the first trial, but it is also possible that | |
42 | this takes much longer. In particular, all trials are independent of one | |
43 | another. In general, ECM is superior to Pollard's Rho for finding factors | |
44 | with at least 10 decimal digits. In the same time needed by Pollard's Rho | |
45 | for finding a 13-digit factor one can reasonably expect to find a 17-digit | |
46 | factor when using ECM, for which Pollard's Rho in turn would need about 100 | |
47 | times as long as ECM. For larger factors this difference grows rapidly. From | |
48 | theory it can be said that finding a 20-digit factor requires about 500 | |
49 | times as much work as finding a 10-digit factor, finding a 30-digit factor | |
50 | requires about 160 times as much work as finding a 20-digit factor and | |
51 | finding a 40-digit factor requires about 80 times as much work as finding a | |
52 | 30-digit factor.[133X | |
53 | ||
54 | [33X[0;0YThe default parameters are optimized for finding factors with about 15 -- 35 | |
55 | digits. This seems to be a sensible choice, since this is the most important | |
56 | range for the application of ECM. The function [10XFactorsECM[110X usually gives up | |
57 | when the input number [22Xn[122X has two factors which are both larger than its third | |
58 | root. This is of course only a [21Xprobabilistic[121X statement. Sometimes -- but | |
59 | seldom -- the remaining composite has 3 factors, 4 factors should occur | |
60 | (almost) never.[133X | |
61 | ||
62 | [33X[0;0YThe user can of course specify other parameters than the default ones, but | |
63 | giving timings for all possible choices is obviously impossible. The | |
64 | interested reader should follow the references given in the bibliography at | |
65 | the end of this manual for getting information on how many curves with which | |
66 | parameters are usually needed for finding factors of a given size. This | |
67 | depends mainly on the distribution of primes, respectively of numbers with | |
68 | prime factors not exceeding a certain bound.[133X | |
69 | ||
70 | [33X[0;0YFor benchmarking purposes, the amount of time needed for trying a single | |
71 | curve with given smoothness bounds for a number of given size is suited | |
72 | best. A typical example is the following: one curve with ([3XLimit1[103X,[3XLimit2[103X) = | |
73 | (100000,10000000) applied to a 100-digit integer requires a total of | |
74 | 10 min 20 s, where 6 min 45 s are spent for the first stage and 3 min 35 s | |
75 | are spent for the second stage. The time needed for the first stage is | |
76 | approximately linear in [3XLimit1[103X and the time needed for the second stage is a | |
77 | bit less than linear in [3XLimit2[103X.[133X | |
78 | ||
79 | ||
80 | [1X4.3 [33X[0;0YTimings for the MPQS[133X[101X | |
81 | ||
82 | [33X[0;0YThe run time of [10XFactorsMPQS[110X depends only on the size of the input number, | |
83 | and not on the size of its factors. Rough timings are as follows: 90 s for a | |
84 | 40-digit number, 10 min for a 50-digit number, 2 h for a 60-digit number, | |
85 | 20 h for a 70-digit number and 100 h for a 75-digit number. These timings | |
86 | are much more precise than those given for ECM, but they may also vary by a | |
87 | factor of 2 or 3 depending on whether a good factor base can be found | |
88 | without using a large multiplier or not. A general rule of thumb is the | |
89 | following: 10 digits more cause 10 times as much work. For benchmarking | |
90 | purposes, precise timings for some integers are given: [22X38!+1[122X (45 digits, | |
91 | good factor base with multiplier 1): 2 min 22 s, [22X40!-1[122X (48 digits, not so | |
92 | good factor base even with multiplier 7): 8 min 58 s, cofactor of [22X1093^33+1[122X | |
93 | (61 digits, good factor base with multiplier 1): 1 h 12 min.[133X | |
94 |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <script type="text/javascript" | |
8 | src="http://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> | |
9 | </script> | |
10 | <title>GAP (FactInt) - Chapter 4: How much Time does a Factorization take?</title> | |
11 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
12 | <meta name="generator" content="GAPDoc2HTML" /> | |
13 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
14 | <script src="manual.js" type="text/javascript"></script> | |
15 | <script type="text/javascript">overwriteStyle();</script> | |
16 | </head> | |
17 | <body class="chap4" onload="jscontent()"> | |
18 | ||
19 | ||
20 | <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div> | |
21 | ||
22 | <div class="chlinkprevnexttop"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap3_mj.html">[Previous Chapter]</a> <a href="chapBib_mj.html">[Next Chapter]</a> </div> | |
23 | ||
24 | <p id="mathjaxlink" class="pcenter"><a href="chap4.html">[MathJax off]</a></p> | |
25 | <p><a id="X85B6B6E4796B99EE" name="X85B6B6E4796B99EE"></a></p> | |
26 | <div class="ChapSects"><a href="chap4_mj.html#X85B6B6E4796B99EE">4 <span class="Heading">How much Time does a Factorization take?</span></a> | |
27 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4_mj.html#X825FC33479FE2B1D">4.1 <span class="Heading">Timings for the general factorization routine</span></a> | |
28 | </span> | |
29 | </div> | |
30 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4_mj.html#X8131C8BD7F637545">4.2 <span class="Heading">Timings for the ECM</span></a> | |
31 | </span> | |
32 | </div> | |
33 | <div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4_mj.html#X7E2D09BD7AD0D77F">4.3 <span class="Heading">Timings for the MPQS</span></a> | |
34 | </span> | |
35 | </div> | |
36 | </div> | |
37 | ||
38 | <h3>4 <span class="Heading">How much Time does a Factorization take?</span></h3> | |
39 | ||
40 | <p><a id="X825FC33479FE2B1D" name="X825FC33479FE2B1D"></a></p> | |
41 | ||
42 | <h4>4.1 <span class="Heading">Timings for the general factorization routine</span></h4> | |
43 | ||
44 | <p>A few words in advance: In general, it is not possible to give a precise prediction for the CPU time needed for factoring a given integer. This time depends heavily on the sizes of the factors of the given number and on some other properties which cannot be tested before actually doing the factorization. But nevertheless, rough run time estimates can be given for numbers with factors of given orders of magnitude.</p> | |
45 | ||
46 | <p>After casting out the small and other "easy" factors -- which should not take more than at most a few minutes for numbers of "reasonable" size -- the general factorization routine uses first ECM (see <code class="func">FactorsECM</code> (<a href="chap3_mj.html#X87B162F878AD031C"><span class="RefLink">3.4-1</span></a>)) for finding factors very roughly up to the third root of the remaining composite and then the MPQS (see <code class="func">FactorsMPQS</code> (<a href="chap3_mj.html#X86F8DFB681442E05"><span class="RefLink">3.6-1</span></a>)) for doing the "rest" of the work. The latter is often the most time-consuming part.</p> | |
47 | ||
48 | <p>In the sequel, some timings for the ECM and for the MPQS are given. These methods are by far the most important ones with respect to run time statistics (the <span class="SimpleMath">\(p \pm 1\)</span>-methods (see <code class="func">FactorsPminus1</code> (<a href="chap3_mj.html#X7AF95E2E87F58200"><span class="RefLink">3.2-1</span></a>) and <code class="func">FactorsPplus1</code> (<a href="chap3_mj.html#X8079A0367DE4FC35"><span class="RefLink">3.3-1</span></a>)) are only suitable for finding factors with certain properties and CFRAC (see <code class="func">FactorsCFRAC</code> (<a href="chap3_mj.html#X7A5C8BC5861CFC8C"><span class="RefLink">3.5-1</span></a>)) is just a slower predecessor of the MPQS). All absolute timings are given for a Pentium 200 under Windows as a reference machine (this was a fast machine at the time the first version of this package has been written).</p> | |
49 | ||
50 | <p><a id="X8131C8BD7F637545" name="X8131C8BD7F637545"></a></p> | |
51 | ||
52 | <h4>4.2 <span class="Heading">Timings for the ECM</span></h4> | |
53 | ||
54 | <p>The run time of <code class="code">FactorsECM</code> depends mainly on the size of the factors of the input number. On average, finding a 12-digit factor of a 100-digit number takes about 1 min 40 s, finding a 15-digit factor of a 100-digit number takes about 10 min and finding an 18-digit factor of a 100-digit number takes about 50 min. A general rule of thumb is the following: one digit more increases the run time by a bit less than a factor of two. These timings are very rough, and they may vary by a factor of 10 or more. You can compare trying an elliptic curve with throwing a couple of dice, where a success corresponds to the case where all of them show the same side -- it is possible to be successful with the first trial, but it is also possible that this takes much longer. In particular, all trials are independent of one another. In general, ECM is superior to Pollard's Rho for finding factors with at least 10 decimal digits. In the same time needed by Pollard's Rho for finding a 13-digit factor one can reasonably expect to find a 17-digit factor when using ECM, for which Pollard's Rho in turn would need about 100 times as long as ECM. For larger factors this difference grows rapidly. From theory it can be said that finding a 20-digit factor requires about 500 times as much work as finding a 10-digit factor, finding a 30-digit factor requires about 160 times as much work as finding a 20-digit factor and finding a 40-digit factor requires about 80 times as much work as finding a 30-digit factor.</p> | |
55 | ||
56 | <p>The default parameters are optimized for finding factors with about 15 -- 35 digits. This seems to be a sensible choice, since this is the most important range for the application of ECM. The function <code class="code">FactorsECM</code> usually gives up when the input number <span class="SimpleMath">\(n\)</span> has two factors which are both larger than its third root. This is of course only a "probabilistic" statement. Sometimes -- but seldom -- the remaining composite has 3 factors, 4 factors should occur (almost) never.</p> | |
57 | ||
58 | <p>The user can of course specify other parameters than the default ones, but giving timings for all possible choices is obviously impossible. The interested reader should follow the references given in the bibliography at the end of this manual for getting information on how many curves with which parameters are usually needed for finding factors of a given size. This depends mainly on the distribution of primes, respectively of numbers with prime factors not exceeding a certain bound.</p> | |
59 | ||
60 | <p>For benchmarking purposes, the amount of time needed for trying a single curve with given smoothness bounds for a number of given size is suited best. A typical example is the following: one curve with (<var class="Arg">Limit1</var>,<var class="Arg">Limit2</var>) = (100000,10000000) applied to a 100-digit integer requires a total of 10 min 20 s, where 6 min 45 s are spent for the first stage and 3 min 35 s are spent for the second stage. The time needed for the first stage is approximately linear in <var class="Arg">Limit1</var> and the time needed for the second stage is a bit less than linear in <var class="Arg">Limit2</var>.</p> | |
61 | ||
62 | <p><a id="X7E2D09BD7AD0D77F" name="X7E2D09BD7AD0D77F"></a></p> | |
63 | ||
64 | <h4>4.3 <span class="Heading">Timings for the MPQS</span></h4> | |
65 | ||
66 | <p>The run time of <code class="code">FactorsMPQS</code> depends only on the size of the input number, and not on the size of its factors. Rough timings are as follows: 90 s for a 40-digit number, 10 min for a 50-digit number, 2 h for a 60-digit number, 20 h for a 70-digit number and 100 h for a 75-digit number. These timings are much more precise than those given for ECM, but they may also vary by a factor of 2 or 3 depending on whether a good factor base can be found without using a large multiplier or not. A general rule of thumb is the following: 10 digits more cause 10 times as much work. For benchmarking purposes, precise timings for some integers are given: <span class="SimpleMath">\(38!+1\)</span> (45 digits, good factor base with multiplier 1): 2 min 22 s, <span class="SimpleMath">\(40!-1\)</span> (48 digits, not so good factor base even with multiplier 7): 8 min 58 s, cofactor of <span class="SimpleMath">\(1093^{33}+1\)</span> (61 digits, good factor base with multiplier 1): 1 h 12 min.</p> | |
67 | ||
68 | ||
69 | <div class="chlinkprevnextbot"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap3_mj.html">[Previous Chapter]</a> <a href="chapBib_mj.html">[Next Chapter]</a> </div> | |
70 | ||
71 | ||
72 | <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div> | |
73 | ||
74 | <hr /> | |
75 | <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> | |
76 | </body> | |
77 | </html> |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <title>GAP (FactInt) - References</title> | |
8 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
9 | <meta name="generator" content="GAPDoc2HTML" /> | |
10 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
11 | <script src="manual.js" type="text/javascript"></script> | |
12 | <script type="text/javascript">overwriteStyle();</script> | |
13 | </head> | |
14 | <body class="chapBib" onload="jscontent()"> | |
15 | ||
16 | ||
17 | <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> | |
18 | ||
19 | <div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap4.html">[Previous Chapter]</a> <a href="chapInd.html">[Next Chapter]</a> </div> | |
20 | ||
21 | <p id="mathjaxlink" class="pcenter"><a href="chapBib_mj.html">[MathJax on]</a></p> | |
22 | <p><a id="X7A6F98FD85F02BFE" name="X7A6F98FD85F02BFE"></a></p> | |
23 | ||
24 | <h3>References</h3> | |
25 | ||
26 | ||
27 | <p><a id="biBBressoud89" name="biBBressoud89"></a></p> | |
28 | <p class='BibEntry'> | |
29 | [<span class='BibKeyLink'><a href="http://www.ams.org/mathscinet-getitem?mr=1016812">Bre89</a></span>] <b class='BibAuthor'>Bressoud, D. M.</b>, | |
30 | <i class='BibTitle'>Factorization and Primality Testing</i>, | |
31 | <span class='BibPublisher'>Springer-Verlag</span> | |
32 | (<span class='BibYear'>1989</span>). | |
33 | </p> | |
34 | ||
35 | ||
36 | <p><a id="biBBrent96" name="biBBrent96"></a></p> | |
37 | <p class='BibEntry'> | |
38 | [<span class='BibKey'>Bre96</span>] <b class='BibAuthor'>Brent, R. P.</b>, | |
39 | <i class='BibTitle'>Factorization of the Tenth and Eleventh Fermat Numbers</i> | |
40 | (<span class='BibYear'>1996</span>)<br /> | |
41 | (<span class='BibNote'> | |
42 | <a href="ftp://ftp.comlab.ox.ac.uk/pub/Documents/techpapers/Richard.Brent/rpb161tr.dvi.gz">ftp://ftp.comlab.ox.ac.uk/pub/Documents/techpapers/Richard.Brent/rpb161tr.dvi.gz</a> | |
43 | </span>). | |
44 | </p> | |
45 | ||
46 | ||
47 | <p><a id="biBBrent04" name="biBBrent04"></a></p> | |
48 | <p class='BibEntry'> | |
49 | [<span class='BibKey'>Bre04</span>] <b class='BibAuthor'>Brent, R. P.</b>, | |
50 | <i class='BibTitle'>Factor Tables</i> | |
51 | (<span class='BibYear'>2004</span>)<br /> | |
52 | (<span class='BibNote'> | |
53 | <a href="http://web.comlab.ox.ac.uk/oucl/work/richard.brent/factors.html">http://web.comlab.ox.ac.uk/oucl/work/richard.brent/factors.html</a> | |
54 | </span>). | |
55 | </p> | |
56 | ||
57 | ||
58 | <p><a id="biBCohen93" name="biBCohen93"></a></p> | |
59 | <p class='BibEntry'> | |
60 | [<span class='BibKeyLink'><a href="http://www.ams.org/mathscinet-getitem?mr=1228206">Coh93</a></span>] <b class='BibAuthor'>Cohen, H.</b>, | |
61 | <i class='BibTitle'>A Course in Computational Algebraic Number Theory</i>, | |
62 | <span class='BibPublisher'>Springer-Verlag</span> | |
63 | (<span class='BibYear'>1993</span>). | |
64 | </p> | |
65 | ||
66 | ||
67 | <p><a id="biBGAPDoc" name="biBGAPDoc"></a></p> | |
68 | <p class='BibEntry'> | |
69 | [<span class='BibKey'>LN17</span>] <b class='BibAuthor'>Lübeck, F. and Neunhöffer, M.</b>, | |
70 | <i class='BibTitle'>GAPDoc (Version 1.6)</i>, | |
71 | <span class='BibOrganization'>RWTH Aachen</span> | |
72 | (<span class='BibYear'>2017</span>)<br /> | |
73 | (<span class='BibNote'> | |
74 | GAP package, <a href="http://www.gap-system.org/Packages/gapdoc.html">http://www.gap-system.org/Packages/gapdoc.html</a> | |
75 | </span>). | |
76 | </p> | |
77 | ||
78 | <p> </p> | |
79 | ||
80 | ||
81 | <div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap4.html">[Previous Chapter]</a> <a href="chapInd.html">[Next Chapter]</a> </div> | |
82 | ||
83 | ||
84 | <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> | |
85 | ||
86 | <hr /> | |
87 | <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> | |
88 | </body> | |
89 | </html> |
0 | ||
1 | ||
2 | [1XReferences[101X | |
3 | ||
4 | [[20XBre89[120X] [16XBressoud, D. M.[116X, [17XFactorization and Primality Testing[117X, | |
5 | Springer-Verlag (1989). | |
6 | ||
7 | [[20XBre96[120X] [16XBrent, R. P.[116X, [17XFactorization of the Tenth and Eleventh Fermat Numbers[117X | |
8 | (1996), (( | |
9 | ftp://ftp.comlab.ox.ac.uk/pub/Documents/techpapers/Richard.Brent/rpb161tr.dvi.gz | |
10 | )). | |
11 | ||
12 | [[20XBre04[120X] [16XBrent, R. P.[116X, [17XFactor Tables[117X (2004), (( | |
13 | http://web.comlab.ox.ac.uk/oucl/work/richard.brent/factors.html )). | |
14 | ||
15 | [[20XCoh93[120X] [16XCohen, H.[116X, [17XA Course in Computational Algebraic Number Theory[117X, | |
16 | Springer-Verlag (1993). | |
17 | ||
18 | [[20XLN17[120X] [16XLübeck, F. and Neunhöffer, M.[116X, [17XGAPDoc (Version 1.6)[117X, RWTH Aachen | |
19 | (2017), (( GAP package, http://www.gap-system.org/Packages/gapdoc.html )). | |
20 | ||
21 | ||
22 | ||
23 | [32X |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <script type="text/javascript" | |
8 | src="http://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> | |
9 | </script> | |
10 | <title>GAP (FactInt) - References</title> | |
11 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
12 | <meta name="generator" content="GAPDoc2HTML" /> | |
13 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
14 | <script src="manual.js" type="text/javascript"></script> | |
15 | <script type="text/javascript">overwriteStyle();</script> | |
16 | </head> | |
17 | <body class="chapBib" onload="jscontent()"> | |
18 | ||
19 | ||
20 | <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div> | |
21 | ||
22 | <div class="chlinkprevnexttop"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap4_mj.html">[Previous Chapter]</a> <a href="chapInd_mj.html">[Next Chapter]</a> </div> | |
23 | ||
24 | <p id="mathjaxlink" class="pcenter"><a href="chapBib.html">[MathJax off]</a></p> | |
25 | <p><a id="X7A6F98FD85F02BFE" name="X7A6F98FD85F02BFE"></a></p> | |
26 | ||
27 | <h3>References</h3> | |
28 | ||
29 | ||
30 | <p><a id="biBBressoud89" name="biBBressoud89"></a></p> | |
31 | <p class='BibEntry'> | |
32 | [<span class='BibKeyLink'><a href="http://www.ams.org/mathscinet-getitem?mr=1016812">Bre89</a></span>] <b class='BibAuthor'>Bressoud, D. M.</b>, | |
33 | <i class='BibTitle'>Factorization and Primality Testing</i>, | |
34 | <span class='BibPublisher'>Springer-Verlag</span> | |
35 | (<span class='BibYear'>1989</span>). | |
36 | </p> | |
37 | ||
38 | ||
39 | <p><a id="biBBrent96" name="biBBrent96"></a></p> | |
40 | <p class='BibEntry'> | |
41 | [<span class='BibKey'>Bre96</span>] <b class='BibAuthor'>Brent, R. P.</b>, | |
42 | <i class='BibTitle'>Factorization of the Tenth and Eleventh Fermat Numbers</i> | |
43 | (<span class='BibYear'>1996</span>)<br /> | |
44 | (<span class='BibNote'> | |
45 | <a href="ftp://ftp.comlab.ox.ac.uk/pub/Documents/techpapers/Richard.Brent/rpb161tr.dvi.gz">ftp://ftp.comlab.ox.ac.uk/pub/Documents/techpapers/Richard.Brent/rpb161tr.dvi.gz</a> | |
46 | </span>). | |
47 | </p> | |
48 | ||
49 | ||
50 | <p><a id="biBBrent04" name="biBBrent04"></a></p> | |
51 | <p class='BibEntry'> | |
52 | [<span class='BibKey'>Bre04</span>] <b class='BibAuthor'>Brent, R. P.</b>, | |
53 | <i class='BibTitle'>Factor Tables</i> | |
54 | (<span class='BibYear'>2004</span>)<br /> | |
55 | (<span class='BibNote'> | |
56 | <a href="http://web.comlab.ox.ac.uk/oucl/work/richard.brent/factors.html">http://web.comlab.ox.ac.uk/oucl/work/richard.brent/factors.html</a> | |
57 | </span>). | |
58 | </p> | |
59 | ||
60 | ||
61 | <p><a id="biBCohen93" name="biBCohen93"></a></p> | |
62 | <p class='BibEntry'> | |
63 | [<span class='BibKeyLink'><a href="http://www.ams.org/mathscinet-getitem?mr=1228206">Coh93</a></span>] <b class='BibAuthor'>Cohen, H.</b>, | |
64 | <i class='BibTitle'>A Course in Computational Algebraic Number Theory</i>, | |
65 | <span class='BibPublisher'>Springer-Verlag</span> | |
66 | (<span class='BibYear'>1993</span>). | |
67 | </p> | |
68 | ||
69 | ||
70 | <p><a id="biBGAPDoc" name="biBGAPDoc"></a></p> | |
71 | <p class='BibEntry'> | |
72 | [<span class='BibKey'>LN17</span>] <b class='BibAuthor'>Lübeck, F. and Neunhöffer, M.</b>, | |
73 | <i class='BibTitle'>GAPDoc (Version 1.6)</i>, | |
74 | <span class='BibOrganization'>RWTH Aachen</span> | |
75 | (<span class='BibYear'>2017</span>)<br /> | |
76 | (<span class='BibNote'> | |
77 | GAP package, <a href="http://www.gap-system.org/Packages/gapdoc.html">http://www.gap-system.org/Packages/gapdoc.html</a> | |
78 | </span>). | |
79 | </p> | |
80 | ||
81 | <p> </p> | |
82 | ||
83 | ||
84 | <div class="chlinkprevnextbot"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap4_mj.html">[Previous Chapter]</a> <a href="chapInd_mj.html">[Next Chapter]</a> </div> | |
85 | ||
86 | ||
87 | <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div> | |
88 | ||
89 | <hr /> | |
90 | <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> | |
91 | </body> | |
92 | </html> |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <title>GAP (FactInt) - Index</title> | |
8 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
9 | <meta name="generator" content="GAPDoc2HTML" /> | |
10 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
11 | <script src="manual.js" type="text/javascript"></script> | |
12 | <script type="text/javascript">overwriteStyle();</script> | |
13 | </head> | |
14 | <body class="chapInd" onload="jscontent()"> | |
15 | ||
16 | ||
17 | <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> | |
18 | ||
19 | <div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chapBib.html">[Previous Chapter]</a> </div> | |
20 | ||
21 | <p id="mathjaxlink" class="pcenter"><a href="chapInd_mj.html">[MathJax on]</a></p> | |
22 | <p><a id="X83A0356F839C696F" name="X83A0356F839C696F"></a></p> | |
23 | ||
24 | <div class="index"> | |
25 | <h3>Index</h3> | |
26 | ||
27 | <code class="func">CFRAC</code>, shorthand for FactorsCFRAC <a href="chap3.html#X7A5C8BC5861CFC8C">3.5-1</a> <br /> | |
28 | Continued Fraction Algorithm (CFRAC) <a href="chap3.html#X78466BB97BEE5495">3.5</a> <br /> | |
29 | continued fraction approximation <a href="chap3.html#X7A5C8BC5861CFC8C">3.5-1</a> <br /> | |
30 | <code class="func">ECM</code>, shorthand for FactorsECM <a href="chap3.html#X87B162F878AD031C">3.4-1</a> <br /> | |
31 | elliptic curve groups <a href="chap3.html#X87B162F878AD031C">3.4-1</a> <br /> | |
32 | elliptic curve point <a href="chap3.html#X87B162F878AD031C">3.4-1</a> <br /> | |
33 | Elliptic Curves Method (ECM) <a href="chap3.html#X7837106783A5194B">3.4</a> <br /> | |
34 | <code class="func">FactInt</code>, factorization of an integer <a href="chap2.html#X866CD23D78460060">2.1-2</a> <br /> | |
35 | <code class="func">FactIntInfo</code>, setting the InfoLevel of InfoFactInt <a href="chap2.html#X8093BB787C2E764B">2.2-1</a> <br /> | |
36 | factor base <a href="chap3.html#X7A5C8BC5861CFC8C">3.5-1</a> <br /> | |
37 | large factors <a href="chap3.html#X7A5C8BC5861CFC8C">3.5-1</a> <br /> | |
38 | <code class="func">Factors</code>, FactInt's method, for integers <a href="chap2.html#X833B087D7A83BC7A">2.1-1</a> <br /> | |
39 | <code class="func">FactorsCFRAC</code>, Continued Fraction Algorithm, CFRAC <a href="chap3.html#X7A5C8BC5861CFC8C">3.5-1</a> <br /> | |
40 | <code class="func">FactorsECM</code>, Elliptic Curves Method, ECM <a href="chap3.html#X87B162F878AD031C">3.4-1</a> <br /> | |
41 | <code class="func">FactorsMPQS</code>, Multiple Polynomial Quadratic Sieve, MPQS <a href="chap3.html#X86F8DFB681442E05">3.6-1</a> <br /> | |
42 | <code class="func">FactorsPminus1</code>, Pollard's p-1 <a href="chap3.html#X7AF95E2E87F58200">3.2-1</a> <br /> | |
43 | <code class="func">FactorsPplus1</code>, Williams' p+1 <a href="chap3.html#X8079A0367DE4FC35">3.3-1</a> <br /> | |
44 | <code class="func">FactorsTD</code>, trial division <a href="chap3.html#X7C4D255A789F54B4">3.1-1</a> <br /> | |
45 | first stage limit <a href="chap3.html#X87B162F878AD031C">3.4-1</a> <br /> | |
46 | Gaussian Elimination <a href="chap3.html#X7A5C8BC5861CFC8C">3.5-1</a> <br /> | |
47 | Generalized Number Field Sieve <a href="chap1.html#X874E1D45845007FE">1.</a> <br /> | |
48 | <code class="func">InfoFactInt</code>, FactInt's Info class <a href="chap2.html#X8093BB787C2E764B">2.2-1</a> <br /> | |
49 | information about factoring process <a href="chap2.html#X80EB87DD80462F80">2.2</a> <br /> | |
50 | Lagrange's Theorem <a href="chap3.html#X7AF95E2E87F58200">3.2-1</a> <br /> | |
51 | <code class="func">MPQS</code>, shorthand for FactorsMPQS <a href="chap3.html#X86F8DFB681442E05">3.6-1</a> <br /> | |
52 | Multiple Polynomial Quadratic Sieve (MPQS) <a href="chap3.html#X7A5C621C7FCFAA8A">3.6</a> <br /> | |
53 | Pollard's <span class="SimpleMath">p-1</span> <a href="chap3.html#X8081FF657DA9C674">3.2</a> <br /> | |
54 | Pollard's Rho <a href="chap1.html#X874E1D45845007FE">1.</a> <br /> | |
55 | primality of the factors <a href="chap2.html#X833B087D7A83BC7A">2.1-1</a> <br /> | |
56 | prime ideal <a href="chap1.html#X874E1D45845007FE">1.</a> <br /> | |
57 | projective coordinates <a href="chap3.html#X87B162F878AD031C">3.4-1</a> <br /> | |
58 | RSA Factoring Challenge <a href="chap1.html#X874E1D45845007FE">1.</a> <br /> | |
59 | second stage limit <a href="chap3.html#X87B162F878AD031C">3.4-1</a> <br /> | |
60 | sieving interval <a href="chap3.html#X86F8DFB681442E05">3.6-1</a> <br /> | |
61 | trial division <a href="chap3.html#X7A0392177E697956">3.1</a> <br /> | |
62 | Weierstrass model <a href="chap3.html#X87B162F878AD031C">3.4-1</a> <br /> | |
63 | Williams' <span class="SimpleMath">p+1</span> <a href="chap3.html#X860B4BE37DABDE10">3.3</a> <br /> | |
64 | <p> </p> | |
65 | </div> | |
66 | ||
67 | <div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chapBib.html">[Previous Chapter]</a> </div> | |
68 | ||
69 | ||
70 | <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> | |
71 | ||
72 | <hr /> | |
73 | <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> | |
74 | </body> | |
75 | </html> |
0 | ||
1 | ||
2 | [1XIndex[101X | |
3 | ||
4 | [2XCFRAC[102X, shorthand for FactorsCFRAC 3.5-1 | |
5 | Continued Fraction Algorithm (CFRAC) 3.5 | |
6 | continued fraction approximation 3.5-1 | |
7 | [2XECM[102X, shorthand for FactorsECM 3.4-1 | |
8 | elliptic curve groups 3.4-1 | |
9 | elliptic curve point 3.4-1 | |
10 | Elliptic Curves Method (ECM) 3.4 | |
11 | [2XFactInt[102X, factorization of an integer 2.1-2 | |
12 | [2XFactIntInfo[102X, setting the InfoLevel of InfoFactInt 2.2-1 | |
13 | factor base 3.5-1 | |
14 | large factors 3.5-1 | |
15 | [2XFactors[102X, FactInt's method, for integers 2.1-1 | |
16 | [2XFactorsCFRAC[102X, Continued Fraction Algorithm, CFRAC 3.5-1 | |
17 | [2XFactorsECM[102X, Elliptic Curves Method, ECM 3.4-1 | |
18 | [2XFactorsMPQS[102X, Multiple Polynomial Quadratic Sieve, MPQS 3.6-1 | |
19 | [2XFactorsPminus1[102X, Pollard's p-1 3.2-1 | |
20 | [2XFactorsPplus1[102X, Williams' p+1 3.3-1 | |
21 | [2XFactorsTD[102X, trial division 3.1-1 | |
22 | first stage limit 3.4-1 | |
23 | Gaussian Elimination 3.5-1 | |
24 | Generalized Number Field Sieve 1. | |
25 | [2XInfoFactInt[102X, FactInt's Info class 2.2-1 | |
26 | information about factoring process 2.2 | |
27 | Lagrange's Theorem 3.2-1 | |
28 | [2XMPQS[102X, shorthand for FactorsMPQS 3.6-1 | |
29 | Multiple Polynomial Quadratic Sieve (MPQS) 3.6 | |
30 | Pollard's [22Xp-1[122X 3.2 | |
31 | Pollard's Rho 1. | |
32 | primality of the factors 2.1-1 | |
33 | prime ideal 1. | |
34 | projective coordinates 3.4-1 | |
35 | RSA Factoring Challenge 1. | |
36 | second stage limit 3.4-1 | |
37 | sieving interval 3.6-1 | |
38 | trial division 3.1 | |
39 | Weierstrass model 3.4-1 | |
40 | Williams' [22Xp+1[122X 3.3 | |
41 | ||
42 | ||
43 | ------------------------------------------------------- |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <script type="text/javascript" | |
8 | src="http://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> | |
9 | </script> | |
10 | <title>GAP (FactInt) - Index</title> | |
11 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
12 | <meta name="generator" content="GAPDoc2HTML" /> | |
13 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
14 | <script src="manual.js" type="text/javascript"></script> | |
15 | <script type="text/javascript">overwriteStyle();</script> | |
16 | </head> | |
17 | <body class="chapInd" onload="jscontent()"> | |
18 | ||
19 | ||
20 | <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div> | |
21 | ||
22 | <div class="chlinkprevnexttop"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chapBib_mj.html">[Previous Chapter]</a> </div> | |
23 | ||
24 | <p id="mathjaxlink" class="pcenter"><a href="chapInd.html">[MathJax off]</a></p> | |
25 | <p><a id="X83A0356F839C696F" name="X83A0356F839C696F"></a></p> | |
26 | ||
27 | <div class="index"> | |
28 | <h3>Index</h3> | |
29 | ||
30 | <code class="func">CFRAC</code>, shorthand for FactorsCFRAC <a href="chap3_mj.html#X7A5C8BC5861CFC8C">3.5-1</a> <br /> | |
31 | Continued Fraction Algorithm (CFRAC) <a href="chap3_mj.html#X78466BB97BEE5495">3.5</a> <br /> | |
32 | continued fraction approximation <a href="chap3_mj.html#X7A5C8BC5861CFC8C">3.5-1</a> <br /> | |
33 | <code class="func">ECM</code>, shorthand for FactorsECM <a href="chap3_mj.html#X87B162F878AD031C">3.4-1</a> <br /> | |
34 | elliptic curve groups <a href="chap3_mj.html#X87B162F878AD031C">3.4-1</a> <br /> | |
35 | elliptic curve point <a href="chap3_mj.html#X87B162F878AD031C">3.4-1</a> <br /> | |
36 | Elliptic Curves Method (ECM) <a href="chap3_mj.html#X7837106783A5194B">3.4</a> <br /> | |
37 | <code class="func">FactInt</code>, factorization of an integer <a href="chap2_mj.html#X866CD23D78460060">2.1-2</a> <br /> | |
38 | <code class="func">FactIntInfo</code>, setting the InfoLevel of InfoFactInt <a href="chap2_mj.html#X8093BB787C2E764B">2.2-1</a> <br /> | |
39 | factor base <a href="chap3_mj.html#X7A5C8BC5861CFC8C">3.5-1</a> <br /> | |
40 | large factors <a href="chap3_mj.html#X7A5C8BC5861CFC8C">3.5-1</a> <br /> | |
41 | <code class="func">Factors</code>, FactInt's method, for integers <a href="chap2_mj.html#X833B087D7A83BC7A">2.1-1</a> <br /> | |
42 | <code class="func">FactorsCFRAC</code>, Continued Fraction Algorithm, CFRAC <a href="chap3_mj.html#X7A5C8BC5861CFC8C">3.5-1</a> <br /> | |
43 | <code class="func">FactorsECM</code>, Elliptic Curves Method, ECM <a href="chap3_mj.html#X87B162F878AD031C">3.4-1</a> <br /> | |
44 | <code class="func">FactorsMPQS</code>, Multiple Polynomial Quadratic Sieve, MPQS <a href="chap3_mj.html#X86F8DFB681442E05">3.6-1</a> <br /> | |
45 | <code class="func">FactorsPminus1</code>, Pollard's p-1 <a href="chap3_mj.html#X7AF95E2E87F58200">3.2-1</a> <br /> | |
46 | <code class="func">FactorsPplus1</code>, Williams' p+1 <a href="chap3_mj.html#X8079A0367DE4FC35">3.3-1</a> <br /> | |
47 | <code class="func">FactorsTD</code>, trial division <a href="chap3_mj.html#X7C4D255A789F54B4">3.1-1</a> <br /> | |
48 | first stage limit <a href="chap3_mj.html#X87B162F878AD031C">3.4-1</a> <br /> | |
49 | Gaussian Elimination <a href="chap3_mj.html#X7A5C8BC5861CFC8C">3.5-1</a> <br /> | |
50 | Generalized Number Field Sieve <a href="chap1_mj.html#X874E1D45845007FE">1.</a> <br /> | |
51 | <code class="func">InfoFactInt</code>, FactInt's Info class <a href="chap2_mj.html#X8093BB787C2E764B">2.2-1</a> <br /> | |
52 | information about factoring process <a href="chap2_mj.html#X80EB87DD80462F80">2.2</a> <br /> | |
53 | Lagrange's Theorem <a href="chap3_mj.html#X7AF95E2E87F58200">3.2-1</a> <br /> | |
54 | <code class="func">MPQS</code>, shorthand for FactorsMPQS <a href="chap3_mj.html#X86F8DFB681442E05">3.6-1</a> <br /> | |
55 | Multiple Polynomial Quadratic Sieve (MPQS) <a href="chap3_mj.html#X7A5C621C7FCFAA8A">3.6</a> <br /> | |
56 | Pollard's <span class="SimpleMath">\(p-1\)</span> <a href="chap3_mj.html#X8081FF657DA9C674">3.2</a> <br /> | |
57 | Pollard's Rho <a href="chap1_mj.html#X874E1D45845007FE">1.</a> <br /> | |
58 | primality of the factors <a href="chap2_mj.html#X833B087D7A83BC7A">2.1-1</a> <br /> | |
59 | prime ideal <a href="chap1_mj.html#X874E1D45845007FE">1.</a> <br /> | |
60 | projective coordinates <a href="chap3_mj.html#X87B162F878AD031C">3.4-1</a> <br /> | |
61 | RSA Factoring Challenge <a href="chap1_mj.html#X874E1D45845007FE">1.</a> <br /> | |
62 | second stage limit <a href="chap3_mj.html#X87B162F878AD031C">3.4-1</a> <br /> | |
63 | sieving interval <a href="chap3_mj.html#X86F8DFB681442E05">3.6-1</a> <br /> | |
64 | trial division <a href="chap3_mj.html#X7A0392177E697956">3.1</a> <br /> | |
65 | Weierstrass model <a href="chap3_mj.html#X87B162F878AD031C">3.4-1</a> <br /> | |
66 | Williams' <span class="SimpleMath">\(p+1\)</span> <a href="chap3_mj.html#X860B4BE37DABDE10">3.3</a> <br /> | |
67 | <p> </p> | |
68 | </div> | |
69 | ||
70 | <div class="chlinkprevnextbot"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chapBib_mj.html">[Previous Chapter]</a> </div> | |
71 | ||
72 | ||
73 | <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div> | |
74 | ||
75 | <hr /> | |
76 | <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> | |
77 | </body> | |
78 | </html> |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 | ||
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
6 | <head> | |
7 | <title>GAPDoc Style Chooser</title> | |
8 | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
9 | <meta name="generator" content="GAPDoc2HTML" /> | |
10 | <link rel="stylesheet" type="text/css" href="manual.css" /> | |
11 | <script src="manual.js" type="text/javascript"></script> | |
12 | <script type="text/javascript"> | |
13 | ||
14 | <!-- find current value of name nam in form --> | |
15 | function currval(nam) { | |
16 | var chform = document.forms[0].elements; | |
17 | for (var i=0; chform.length > i; i++) { | |
18 | if (chform[i].name == nam && chform[i].type == "radio" && | |
19 | chform[i].checked == true) | |
20 | return chform[i].value; | |
21 | } | |
22 | return ""; | |
23 | } | |
24 | ||
25 | <!-- find style from current values in form --> | |
26 | function getstyle() { | |
27 | var choices = ["toggle","colorprompt","tocside","font","justify"]; | |
28 | var style = ""; | |
29 | for (var i=0; choices.length > i; i++) { | |
30 | var a = currval(choices[i]); | |
31 | if (a.length > 0) { | |
32 | if (style.length > 0) | |
33 | style = style + ","; | |
34 | style = style + a; | |
35 | } | |
36 | } | |
37 | if (style.length == 0) | |
38 | style = "default"; | |
39 | return style; | |
40 | } | |
41 | ||
42 | <!-- adjust the back link --> | |
43 | function f() { | |
44 | addr = window.location.search.split("=")[1]; | |
45 | addr = addr + "?GAPDocStyle=" + getstyle(); | |
46 | document.getElementsByName("backLINK")[0].href = addr; | |
47 | } | |
48 | function resetf() { | |
49 | addr = window.location.search.split("=")[1]; | |
50 | addr = addr + "?GAPDocStyle=default"; | |
51 | document.getElementsByName("backLINK")[0].href = addr; | |
52 | } | |
53 | ||
54 | <!-- initialize form from GAPDocStyle cookie --> | |
55 | function initform() { | |
56 | var style = valueString(document.cookie, "GAPDocStyle"); | |
57 | if (style != 0 && style.length > 0 && style.length != "default") { | |
58 | stlist = style.split(","); | |
59 | var chform = document.forms[0].elements; | |
60 | for (var i=0; chform.length > i; i++) { | |
61 | if (chform[i].type == "radio") { | |
62 | for (var j=0; stlist.length > j; j++) { | |
63 | if (chform[i].value == stlist[j]) | |
64 | chform[i].checked = true; | |
65 | } | |
66 | } | |
67 | } | |
68 | } | |
69 | } | |
70 | ||
71 | </script> | |
72 | </head> | |
73 | <body class="chooser"> | |
74 | ||
75 | <h2>Setting preferences for GAPDoc manuals</h2> | |
76 | ||
77 | <form name="SetGAPDocHTMLStyle" action=""> | |
78 | <p> | |
79 | <input name="reset" type="reset" value="Reset to defaults" | |
80 | onclick="javascript:resetf()"/> | |
81 | </p> | |
82 | <p> | |
83 | Unfold subsections in menus only by mouse clicks: | |
84 | <input type="radio" name="toggle" value="" checked="checked" | |
85 | onclick="javascript:f()"/> no (default) | |
86 | | |
87 | <input type="radio" name="toggle" value="toggless" | |
88 | onclick="javascript:f()"/> yes | |
89 | </p> | |
90 | <p> | |
91 | Show GAP examples as in sessions with <code>ColorPrompt(true)</code>: | |
92 | <input type="radio" name="colorprompt" value="" checked="checked" | |
93 | onclick="javascript:f()"/> yes | |
94 | (default) | |
95 | <input type="radio" name="colorprompt" value="nocolorprompt" | |
96 | onclick="javascript:f()"/> no | |
97 | </p> | |
98 | <p> | |
99 | Display side of table of contents within chapters: | |
100 | <input type="radio" name="tocside" value="" checked="checked" | |
101 | onclick="javascript:f()"/> right (default) | |
102 | <input type="radio" name="tocside" value="lefttoc" | |
103 | onclick="javascript:f()"/> left | |
104 | </p> | |
105 | <p> | |
106 | Main document font: | |
107 | <input type="radio" name="font" value="" checked="checked" | |
108 | onclick="javascript:f()"/> Helvetica/sans | |
109 | serif (default) | |
110 | <input type="radio" name="font" value="times" | |
111 | onclick="javascript:f()"/> Times/serif | |
112 | </p> | |
113 | <p> | |
114 | Paragraph formatting: | |
115 | <input type="radio" name="justify" value="" checked="checked" | |
116 | onclick="javascript:f()"/> left-right | |
117 | justified (default) | |
118 | <input type="radio" name="justify" value="ragged" | |
119 | onclick="javascript:f()"/> ragged right | |
120 | </p> | |
121 | </form> | |
122 | <p> | |
123 | <a name="backLINK" href=""><strong>Apply settings to last page.</strong></a> | |
124 | </p> | |
125 | <script type="text/javascript"> | |
126 | initform(); | |
127 | f(); | |
128 | </script> | |
129 | ||
130 | </body> | |
131 | </html> |
0 | ||
1 | ||
2 | ||
3 | ||
4 | @misc{ Brent96, | |
5 | author = {Brent, R. P.}, | |
6 | title = {Factorization of the Tenth and Eleventh {F}ermat | |
7 | Numbers}, | |
8 | year = {1996}, | |
9 | note = {\href | |
10 | {ftp://ftp.comlab.ox.ac.uk/pub/Documents/techpapers/Richard.Brent/rpb161tr.dvi.gz} | |
11 | {\texttt{ftp://ftp.comlab.ox.ac.uk/}\discretionary | |
12 | {}{}{}\texttt{pub/}\discretionary | |
13 | {}{}{}\texttt{Documents/}\discretionary | |
14 | {}{}{}\texttt{techpapers/}\discretionary | |
15 | {}{}{}\texttt{Richard.Brent/}\discretionary | |
16 | {}{}{}\texttt{rpb161tr.dvi.gz}}}, | |
17 | printedkey = {Bre96} | |
18 | } | |
19 | @misc{ Brent04, | |
20 | author = {Brent, R. P.}, | |
21 | title = {Factor Tables}, | |
22 | year = {2004}, | |
23 | note = {\href | |
24 | {http://web.comlab.ox.ac.uk/oucl/work/richard.brent/factors.html} | |
25 | {\texttt{http://web.comlab.ox.ac.uk/}\discretionary | |
26 | {}{}{}\texttt{oucl/}\discretionary | |
27 | {}{}{}\texttt{work/}\discretionary | |
28 | {}{}{}\texttt{richard.brent/}\discretionary | |
29 | {}{}{}\texttt{factors.html}}}, | |
30 | printedkey = {Bre04} | |
31 | } | |
32 | @book{ Bressoud89, | |
33 | author = {Bressoud, D. M.}, | |
34 | title = {Factorization and Primality Testing}, | |
35 | publisher = {Springer-Verlag}, | |
36 | year = {1989}, | |
37 | isbn = {0-387-97040-1}, | |
38 | mrnumber = {1016812 (91e:11150)}, | |
39 | printedkey = {Bre89} | |
40 | } | |
41 | @book{ Cohen93, | |
42 | author = {Cohen, H.}, | |
43 | title = {A Course in Computational Algebraic Number Theory}, | |
44 | publisher = {Springer-Verlag}, | |
45 | year = {1993}, | |
46 | isbn = {0-387-55640-0}, | |
47 | mrnumber = {1228206 (94i:11105)}, | |
48 | printedkey = {Coh93} | |
49 | } | |
50 | @manual{ GAPDoc, | |
51 | author = {L{\"u}beck, F. and Neunh{\"o}ffer, M.}, | |
52 | title = {{GAPDoc (Version 1.6)}}, | |
53 | organization = {RWTH Aachen}, | |
54 | year = {2017}, | |
55 | note = {GAP package, \href | |
56 | {http://www.gap-system.org/Packages/gapdoc.html} | |
57 | {\texttt{http://www.gap-system.org/}\discretionary | |
58 | {}{}{}\texttt{Packages/}\discretionary | |
59 | {}{}{}\texttt{gapdoc.html}}}, | |
60 | printedkey = {LN17} | |
61 | } |
0 | /* leftmenu.css Frank Lübeck */ | |
1 | /* Change default CSS to show section menu on left side */ | |
2 | ||
3 | body { | |
4 | padding-left: 28%; | |
5 | } | |
6 | body.chap0 { | |
7 | padding-left: 2%; | |
8 | } | |
9 | div.ChapSects div.ContSect:hover div.ContSSBlock { | |
10 | left: 15%; | |
11 | } | |
12 | div.ChapSects { | |
13 | left: 1%; | |
14 | width: 25%; | |
15 | } | |
16 |
0 | /* manual.css Frank Lübeck */ | |
1 | /* This is the default CSS style sheet for GAPDoc HTML manuals. */ | |
2 | ||
3 | /* basic settings, fonts, sizes, colors, ... */ | |
4 | body { | |
5 | position: relative; | |
6 | background: #ffffff; | |
7 | color: #000000; | |
8 | width: 70%; | |
9 | margin: 0pt; | |
10 | padding: 15pt; | |
11 | font-family: Helvetica,Verdana,Arial,sans-serif; | |
12 | text-align: justify; | |
13 | } | |
14 | ||
15 | /* no side toc on title page, bib and index */ | |
16 | body.chap0 { | |
17 | width: 95%; | |
18 | } | |
19 | body.chapBib { | |
20 | width: 95%; | |
21 | } | |
22 | body.chapInd { | |
23 | width: 95%; | |
24 | } | |
25 | ||
26 | ||
27 | h1 { font-size: 200%; } | |
28 | h2 { font-size: 160%; } | |
29 | h3 { font-size: 160%; } | |
30 | h4 { font-size: 130%; } | |
31 | h5 { font-size: 100%; } | |
32 | ||
33 | p.foot { | |
34 | font-size: 60%; | |
35 | font-style: normal; | |
36 | } | |
37 | ||
38 | a:link { | |
39 | color: #00008e; | |
40 | text-decoration: none; | |
41 | } | |
42 | a:visited { | |
43 | color: #00008e; | |
44 | text-decoration: none; | |
45 | } | |
46 | a:active { | |
47 | color: #000000; | |
48 | text-decoration: none; | |
49 | } | |
50 | a:hover { | |
51 | background: #eeeeee; | |
52 | } | |
53 | ||
54 | pre { | |
55 | font-family: "Courier New",Courier,monospace; | |
56 | font-size: 100%; | |
57 | color:#111111; | |
58 | } | |
59 | ||
60 | tt,code { | |
61 | font-family: "Courier New",Courier,monospace; | |
62 | font-size: 110%; | |
63 | color: #000000; } | |
64 | ||
65 | var { | |
66 | } | |
67 | ||
68 | /* general alignment classes */ | |
69 | .pcenter { | |
70 | text-align: center; | |
71 | } | |
72 | ||
73 | .pleft { | |
74 | text-align: left; | |
75 | } | |
76 | ||
77 | .pright { | |
78 | text-align: right; | |
79 | } | |
80 | ||
81 | /* layout for the definitions of functions, variables, ... */ | |
82 | div.func { | |
83 | background: #e0e0e0; | |
84 | margin: 0pt 0pt; | |
85 | } | |
86 | ||
87 | ||
88 | /* general and special table settings */ | |
89 | table { | |
90 | border-collapse: collapse; | |
91 | margin-left: auto; | |
92 | margin-right: auto; | |
93 | } | |
94 | ||
95 | td, th { | |
96 | border-style: none; | |
97 | } | |
98 | ||
99 | table.func { | |
100 | padding: 0pt 1ex; | |
101 | margin-left: 1ex; | |
102 | margin-right: 1ex; | |
103 | background: transparent; | |
104 | /* line-height: 1.1; */ | |
105 | width: 100%; | |
106 | } | |
107 | ||
108 | table.func td.tdright { | |
109 | padding-right: 2ex; | |
110 | } | |
111 | ||
112 | /* Example elements (for old converted manuals, now in div+pre */ | |
113 | table.example { | |
114 | background: #efefef; | |
115 | border-style: none; | |
116 | border-width: 0pt; | |
117 | padding: 0px; | |
118 | width: 100% | |
119 | } | |
120 | table.example td { | |
121 | border-style: none; | |
122 | border-width: 0pt; | |
123 | padding: 0ex 1ex; | |
124 | } | |
125 | /* becomes ... */ | |
126 | div.example { | |
127 | background: #efefef; | |
128 | padding: 0ex 1ex; | |
129 | /* overflow-x: auto; */ | |
130 | overflow: auto; | |
131 | } | |
132 | ||
133 | /* Links to chapters in all files at top and bottom. */ | |
134 | /* If there are too many chapters then use 'display: none' here. */ | |
135 | div.chlinktop { | |
136 | background: #dddddd; | |
137 | border-style: solid; | |
138 | border-width: thin; | |
139 | margin: 2px; | |
140 | text-align: center; | |
141 | } | |
142 | ||
143 | div.chlinktop a { | |
144 | margin: 3px; | |
145 | } | |
146 | div.chlinktop a:hover { | |
147 | background: #ffffff; | |
148 | } | |
149 | ||
150 | div.chlinkbot { | |
151 | background: #dddddd; | |
152 | border-style: solid; | |
153 | border-width: thin; | |
154 | margin: 2px; | |
155 | text-align: center; | |
156 | /* width: 100%; */ | |
157 | } | |
158 | ||
159 | div.chlinkbot a { | |
160 | margin: 3px; | |
161 | } | |
162 | ||
163 | span.chlink1 { | |
164 | } | |
165 | ||
166 | /* and this is for the "Top", "Prev", "Next" links */ | |
167 | div.chlinkprevnexttop { | |
168 | background: #dddddd; | |
169 | border-style: solid; | |
170 | border-width: thin; | |
171 | text-align: center; | |
172 | margin: 2px; | |
173 | } | |
174 | ||
175 | div.chlinkprevnexttop a:hover { | |
176 | background: #ffffff; | |
177 | } | |
178 | ||
179 | div.chlinkprevnextbot { | |
180 | background: #dddddd; | |
181 | border-style: solid; | |
182 | border-width: thin; | |
183 | text-align: center; | |
184 | margin: 2px; | |
185 | } | |
186 | ||
187 | div.chlinkprevnextbot a:hover { | |
188 | background: #ffffff; | |
189 | } | |
190 | ||
191 | ||
192 | /* table of contents, initially don't display subsections */ | |
193 | div.ContSSBlock { | |
194 | display: none; | |
195 | } | |
196 | div.ContSSBlock br { | |
197 | display: none; | |
198 | } | |
199 | /* format in separate lines */ | |
200 | span.tocline { | |
201 | display: block; | |
202 | width: 100%; | |
203 | } | |
204 | div.ContSSBlock a { | |
205 | display: block; | |
206 | } | |
207 | ||
208 | /* this is for the main table of contents */ | |
209 | div.ContChap { | |
210 | } | |
211 | ||
212 | div.ContChap div.ContSect:hover div.ContSSBlock { | |
213 | display: block; | |
214 | position: absolute; | |
215 | background: #eeeeee; | |
216 | border-style: solid; | |
217 | border-width: 1px 4px 4px 1px; | |
218 | border-color: #666666; | |
219 | padding-left: 0.5ex; | |
220 | color: #000000; | |
221 | left: 20%; | |
222 | width: 40%; | |
223 | z-index: 10000; | |
224 | } | |
225 | ||
226 | div.ContSSBlock a:hover { | |
227 | background: #ffffff; | |
228 | } | |
229 | ||
230 | /* and here for the side menu of contents in the chapter files */ | |
231 | div.ChapSects { | |
232 | } | |
233 | ||
234 | div.ChapSects a:hover { | |
235 | background: #eeeeee; | |
236 | } | |
237 | ||
238 | div.ChapSects a:hover { | |
239 | display: block; | |
240 | width: 100%; | |
241 | background: #eeeeee; | |
242 | color: #000000; | |
243 | } | |
244 | ||
245 | div.ChapSects div.ContSect:hover div.ContSSBlock { | |
246 | display: block; | |
247 | position: fixed; | |
248 | background: #eeeeee; | |
249 | border-style: solid; | |
250 | border-width: 1px 2px 2px 1px; | |
251 | border-color: #666666; | |
252 | padding-left: 0ex; | |
253 | padding-right: 0.5ex; | |
254 | color: #000000; | |
255 | left: 54%; | |
256 | width: 25%; | |
257 | z-index: 10000; | |
258 | } | |
259 | ||
260 | div.ChapSects div.ContSect:hover div.ContSSBlock a { | |
261 | display: block; | |
262 | margin-left: 3px; | |
263 | } | |
264 | ||
265 | div.ChapSects div.ContSect:hover div.ContSSBlock a:hover { | |
266 | display: block; | |
267 | background: #ffffff; | |
268 | } | |
269 | ||
270 | div.ContSect { | |
271 | text-align: left; | |
272 | margin-left: 1em; | |
273 | } | |
274 | div.ChapSects { | |
275 | position: fixed; | |
276 | left: 75%; | |
277 | font-size: 90%; | |
278 | overflow: auto; | |
279 | top: 10px; | |
280 | bottom: 0px; | |
281 | } | |
282 | ||
283 | /* Table elements */ | |
284 | table.GAPDocTable { | |
285 | border-collapse: collapse; | |
286 | border-style: none; | |
287 | border-color: black; | |
288 | } | |
289 | ||
290 | table.GAPDocTable td, table.GAPDocTable th { | |
291 | padding: 3pt; | |
292 | border-width: thin; | |
293 | border-style: solid; | |
294 | border-color: #555555; | |
295 | } | |
296 | ||
297 | caption.GAPDocTable { | |
298 | caption-side: bottom; | |
299 | width: 70%; | |
300 | margin-top: 1em; | |
301 | margin-left: auto; | |
302 | margin-right: auto; | |
303 | } | |
304 | ||
305 | td.tdleft { | |
306 | text-align: left; | |
307 | } | |
308 | ||
309 | table.GAPDocTablenoborder { | |
310 | border-collapse: collapse; | |
311 | border-style: none; | |
312 | border-color: black; | |
313 | } | |
314 | ||
315 | table.GAPDocTablenoborder td, table.GAPDocTable th { | |
316 | padding: 3pt; | |
317 | border-width: 0pt; | |
318 | border-style: solid; | |
319 | border-color: #555555; | |
320 | } | |
321 | ||
322 | caption.GAPDocTablenoborder { | |
323 | caption-side: bottom; | |
324 | width: 70%; | |
325 | margin-top: 1em; | |
326 | margin-left: auto; | |
327 | margin-right: auto; | |
328 | } | |
329 | ||
330 | td.tdleft { | |
331 | text-align: left; | |
332 | } | |
333 | ||
334 | td.tdright { | |
335 | text-align: right; | |
336 | } | |
337 | ||
338 | td.tdcenter { | |
339 | text-align: center; | |
340 | } | |
341 | ||
342 | /* Colors and fonts can be overwritten for some types of elements. */ | |
343 | /* Verb elements */ | |
344 | pre.normal { | |
345 | color: #000000; | |
346 | } | |
347 | ||
348 | /* Func-like elements and Ref to Func-like */ | |
349 | code.func { | |
350 | color: #000000; | |
351 | } | |
352 | ||
353 | /* K elements */ | |
354 | code.keyw { | |
355 | color: #770000; | |
356 | } | |
357 | ||
358 | /* F elements */ | |
359 | code.file { | |
360 | color: #8e4510; | |
361 | } | |
362 | ||
363 | /* C elements */ | |
364 | code.code { | |
365 | } | |
366 | ||
367 | /* Item elements */ | |
368 | code.i { | |
369 | } | |
370 | ||
371 | /* Button elements */ | |
372 | strong.button { | |
373 | } | |
374 | ||
375 | /* Headings */ | |
376 | span.Heading { | |
377 | } | |
378 | ||
379 | /* Arg elements */ | |
380 | var.Arg { | |
381 | color: #006600; | |
382 | } | |
383 | ||
384 | /* Example elements, is in tables, see above */ | |
385 | div.Example { | |
386 | } | |
387 | ||
388 | /* Package elements */ | |
389 | strong.pkg { | |
390 | } | |
391 | ||
392 | /* URL-like elements */ | |
393 | span.URL { | |
394 | } | |
395 | ||
396 | /* Mark elements */ | |
397 | strong.Mark { | |
398 | } | |
399 | ||
400 | /* Ref elements */ | |
401 | b.Ref { | |
402 | } | |
403 | span.Ref { | |
404 | } | |
405 | ||
406 | /* this contains the contents page */ | |
407 | div.contents { | |
408 | } | |
409 | ||
410 | /* this contains the index page */ | |
411 | div.index { | |
412 | } | |
413 | ||
414 | /* ignore some text for non-css layout */ | |
415 | span.nocss { | |
416 | display: none; | |
417 | } | |
418 | ||
419 | /* colors for ColorPrompt like examples */ | |
420 | span.GAPprompt { | |
421 | color: #000097; | |
422 | font-weight: normal; | |
423 | } | |
424 | span.GAPbrkprompt { | |
425 | color: #970000; | |
426 | font-weight: normal; | |
427 | } | |
428 | span.GAPinput { | |
429 | color: #970000; | |
430 | } | |
431 | ||
432 | /* Bib entries */ | |
433 | p.BibEntry { | |
434 | } | |
435 | span.BibKey { | |
436 | color: #005522; | |
437 | } | |
438 | span.BibKeyLink { | |
439 | } | |
440 | b.BibAuthor { | |
441 | } | |
442 | i.BibTitle { | |
443 | } | |
444 | i.BibBookTitle { | |
445 | } | |
446 | span.BibEditor { | |
447 | } | |
448 | span.BibJournal { | |
449 | } | |
450 | span.BibType { | |
451 | } | |
452 | span.BibPublisher { | |
453 | } | |
454 | span.BibSchool { | |
455 | } | |
456 | span.BibEdition { | |
457 | } | |
458 | span.BibVolume { | |
459 | } | |
460 | span.BibSeries { | |
461 | } | |
462 | span.BibNumber { | |
463 | } | |
464 | span.BibPages { | |
465 | } | |
466 | span.BibOrganization { | |
467 | } | |
468 | span.BibAddress { | |
469 | } | |
470 | span.BibYear { | |
471 | } | |
472 | span.BibPublisher { | |
473 | } | |
474 | span.BibNote { | |
475 | } | |
476 | span.BibHowpublished { | |
477 | } | |
478 | ||
479 | ||
480 | ||
481 |
0 | /* manual.js Frank Lübeck */ | |
1 | ||
2 | /* This file contains a few javascript functions which allow to switch | |
3 | between display styles for GAPDoc HTML manuals. | |
4 | If javascript is switched off in a browser or this file in not available | |
5 | in a manual directory, this is no problem. Users just cannot switch | |
6 | between several styles and don't see the corresponding button. | |
7 | ||
8 | A style with name mystyle can be added by providing two files (or only | |
9 | one of them). | |
10 | mystyle.js: Additional javascript code for the style, it is | |
11 | read in the HTML pages after this current file. | |
12 | The additional code may adjust the preprocessing function | |
13 | jscontent() with is called onload of a file. This | |
14 | is done by appending functions to jscontentfuncs | |
15 | (jscontentfuncs.push(newfunc);). | |
16 | Make sure, that your style is still usable without | |
17 | javascript. | |
18 | mystyle.css: CSS configuration, read after manual.css (so it can | |
19 | just reconfigure a few details, or overwrite everything). | |
20 | ||
21 | Then adjust chooser.html such that users can switch on and off mystyle. | |
22 | ||
23 | A user can change the preferred style permanently by using the [Style] | |
24 | link and choosing one. Or one can append '?GAPDocStyle=mystyle' to the URL | |
25 | when loading any file of the manual (so the style can be configured in | |
26 | the GAP user preferences). | |
27 | ||
28 | */ | |
29 | ||
30 | /* generic helper function */ | |
31 | function deleteCookie(nam) { | |
32 | document.cookie = nam+"=;Path=/;expires=Thu, 01 Jan 1970 00:00:00 GMT"; | |
33 | } | |
34 | ||
35 | /* read a value from a "nam1=val1;nam2=val2;..." string (e.g., the search | |
36 | part of an URL or a cookie */ | |
37 | function valueString(str,nam) { | |
38 | var cs = str.split(";"); | |
39 | for (var i=0; i < cs.length; i++) { | |
40 | var pos = cs[i].search(nam+"="); | |
41 | if (pos > -1) { | |
42 | pos = cs[i].indexOf("="); | |
43 | return cs[i].slice(pos+1); | |
44 | } | |
45 | } | |
46 | return 0; | |
47 | } | |
48 | ||
49 | /* when a non-default style is chosen via URL or a cookie, then | |
50 | the cookie is reset and the styles .js and .css files are read */ | |
51 | function overwriteStyle() { | |
52 | /* style in URL? */ | |
53 | var style = valueString(window.location.search, "GAPDocStyle"); | |
54 | /* otherwise check cookie */ | |
55 | if (style == 0) | |
56 | style = valueString(document.cookie, "GAPDocStyle"); | |
57 | if (style == 0) | |
58 | return; | |
59 | if (style == "default") | |
60 | deleteCookie("GAPDocStyle"); | |
61 | else { | |
62 | /* ok, we set the cookie for path "/" */ | |
63 | var path = "/"; | |
64 | /* or better like this ??? | |
65 | var here = window.location.pathname.split("/"); | |
66 | for (var i=0; i+3 < here.length; i++) | |
67 | path = path+"/"+here[i]; | |
68 | */ | |
69 | document.cookie = "GAPDocStyle="+style+";Path="+path; | |
70 | /* split into names of style files */ | |
71 | var stlist = style.split(","); | |
72 | /* read style's css and js files */ | |
73 | for (var i=0; i < stlist.length; i++) { | |
74 | document.writeln('<link rel="stylesheet" type="text/css" href="'+ | |
75 | stlist[i]+'.css" />'); | |
76 | document.writeln('<script src="'+stlist[i]+ | |
77 | '.js" type="text/javascript"></script>'); | |
78 | } | |
79 | } | |
80 | } | |
81 | ||
82 | /* this adds a "[Style]" link next to the MathJax switcher */ | |
83 | function addStyleLink() { | |
84 | var line = document.getElementById("mathjaxlink"); | |
85 | var el = document.createElement("a"); | |
86 | var oncl = document.createAttribute("href"); | |
87 | var back = window.location.protocol+"//" | |
88 | if (window.location.protocol == "http:") { | |
89 | back = back+window.location.host; | |
90 | if (window.location.port != "") { | |
91 | back = back+":"+window.location.port; | |
92 | } | |
93 | } | |
94 | back = back+window.location.pathname; | |
95 | oncl.nodeValue = "chooser.html?BACK="+back; | |
96 | el.setAttributeNode(oncl); | |
97 | var cont = document.createTextNode(" [Style]"); | |
98 | el.appendChild(cont); | |
99 | line.appendChild(el); | |
100 | } | |
101 | ||
102 | var jscontentfuncs = new Array(); | |
103 | ||
104 | jscontentfuncs.push(addStyleLink); | |
105 | ||
106 | /* the default jscontent() only adds the [Style] link to the page */ | |
107 | function jscontent () { | |
108 | for (var i=0; i < jscontentfuncs.length; i++) | |
109 | jscontentfuncs[i](); | |
110 | } | |
111 |
0 | #SIXFORMAT GapDocGAP | |
1 | HELPBOOKINFOSIXTMP := rec( | |
2 | encoding := "UTF-8", | |
3 | bookname := "FactInt", | |
4 | entries := | |
5 | [ [ "Title page", ".", [ 0, 0, 0 ], 1, 1, "title page", "X7D2C85EC87DD46E5" ], | |
6 | [ "Abstract", ".-1", [ 0, 0, 1 ], 35, 2, "abstract", "X7AA6C5737B711C89" ], | |
7 | [ "Copyright", ".-2", [ 0, 0, 2 ], 58, 2, "copyright", "X81488B807F2A1CF1" ] | |
8 | , [ "Acknowledgements", ".-3", [ 0, 0, 3 ], 77, 2, "acknowledgements", | |
9 | "X82A988D47DFAFCFA" ], | |
10 | [ "Table of Contents", ".-4", [ 0, 0, 4 ], 83, 3, "table of contents", | |
11 | "X8537FEB07AF2BEC8" ], | |
12 | [ "\033[1X\033[33X\033[0;-2YPreface\033[133X\033[101X", "1", [ 1, 0, 0 ], | |
13 | 1, 4, "preface", "X874E1D45845007FE" ], | |
14 | [ | |
15 | "\033[1X\033[33X\033[0;-2YThe General Factorization Routine\033[133X\033[10\ | |
16 | 1X", "2", [ 2, 0, 0 ], 1, 5, "the general factorization routine", | |
17 | "X7B1A84BB788FC526" ], | |
18 | [ | |
19 | "\033[1X\033[33X\033[0;-2YThe method for \033[10XFactors\033[110X\033[101X\\ | |
20 | 027\033[1X\027\033[133X\033[101X", "2.1", [ 2, 1, 0 ], 4, 5, | |
21 | "the method for factors", "X83BF2CD28017ABC5" ], | |
22 | [ | |
23 | "\033[1X\033[33X\033[0;-2YGetting information about the factoring process\\ | |
24 | 033[133X\033[101X", "2.2", [ 2, 2, 0 ], 147, 7, | |
25 | "getting information about the factoring process", "X80EB87DD80462F80" ] | |
26 | , | |
27 | [ | |
28 | "\033[1X\033[33X\033[0;-2YThe Routines for Specific Factorization Methods\\ | |
29 | 033[133X\033[101X", "3", [ 3, 0, 0 ], 1, 8, | |
30 | "the routines for specific factorization methods", "X7E7EE1A1785A8009" ] | |
31 | , [ "\033[1X\033[33X\033[0;-2YTrial division\033[133X\033[101X", "3.1", | |
32 | [ 3, 1, 0 ], 8, 8, "trial division", "X7A0392177E697956" ], | |
33 | [ | |
34 | "\033[1X\033[33X\033[0;-2YPollard's \033[22Xp-1\033[122X\033[101X\027\033[1\ | |
35 | X\027\033[133X\033[101X", "3.2", [ 3, 2, 0 ], 29, 8, "pollards p-1", | |
36 | "X8081FF657DA9C674" ], | |
37 | [ | |
38 | "\033[1X\033[33X\033[0;-2YWilliams' \033[22Xp+1\033[122X\033[101X\027\033[1\ | |
39 | X\027\033[133X\033[101X", "3.3", [ 3, 3, 0 ], 70, 9, "williams p+1", | |
40 | "X860B4BE37DABDE10" ], | |
41 | [ | |
42 | "\033[1X\033[33X\033[0;-2YThe Elliptic Curves Method (ECM)\033[133X\033[101\ | |
43 | X", "3.4", [ 3, 4, 0 ], 106, 10, "the elliptic curves method ecm", | |
44 | "X7837106783A5194B" ], | |
45 | [ | |
46 | "\033[1X\033[33X\033[0;-2YThe Continued Fraction Algorithm (CFRAC)\033[133X\ | |
47 | \033[101X", "3.5", [ 3, 5, 0 ], 194, 11, | |
48 | "the continued fraction algorithm cfrac", "X78466BB97BEE5495" ], | |
49 | [ | |
50 | "\033[1X\033[33X\033[0;-2YThe Multiple Polynomial Quadratic Sieve (MPQS)\\ | |
51 | 033[133X\033[101X", "3.6", [ 3, 6, 0 ], 240, 12, | |
52 | "the multiple polynomial quadratic sieve mpqs", "X7A5C621C7FCFAA8A" ], | |
53 | [ "\033[1X\033[33X\033[0;-2YHow much Time does a Factorization take?\033[133\ | |
54 | X\033[101X", "4", [ 4, 0, 0 ], 1, 13, | |
55 | "how much time does a factorization take?", "X85B6B6E4796B99EE" ], | |
56 | [ | |
57 | "\033[1X\033[33X\033[0;-2YTimings for the general factorization routine\\ | |
58 | 033[133X\033[101X", "4.1", [ 4, 1, 0 ], 4, 13, | |
59 | "timings for the general factorization routine", "X825FC33479FE2B1D" ], | |
60 | [ "\033[1X\033[33X\033[0;-2YTimings for the ECM\033[133X\033[101X", "4.2", | |
61 | [ 4, 2, 0 ], 30, 13, "timings for the ecm", "X8131C8BD7F637545" ], | |
62 | [ "\033[1X\033[33X\033[0;-2YTimings for the MPQS\033[133X\033[101X", "4.3", | |
63 | [ 4, 3, 0 ], 80, 14, "timings for the mpqs", "X7E2D09BD7AD0D77F" ], | |
64 | [ "Bibliography", "bib", [ "Bib", 0, 0 ], 1, 15, "bibliography", | |
65 | "X7A6F98FD85F02BFE" ], | |
66 | [ "References", "bib", [ "Bib", 0, 0 ], 1, 15, "references", | |
67 | "X7A6F98FD85F02BFE" ], | |
68 | [ "Index", "ind", [ "Ind", 0, 0 ], 1, 16, "index", "X83A0356F839C696F" ], | |
69 | [ "prime ideal", "1.", [ 1, 0, 0 ], 1, 4, "prime ideal", | |
70 | "X874E1D45845007FE" ], | |
71 | [ "Generalized Number Field Sieve", "1.", [ 1, 0, 0 ], 1, 4, | |
72 | "generalized number field sieve", "X874E1D45845007FE" ], | |
73 | [ "Pollard's Rho", "1.", [ 1, 0, 0 ], 1, 4, "pollards rho", | |
74 | "X874E1D45845007FE" ], | |
75 | [ "RSA Factoring Challenge", "1.", [ 1, 0, 0 ], 1, 4, | |
76 | "rsa factoring challenge", "X874E1D45845007FE" ], | |
77 | [ "\033[2XFactors\033[102X factint's method, for integers", "2.1-1", | |
78 | [ 2, 1, 1 ], 10, 5, "factors factints method for integers", | |
79 | "X833B087D7A83BC7A" ], | |
80 | [ "primality of the factors", "2.1-1", [ 2, 1, 1 ], 10, 5, | |
81 | "primality of the factors", "X833B087D7A83BC7A" ], | |
82 | [ "\033[2XFactInt\033[102X factorization of an integer", "2.1-2", | |
83 | [ 2, 1, 2 ], 113, 7, "factint factorization of an integer", | |
84 | "X866CD23D78460060" ], | |
85 | [ "information about factoring process", "2.2", [ 2, 2, 0 ], 147, 7, | |
86 | "information about factoring process", "X80EB87DD80462F80" ], | |
87 | [ "\033[2XInfoFactInt\033[102X factint's info class", "2.2-1", [ 2, 2, 1 ], | |
88 | 153, 7, "infofactint factints info class", "X8093BB787C2E764B" ], | |
89 | [ "\033[2XFactIntInfo\033[102X setting the infolevel of infofactint", | |
90 | "2.2-1", [ 2, 2, 1 ], 153, 7, | |
91 | "factintinfo setting the infolevel of infofactint", "X8093BB787C2E764B" | |
92 | ], [ "trial division", "3.1", [ 3, 1, 0 ], 8, 8, "trial division", | |
93 | "X7A0392177E697956" ], | |
94 | [ "\033[2XFactorsTD\033[102X trial division", "3.1-1", [ 3, 1, 1 ], 11, 8, | |
95 | "factorstd trial division", "X7C4D255A789F54B4" ], | |
96 | [ "Pollard's \033[22Xp-1\033[122X", "3.2", [ 3, 2, 0 ], 29, 8, | |
97 | "pollards p-1", "X8081FF657DA9C674" ], | |
98 | [ "\033[2XFactorsPminus1\033[102X pollard's p-1", "3.2-1", [ 3, 2, 1 ], 32, | |
99 | 8, "factorspminus1 pollards p-1", "X7AF95E2E87F58200" ], | |
100 | [ "Lagrange's Theorem", "3.2-1", [ 3, 2, 1 ], 32, 8, "lagranges theorem", | |
101 | "X7AF95E2E87F58200" ], | |
102 | [ "Williams' \033[22Xp+1\033[122X", "3.3", [ 3, 3, 0 ], 70, 9, | |
103 | "williams p+1", "X860B4BE37DABDE10" ], | |
104 | [ "\033[2XFactorsPplus1\033[102X williams' p+1", "3.3-1", [ 3, 3, 1 ], 73, | |
105 | 9, "factorspplus1 williams p+1", "X8079A0367DE4FC35" ], | |
106 | [ "Elliptic Curves Method (ECM)", "3.4", [ 3, 4, 0 ], 106, 10, | |
107 | "elliptic curves method ecm", "X7837106783A5194B" ], | |
108 | [ "\033[2XFactorsECM\033[102X elliptic curves method, ecm", "3.4-1", | |
109 | [ 3, 4, 1 ], 109, 10, "factorsecm elliptic curves method ecm", | |
110 | "X87B162F878AD031C" ], | |
111 | [ "\033[2XECM\033[102X shorthand for factorsecm", "3.4-1", [ 3, 4, 1 ], | |
112 | 109, 10, "ecm shorthand for factorsecm", "X87B162F878AD031C" ], | |
113 | [ "first stage limit", "3.4-1", [ 3, 4, 1 ], 109, 10, "first stage limit", | |
114 | "X87B162F878AD031C" ], | |
115 | [ "second stage limit", "3.4-1", [ 3, 4, 1 ], 109, 10, "second stage limit", | |
116 | "X87B162F878AD031C" ], | |
117 | [ "elliptic curve groups", "3.4-1", [ 3, 4, 1 ], 109, 10, | |
118 | "elliptic curve groups", "X87B162F878AD031C" ], | |
119 | [ "elliptic curve point", "3.4-1", [ 3, 4, 1 ], 109, 10, | |
120 | "elliptic curve point", "X87B162F878AD031C" ], | |
121 | [ "projective coordinates", "3.4-1", [ 3, 4, 1 ], 109, 10, | |
122 | "projective coordinates", "X87B162F878AD031C" ], | |
123 | [ "Weierstrass model", "3.4-1", [ 3, 4, 1 ], 109, 10, "weierstrass model", | |
124 | "X87B162F878AD031C" ], | |
125 | [ "Continued Fraction Algorithm (CFRAC)", "3.5", [ 3, 5, 0 ], 194, 11, | |
126 | "continued fraction algorithm cfrac", "X78466BB97BEE5495" ], | |
127 | [ "\033[2XFactorsCFRAC\033[102X continued fraction algorithm, cfrac", | |
128 | "3.5-1", [ 3, 5, 1 ], 197, 11, | |
129 | "factorscfrac continued fraction algorithm cfrac", "X7A5C8BC5861CFC8C" ] | |
130 | , | |
131 | [ "\033[2XCFRAC\033[102X shorthand for factorscfrac", "3.5-1", [ 3, 5, 1 ], | |
132 | 197, 11, "cfrac shorthand for factorscfrac", "X7A5C8BC5861CFC8C" ], | |
133 | [ "continued fraction approximation", "3.5-1", [ 3, 5, 1 ], 197, 11, | |
134 | "continued fraction approximation", "X7A5C8BC5861CFC8C" ], | |
135 | [ "factor base", "3.5-1", [ 3, 5, 1 ], 197, 11, "factor base", | |
136 | "X7A5C8BC5861CFC8C" ], | |
137 | [ "factor base large factors", "3.5-1", [ 3, 5, 1 ], 197, 11, | |
138 | "factor base large factors", "X7A5C8BC5861CFC8C" ], | |
139 | [ "Gaussian Elimination", "3.5-1", [ 3, 5, 1 ], 197, 11, | |
140 | "gaussian elimination", "X7A5C8BC5861CFC8C" ], | |
141 | [ "Multiple Polynomial Quadratic Sieve (MPQS)", "3.6", [ 3, 6, 0 ], 240, | |
142 | 12, "multiple polynomial quadratic sieve mpqs", "X7A5C621C7FCFAA8A" ], | |
143 | [ "\033[2XFactorsMPQS\033[102X multiple polynomial quadratic sieve, mpqs", | |
144 | "3.6-1", [ 3, 6, 1 ], 243, 12, | |
145 | "factorsmpqs multiple polynomial quadratic sieve mpqs", | |
146 | "X86F8DFB681442E05" ], | |
147 | [ "\033[2XMPQS\033[102X shorthand for factorsmpqs", "3.6-1", [ 3, 6, 1 ], | |
148 | 243, 12, "mpqs shorthand for factorsmpqs", "X86F8DFB681442E05" ], | |
149 | [ "sieving interval", "3.6-1", [ 3, 6, 1 ], 243, 12, "sieving interval", | |
150 | "X86F8DFB681442E05" ] ] | |
151 | ); |
0 | ||
1 | /* colors for ColorPrompt like examples */ | |
2 | span.GAPprompt { | |
3 | color: #000000; | |
4 | font-weight: normal; | |
5 | } | |
6 | span.GAPbrkprompt { | |
7 | color: #000000; | |
8 | font-weight: normal; | |
9 | } | |
10 | span.GAPinput { | |
11 | color: #000000; | |
12 | } |
0 | /* times.css Frank Lübeck */ | |
1 | /* Change default CSS to use Times font. */ | |
2 | ||
3 | body { | |
4 | text-align: left; | |
5 | } |
0 | ||
1 | function randchar(str) { | |
2 | var i = Math.floor(Math.random() * str.length); | |
3 | while (i == str.length) | |
4 | i = Math.floor(Math.random() * str.length); | |
5 | return str[i]; | |
6 | } | |
7 | ||
8 | hexdigits = "0123456789abcdef"; | |
9 | ||
10 | function randlight() { | |
11 | return randchar("cdef")+randchar(hexdigits)+ | |
12 | randchar("cdef")+randchar(hexdigits)+ | |
13 | randchar("cdef")+randchar(hexdigits) | |
14 | } | |
15 | function randdark() { | |
16 | return randchar("012345789")+randchar(hexdigits)+ | |
17 | randchar("012345789")+randchar(hexdigits)+ | |
18 | randchar("102345789")+randchar(hexdigits) | |
19 | } | |
20 | ||
21 | document.write('<style type="text/css">\n<!--\n'); | |
22 | document.write('body {\n color: #'+randdark()+';\n background: #'+ | |
23 | randlight()+';\n}\n'); | |
24 | document.write('a:link {\n color: #'+randdark()+';\n}\n'); | |
25 | document.write('a:visited {\n color: #'+randdark()+';\n}\n'); | |
26 | document.write('a:active {\n color: #'+randdark()+';\n}\n'); | |
27 | document.write('a:hover {\n background-color: #'+randlight()+';\n}\n'); | |
28 | document.write('pre {\n color: #'+randdark()+';\n}\n'); | |
29 | document.write('tt {\n color: #'+randdark()+';\n}\n'); | |
30 | document.write('code {\n color: #'+randdark()+';\n}\n'); | |
31 | document.write('var {\n color: #'+randdark()+';\n}\n'); | |
32 | document.write('div.func {\n background-color: #'+randlight()+';\n}\n'); | |
33 | document.write('div.example {\n background-color: #'+randlight()+';\n}\n'); | |
34 | document.write('div.chlinktop {\n background-color: #'+randlight()+';\n}\n'); | |
35 | document.write('div.chlinkbot {\n background-color: #'+randlight()+';\n}\n'); | |
36 | document.write('pre.normal {\n color: #'+randdark()+';\n}\n'); | |
37 | document.write('code.func {\n color: #'+randdark()+';\n}\n'); | |
38 | document.write('code.keyw {\n color: #'+randdark()+';\n}\n'); | |
39 | document.write('code.file {\n color: #'+randdark()+';\n}\n'); | |
40 | document.write('code.code {\n color: #'+randdark()+';\n}\n'); | |
41 | document.write('code.i {\n color: #'+randdark()+';\n}\n'); | |
42 | document.write('strong.button {\n color: #'+randdark()+';\n}\n'); | |
43 | document.write('span.Heading {\n color: #'+randdark()+';\n}\n'); | |
44 | document.write('var.Arg {\n color: #'+randdark()+';\n}\n'); | |
45 | document.write('strong.pkg {\n color: #'+randdark()+';\n}\n'); | |
46 | document.write('strong.Mark {\n color: #'+randdark()+';\n}\n'); | |
47 | document.write('b.Ref {\n color: #'+randdark()+';\n}\n'); | |
48 | document.write('span.Ref {\n color: #'+randdark()+';\n}\n'); | |
49 | document.write('span.GAPprompt {\n color: #'+randdark()+';\n}\n'); | |
50 | document.write('span.GAPbrkprompt {\n color: #'+randdark()+';\n}\n'); | |
51 | document.write('span.GAPinput {\n color: #'+randdark()+';\n}\n'); | |
52 | document.write('b.Bib_author {\n color: #'+randdark()+';\n}\n'); | |
53 | document.write('span.Bib_key {\n color: #'+randdark()+';\n}\n'); | |
54 | document.write('i.Bib_title {\n color: #'+randdark()+';\n}\n'); | |
55 | ||
56 | document.write('-->\n</style>\n'); | |
57 | ||
58 | ||
59 |
0 | /* times.css Frank Lübeck */ | |
1 | /* Change default CSS to use Times font. */ | |
2 | ||
3 | body { | |
4 | font-family: Times,Times New Roman,serif; | |
5 | } |
0 | /* toggless.css Frank Lübeck */ | |
1 | ||
2 | /* Using javascript we change all div.ContSect to div.ContSectOpen or | |
3 | div.ContSectClosed. This way the config for div.ContSect in manual.css | |
4 | is no longer relevant. Here we add the CSS for the new elements. */ | |
5 | /* This layout is based on an idea by Burkhard Höfling. */ | |
6 | ||
7 | div.ContSectClosed { | |
8 | text-align: left; | |
9 | margin-left: 1em; | |
10 | } | |
11 | div.ContSectOpen { | |
12 | text-align: left; | |
13 | margin-left: 1em; | |
14 | } | |
15 | div.ContSectOpen div.ContSSBlock { | |
16 | display: block; | |
17 | text-align: left; | |
18 | margin-left: 1em; | |
19 | } | |
20 | div.ContSectOpen div.ContSSBlock a { | |
21 | display: block; | |
22 | width: 100%; | |
23 | margin-left: 1em; | |
24 | } | |
25 | span.tocline a:hover { | |
26 | display: inline; | |
27 | background: #eeeeee; | |
28 | } | |
29 | span.ContSS a:hover { | |
30 | display: inline; | |
31 | background: #eeeeee; | |
32 | } | |
33 | span.toctoggle { | |
34 | font-size: 80%; | |
35 | display: inline-block; | |
36 | width: 1.2em; | |
37 | } | |
38 | span.toctoggle:hover { | |
39 | background-color: #aaaaaa; | |
40 | } | |
41 |
0 | /* toggless.js Frank Lübeck */ | |
1 | ||
2 | /* this file contains two functions: | |
3 | mergeSideTOCHooks: this changes div.ContSect elements to the class | |
4 | ContSectClosed and includes a hook to toggle between | |
5 | ContSectClosed and ContSectOpen. | |
6 | openclosetoc: this function does the toggling, the rest is done by | |
7 | CSS | |
8 | */ | |
9 | ||
10 | ||
11 | ||
12 | closedTOCMarker = "▶ "; | |
13 | openTOCMarker = "▼ "; | |
14 | noTOCMarker = " "; | |
15 | /* merge hooks into side toc for opening/closing subsections | |
16 | with openclosetoc */ | |
17 | function mergeSideTOCHooks() { | |
18 | var hlist = document.getElementsByTagName("div"); | |
19 | for (var i = 0; i < hlist.length; i++) { | |
20 | if (hlist[i].className == "ContSect") { | |
21 | var chlds = hlist[i].childNodes; | |
22 | var el = document.createElement("span"); | |
23 | var oncl = document.createAttribute("class"); | |
24 | oncl.nodeValue = "toctoggle"; | |
25 | el.setAttributeNode(oncl); | |
26 | var cont; | |
27 | if (chlds.length > 2) { | |
28 | var oncl = document.createAttribute("onclick"); | |
29 | oncl.nodeValue = "openclosetoc(event)"; | |
30 | el.setAttributeNode(oncl); | |
31 | cont = document.createTextNode(closedTOCMarker); | |
32 | } else { | |
33 | cont = document.createTextNode(noTOCMarker); | |
34 | } | |
35 | el.appendChild(cont); | |
36 | hlist[i].firstChild.insertBefore(el, hlist[i].firstChild.firstChild); | |
37 | hlist[i].className = "ContSectClosed"; | |
38 | } | |
39 | } | |
40 | } | |
41 | ||
42 | function openclosetoc (event) { | |
43 | /* first two steps to make it work in most browsers */ | |
44 | var evt=window.event || event; | |
45 | if (!evt.target) | |
46 | evt.target=evt.srcElement; | |
47 | ||
48 | var markClosed = document.createTextNode(closedTOCMarker); | |
49 | var markOpen = document.createTextNode(openTOCMarker); | |
50 | ||
51 | var par = evt.target.parentNode.parentNode; | |
52 | if (par.className == "ContSectOpen") { | |
53 | par.className = "ContSectClosed"; | |
54 | evt.target.replaceChild(markClosed, evt.target.firstChild); | |
55 | } | |
56 | else if (par.className == "ContSectClosed") { | |
57 | par.className = "ContSectOpen"; | |
58 | evt.target.replaceChild(markOpen, evt.target.firstChild); | |
59 | } | |
60 | } | |
61 | ||
62 | /* adjust jscontent which is called onload */ | |
63 | jscontentfuncs.push(mergeSideTOCHooks); | |
64 |
0 | #!/usr/bin/env bash | |
1 | set -ex | |
2 | ||
3 | # clone GAP into a subdirectory | |
4 | git clone --depth=2 -b ${GAPBRANCH:-master} https://github.com/gap-system/gap.git $GAPROOT | |
5 | cd $GAPROOT | |
6 | ||
7 | # for HPC-GAP, install ward, add suitable flags | |
8 | if [[ $HPCGAP = yes ]]; then | |
9 | git clone https://github.com/gap-system/ward | |
10 | cd ward | |
11 | CFLAGS= LDFLAGS= ./build.sh | |
12 | cd .. | |
13 | GAP_CONFIGFLAGS="$GAP_CONFIGFLAGS --enable-hpcgap" | |
14 | fi | |
15 | ||
16 | # build GAP in a subdirectory | |
17 | ./autogen.sh | |
18 | ./configure $GAP_CONFIGFLAGS | |
19 | make -j4 V=1 | |
20 | ||
21 | # download packages; instruct wget to retry several times if the | |
22 | # connection is refused, to work around intermittent failures | |
23 | make bootstrap-pkg-full WGET="wget -N --no-check-certificate --tries=5 --waitretry=5 --retry-connrefused" | |
24 | ||
25 | # build some packages (default is to build 'io' and 'profiling', | |
26 | # in order to generate coverage results) | |
27 | cd pkg | |
28 | for pkg in ${GAP_PKGS_TO_BUILD-io profiling}; do | |
29 | ../bin/BuildPackages.sh --strict $pkg* | |
30 | done |
0 | #!/usr/bin/env bash | |
1 | set -ex | |
2 | ||
3 | # ensure coverage is turned on | |
4 | export CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" | |
5 | export LDFLAGS="$LDFLAGS -fprofile-arcs" | |
6 | ||
7 | if [[ $ABI = 32 ]]; then | |
8 | export CFLAGS="$CFLAGS -m32" | |
9 | export LDFLAGS="$LDFLAGS -m32" | |
10 | fi | |
11 | ||
12 | # build this package | |
13 | if [[ -x autogen.sh ]]; then | |
14 | ./autogen.sh | |
15 | ./configure --with-gaproot=$GAPROOT | |
16 | make -j4 V=1 | |
17 | elif [[ -x configure ]]; then | |
18 | ./configure $GAPROOT | |
19 | make -j4 | |
20 | fi | |
21 | ||
22 | # trick to allow the package directory to be used as a GAP root dir | |
23 | ln -s . pkg |
0 | #!/usr/bin/env bash | |
1 | set -ex | |
2 | ||
3 | # If we don't care about code coverage, do nothing | |
4 | if [[ -n $NO_COVERAGE ]]; then | |
5 | exit 0 | |
6 | fi | |
7 | ||
8 | GAP="$GAPROOT/bin/gap.sh -l $PWD; --quitonbreak -q" | |
9 | ||
10 | # generate library coverage reports | |
11 | $GAP -a 500M -m 500M -q <<GAPInput | |
12 | if LoadPackage("profiling") <> true then | |
13 | Print("ERROR: could not load profiling package"); | |
14 | FORCE_QUIT_GAP(1); | |
15 | fi; | |
16 | d := Directory("$COVDIR");; | |
17 | covs := [];; | |
18 | for f in DirectoryContents(d) do | |
19 | if f in [".", ".."] then continue; fi; | |
20 | Add(covs, Filename(d, f)); | |
21 | od; | |
22 | Print("Merging coverage results from ", covs, "\n"); | |
23 | r := MergeLineByLineProfiles(covs);; | |
24 | Print("Outputting JSON\n"); | |
25 | OutputJsonCoverage(r, "gap-coverage.json");; | |
26 | QUIT_GAP(0); | |
27 | GAPInput | |
28 | ||
29 | # generate source coverage reports by running gcov | |
30 | gcov -o . src/*.c* |