@@ -51,9 +51,9 @@ public static void setup() {
51
51
// reference computation
52
52
correctCounts = new ArrayList <Integer >();
53
53
for (int n =0 ; n <NCOUNT ; n ++) {
54
- List <BigInteger > quadraticResiduesMod2PowN = QuadraticResiduesMod2PowN .getQuadraticResiduesMod2PowN_testAll_big (n );
55
- LOG .info ("n = " + n + " has " + quadraticResiduesMod2PowN .size () + " quadratic residues" + (SHOW_ELEMENTS ? ": " + quadraticResiduesMod2PowN : "" ));
56
- correctCounts .add (quadraticResiduesMod2PowN .size ());
54
+ List <BigInteger > quadraticResidues = QuadraticResiduesMod2PowN .getQuadraticResiduesMod2PowN_testAll_big (n );
55
+ LOG .info ("n = " + n + " has " + quadraticResidues .size () + " quadratic residues modulo 2^ " + n + (SHOW_ELEMENTS ? ": " + quadraticResidues : "" ));
56
+ correctCounts .add (quadraticResidues .size ());
57
57
}
58
58
LOG .info ("v0 counts = " + correctCounts );
59
59
}
@@ -62,9 +62,9 @@ public static void setup() {
62
62
public void testV1 () {
63
63
ArrayList <Integer > counts = new ArrayList <Integer >();
64
64
for (int n =0 ; n <NCOUNT ; n ++) {
65
- List <Long > quadraticResiduesMod2PowN_v1 = QuadraticResiduesMod2PowN .getQuadraticResiduesMod2PowN_testAll (n );
66
- if (DEBUG ) LOG .debug ("v1: n = " + n + " has " + quadraticResiduesMod2PowN_v1 .size () + " quadratic residues" + (SHOW_ELEMENTS ? ": " + quadraticResiduesMod2PowN_v1 : "" ));
67
- counts .add (quadraticResiduesMod2PowN_v1 .size ());
65
+ List <Long > quadraticResidues = QuadraticResiduesMod2PowN .getQuadraticResiduesMod2PowN_testAll (n );
66
+ if (DEBUG ) LOG .debug ("v1: n = " + n + " has " + quadraticResidues .size () + " quadratic residues modulo 2^ " + n + (SHOW_ELEMENTS ? ": " + quadraticResidues : "" ));
67
+ counts .add (quadraticResidues .size ());
68
68
}
69
69
LOG .info ("v1 counts = " + counts );
70
70
assertEquals (correctCounts , counts );
@@ -74,9 +74,9 @@ public void testV1() {
74
74
public void testV2 () {
75
75
ArrayList <Integer > counts = new ArrayList <Integer >();
76
76
for (int n =0 ; n <NCOUNT ; n ++) {
77
- List <Long > quadraticResiduesMod2PowN_v1 = QuadraticResiduesMod2PowN .getQuadraticResiduesMod2PowN_testAll_v2 (n );
78
- if (DEBUG ) LOG .debug ("v2: n = " + n + " has " + quadraticResiduesMod2PowN_v1 .size () + " quadratic residues" + (SHOW_ELEMENTS ? ": " + quadraticResiduesMod2PowN_v1 : "" ));
79
- counts .add (quadraticResiduesMod2PowN_v1 .size ());
77
+ List <Long > quadraticResidues = QuadraticResiduesMod2PowN .getQuadraticResiduesMod2PowN_testAll_v2 (n );
78
+ if (DEBUG ) LOG .debug ("v2: n = " + n + " has " + quadraticResidues .size () + " quadratic residues modulo 2^ " + n + (SHOW_ELEMENTS ? ": " + quadraticResidues : "" ));
79
+ counts .add (quadraticResidues .size ());
80
80
}
81
81
LOG .info ("v2 counts = " + counts );
82
82
assertEquals (correctCounts , counts );
@@ -86,9 +86,9 @@ public void testV2() {
86
86
public void testV3 () {
87
87
ArrayList <Integer > counts = new ArrayList <Integer >();
88
88
for (int n =0 ; n <NCOUNT ; n ++) {
89
- List <Long > quadraticResiduesMod2PowN_v1 = QuadraticResiduesMod2PowN .getQuadraticResiduesMod2PowN (n );
90
- if (DEBUG ) LOG .debug ("v3: n = " + n + " has " + quadraticResiduesMod2PowN_v1 .size () + " quadratic residues" + (SHOW_ELEMENTS ? ": " + quadraticResiduesMod2PowN_v1 : "" ));
91
- counts .add (quadraticResiduesMod2PowN_v1 .size ());
89
+ List <Long > quadraticResidues = QuadraticResiduesMod2PowN .getQuadraticResiduesMod2PowN (n );
90
+ if (DEBUG ) LOG .debug ("v3: n = " + n + " has " + quadraticResidues .size () + " quadratic residues modulo 2^ " + n + (SHOW_ELEMENTS ? ": " + quadraticResidues : "" ));
91
+ counts .add (quadraticResidues .size ());
92
92
}
93
93
LOG .info ("v3 counts = " + counts );
94
94
assertEquals (correctCounts , counts );
@@ -100,7 +100,7 @@ public void testV4() {
100
100
for (int n =0 ; n <NCOUNT ; n ++) {
101
101
long [] array = new long [((1 <<n ) / 6 ) + 6 ];
102
102
int count = QuadraticResiduesMod2PowN .getQuadraticResiduesMod2PowN (n , array );
103
- if (DEBUG ) LOG .debug ("v4: n = " + n + " has " + count + " quadratic residues" + (SHOW_ELEMENTS ? ": " + Arrays .toString (array ) : "" ));
103
+ if (DEBUG ) LOG .debug ("v4: n = " + n + " has " + count + " quadratic residues modulo 2^" + n + (SHOW_ELEMENTS ? ": " + Arrays .toString (array ) : "" ));
104
104
counts .add (count );
105
105
}
106
106
LOG .info ("v4 counts = " + counts );
0 commit comments