@@ -77,22 +77,22 @@ private enum TestMode {
77
77
78
78
// algorithm options
79
79
/** number of test numbers */
80
- private static final int N_COUNT = 100000 ;
80
+ private static final int N_COUNT = 1 ;
81
81
/** the bit size of N to start with */
82
- private static final int START_BITS = 20 ;
82
+ private static final int START_BITS = 100 ;
83
83
/** the increment in bit size from test set to test set */
84
- private static final int INCR_BITS = 5 ;
84
+ private static final int INCR_BITS = 10 ;
85
85
/** maximum number of bits to test (no maximum if null) */
86
- private static final Integer MAX_BITS = 20 ;
86
+ private static final Integer MAX_BITS = null ;
87
87
/** each algorithm is run REPEATS times for each input in order to reduce GC influence on timings */
88
- private static final int REPEATS = 5 ;
88
+ private static final int REPEATS = 1 ;
89
89
/** number of warmup rounds */
90
- private static final int WARUMPS = 2 ;
90
+ private static final int WARUMPS = 0 ;
91
91
92
92
/** Nature of test numbers */
93
- private static final TestNumberNature TEST_NUMBER_NATURE = TestNumberNature .RANDOM_ODD_COMPOSITES ;
93
+ private static final TestNumberNature TEST_NUMBER_NATURE = TestNumberNature .MODERATE_SEMIPRIMES ;
94
94
/** Test mode */
95
- private static final TestMode TEST_MODE = TestMode .PRIME_FACTORIZATION ;
95
+ private static final TestMode TEST_MODE = TestMode .FIRST_FACTOR ;
96
96
97
97
private BPSWTest bpsw = new BPSWTest ();
98
98
@@ -105,38 +105,38 @@ public FactorizerTest() {
105
105
algorithms = new FactorAlgorithm [] {
106
106
107
107
// Trial division
108
- new TDiv31 (),
109
- new TDiv31Inverse (),
110
- new TDiv31Barrett (), // Fastest algorithm for N < 29 bit
111
- new TDiv63 (),
112
- new TDiv63Inverse (1 <<21 ),
113
- // new TDiv().setTestLimit(1<<21),
108
+ // new TDiv31(),
109
+ // new TDiv31Inverse(),
110
+ // new TDiv31Barrett(), // very good to completely factor N < 32 bit
111
+ // new TDiv63(),
112
+ // new TDiv63Inverse(1<<21),
113
+ // new TDiv().setTestLimit(1<<21),
114
114
115
115
// Hart's one line factorizer
116
116
//new HartSimple(),
117
- new HartFast (true ),
118
- new HartTDivRace (),
119
- new HartTDivRace2 (),
120
- new HartSquarefree (true ), // best algorithm for semiprime N for 29 to 37 bit
121
- new HartFast2Mult (true ), // best algorithm for semiprime N for 38 to 45 bit
122
- new HartFast2MultFMA (true ),
123
- new HartFast2Mult2 (true ), // best algorithm for semiprime N for 38 to 45 bit
117
+ // new HartFast(true),
118
+ // new HartTDivRace(), // quite good to factor random composites until 40 bit
119
+ // new HartTDivRace2(),
120
+ // new HartSquarefree(true),
121
+ // new HartFast2Mult(true), // with doTDivFirst==false, very good for semiprime N from 25 to 45 bit
122
+ // new HartFast2MultFMA(true),
123
+ // new HartFast2Mult2(true),
124
124
125
125
// Lehman
126
126
//new LehmanSimple(false),
127
127
//new LehmanSmith(false),
128
- new LehmanFast (true ), // the variant implemented by bsquared
129
- new LehmanCustomKOrder (true ),
128
+ // new LehmanFast(true), // the variant implemented by bsquared
129
+ // new LehmanCustomKOrder(true),
130
130
131
131
// PollardRho
132
- // new PollardRho31(),
133
- // new PollardRhoBrent31(),
134
- // new PollardRhoTwoLoops31(),
135
- new PollardRhoBrentMontgomery32 (),
132
+ // new PollardRho31(),
133
+ // new PollardRhoBrent31(),
134
+ // new PollardRhoTwoLoops31(),
135
+ // new PollardRhoBrentMontgomery32(),
136
136
137
- new PollardRhoBrentMontgomery64 (),
138
- new PollardRhoBrentMontgomery64MH (),
139
- new PollardRhoBrentMontgomery64MHInlined (),
137
+ // new PollardRhoBrentMontgomery64(),
138
+ // new PollardRhoBrentMontgomery64MH(),
139
+ // new PollardRhoBrentMontgomery64MHInlined(), // best for moderate semiprimes from ~40 to 50 bit
140
140
141
141
//new PollardRho(),
142
142
//new PollardRhoProductGcd(),
@@ -151,8 +151,8 @@ public FactorizerTest() {
151
151
// * best multiplier sequence = 1680 * {squarefree sequence}
152
152
// * best stopping criterion = O(5.th root(N))
153
153
//new SquFoF31(),
154
- new SquFoF31Preload (),
155
- new SquFoF63 (),
154
+ // new SquFoF31Preload(),
155
+ // new SquFoF63(),
156
156
157
157
// CFrac
158
158
// * never the best algorithm: SquFoF63 is better for N <= 65 bit, SIQS is better for N >= 55 bits
@@ -166,9 +166,9 @@ public FactorizerTest() {
166
166
// new CFrac63(true, 5, 1.5F, 0.152F, 0.25F, new TDiv_CF63_02(), new MatrixSolverGauss02(), 12),
167
167
168
168
// ECM
169
- new TinyEcm64 (true ),
170
- new TinyEcm64MH (true ),
171
- new TinyEcm64MHInlined (true ), // best algorithm for N from 46 to 62 bit
169
+ // new TinyEcm64(true),
170
+ // new TinyEcm64MH(true),
171
+ // new TinyEcm64MHInlined(true), // very good for N from 46 to 62 bit
172
172
// new EllipticCurveMethod(-1),
173
173
174
174
// SIQS:
@@ -193,7 +193,7 @@ public FactorizerTest() {
193
193
// On a Ryzen 3900X, Cmult=0.31 seems to be best for N <= 345 bit, Cmult=0.305 best for N > 345 bit.
194
194
// Probably, this depends heavily on the number of threads and the hardware, in particular the size of the L3-Cache.
195
195
// new PSIQS(0.31F, 0.37F, null, 12, new NoPowerFinder(), new MatrixSolverBlockLanczos()),
196
- // new PSIQS_U(0.31F, 0.37F, null, 12, new NoPowerFinder(), new MatrixSolverBlockLanczos()),
196
+ // new PSIQS_U(0.31F, 0.37F, null, 12, new NoPowerFinder(), new MatrixSolverBlockLanczos()),
197
197
// new PSIQS_U(0.31F, 0.37F, null, 12, new NoPowerFinder(), new MatrixSolverPGauss01(12)),
198
198
// new PSIQS_U(0.31F, 0.37F, null, 12, new PowerOfSmallPrimesFinder(), new MatrixSolverBlockLanczos()),
199
199
// new PSIQS_U(0.31F, 0.37F, null, 12, new AllPowerFinder(), new MatrixSolverBlockLanczos()),
0 commit comments