Skip to content

Commit c884aca

Browse files
committed
made curve comparison method const
1 parent 5db9e91 commit c884aca

File tree

5 files changed

+32
-25
lines changed

5 files changed

+32
-25
lines changed

libsrc/eclib/curve.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ friend class IsogenyClass;
259259
// (2) list of ap for good p < NP_SORT
260260
// (3) a1,a2,a3,4,a6
261261
vector<bigint> sort_key(const int NP_SORT=25) const;
262-
int operator<(const CurveRed& E) {return sort_key()<E.sort_key();}
262+
int operator<(const CurveRed& E) const {return sort_key()<E.sort_key();}
263263
private:
264264
// functions for setting local root numbers:
265265
int neron(long p, int kod); // p = 2 or 3

libsrc/egros.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ vector<CurveRed> egros_from_j_1728(const vector<bigint>& S)
7676
if (Ered.has_good_reduction_outside_S(S))
7777
Elist.push_back(Ered);
7878
}
79+
std::sort(Elist.begin(), Elist.end());
7980
return Elist;
8081
}
8182

@@ -101,6 +102,7 @@ vector<CurveRed> egros_from_j_0(const vector<bigint>& S)
101102
if (Ered.has_good_reduction_outside_S(S))
102103
Elist.push_back(Ered);
103104
}
105+
std::sort(Elist.begin(), Elist.end());
104106
return Elist;
105107
}
106108

@@ -182,6 +184,7 @@ vector<CurveRed> egros_from_j(const bigrational& j, const vector<bigint>& S)
182184
if (Ered.has_good_reduction_outside_S(S))
183185
Elist.push_back(Ered);
184186
}
187+
std::sort(Elist.begin(), Elist.end());
185188
return Elist;
186189
}
187190

tests/out_no_ntl/tegros.out

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,14 @@ Curves with good reduction outside [ 2 3 5 ] and j = 272223782641/164025 do exis
113113
[0,0,0,72,0] conductor 2304 sort key [ 2304 0 0 4 0 0 -4 2 0 0 4 0 12 10 0 0 4 0 12 0 0 -6 0 0 -10 -18 0 0 0 72 0 ]
114114

115115
Elliptic curves with conductor a power of 11, from their known j-invariants
116-
2 curves with j = -122023936/161051: [0,-1,1,-1250,31239] [0,-1,1,-10,-20]
117-
2 curves with j = -52893159101157376/11: [0,-1,1,-946260,354609639] [0,-1,1,-7820,-263580]
116+
2 curves with j = -122023936/161051: [0,-1,1,-10,-20] [0,-1,1,-1250,31239]
117+
2 curves with j = -52893159101157376/11: [0,-1,1,-7820,-263580] [0,-1,1,-946260,354609639]
118118
2 curves with j = -4096/11: [0,-1,1,0,0] [0,-1,1,-40,-221]
119119
2 curves with j = -121: [1,1,1,-305,7888] [1,1,0,-2,-7]
120-
2 curves with j = -32768: [0,-1,1,-7,10] [0,-1,1,-887,-10143]
121-
2 curves with j = -24729001: [1,1,0,-3632,82757] [1,1,1,-30,-76]
122-
Sorted list:
120+
2 curves with j = -32768: [0,-1,1,-887,-10143] [0,-1,1,-7,10]
121+
2 curves with j = -24729001: [1,1,1,-30,-76] [1,1,0,-3632,82757]
122+
123+
Full sorted list:
123124
conductor 11 [0,-1,1,-7820,-263580] j = -52893159101157376/11
124125
conductor 11 [0,-1,1,-10,-20] j = -122023936/161051
125126
conductor 11 [0,-1,1,0,0] j = -4096/11
@@ -135,13 +136,14 @@ conductor 121 [0,-1,1,-40,-221] j = -4096/11
135136

136137
Possible conductors <= 100 of curves with j=0: [ 27 36 72 81 ]
137138
Actual conductors and curves:
138-
27 [0,0,1,0,0]
139139
27 [0,0,1,0,-7]
140-
36 [0,0,0,0,1]
140+
27 [0,0,1,0,0]
141141
36 [0,0,0,0,-27]
142-
Possible conductors < 100 of curves with j=1728: [ 16 32 36 64 72 100 ]
142+
36 [0,0,0,0,1]
143+
144+
Possible conductors <= 100 of curves with j=1728: [ 16 32 36 64 72 100 ]
143145
Actual conductors and curves:
144-
32 [0,0,0,4,0]
145146
32 [0,0,0,-1,0]
146-
64 [0,0,0,1,0]
147+
32 [0,0,0,4,0]
147148
64 [0,0,0,-4,0]
149+
64 [0,0,0,1,0]

tests/out_ntl/tegros.out

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,14 @@ Curves with good reduction outside [ 2 3 5 ] and j = 272223782641/164025 do exis
113113
[0,0,0,72,0] conductor 2304 sort key [ 2304 0 0 4 0 0 -4 2 0 0 4 0 12 10 0 0 4 0 12 0 0 -6 0 0 -10 -18 0 0 0 72 0 ]
114114

115115
Elliptic curves with conductor a power of 11, from their known j-invariants
116-
2 curves with j = -122023936/161051: [0,-1,1,-1250,31239] [0,-1,1,-10,-20]
117-
2 curves with j = -52893159101157376/11: [0,-1,1,-946260,354609639] [0,-1,1,-7820,-263580]
116+
2 curves with j = -122023936/161051: [0,-1,1,-10,-20] [0,-1,1,-1250,31239]
117+
2 curves with j = -52893159101157376/11: [0,-1,1,-7820,-263580] [0,-1,1,-946260,354609639]
118118
2 curves with j = -4096/11: [0,-1,1,0,0] [0,-1,1,-40,-221]
119119
2 curves with j = -121: [1,1,1,-305,7888] [1,1,0,-2,-7]
120-
2 curves with j = -32768: [0,-1,1,-7,10] [0,-1,1,-887,-10143]
121-
2 curves with j = -24729001: [1,1,0,-3632,82757] [1,1,1,-30,-76]
122-
Sorted list:
120+
2 curves with j = -32768: [0,-1,1,-887,-10143] [0,-1,1,-7,10]
121+
2 curves with j = -24729001: [1,1,1,-30,-76] [1,1,0,-3632,82757]
122+
123+
Full sorted list:
123124
conductor 11 [0,-1,1,-7820,-263580] j = -52893159101157376/11
124125
conductor 11 [0,-1,1,-10,-20] j = -122023936/161051
125126
conductor 11 [0,-1,1,0,0] j = -4096/11
@@ -135,13 +136,14 @@ conductor 121 [0,-1,1,-40,-221] j = -4096/11
135136

136137
Possible conductors <= 100 of curves with j=0: [ 27 36 72 81 ]
137138
Actual conductors and curves:
138-
27 [0,0,1,0,0]
139139
27 [0,0,1,0,-7]
140-
36 [0,0,0,0,1]
140+
27 [0,0,1,0,0]
141141
36 [0,0,0,0,-27]
142-
Possible conductors < 100 of curves with j=1728: [ 16 32 36 64 72 100 ]
142+
36 [0,0,0,0,1]
143+
144+
Possible conductors <= 100 of curves with j=1728: [ 16 32 36 64 72 100 ]
143145
Actual conductors and curves:
144-
32 [0,0,0,4,0]
145146
32 [0,0,0,-1,0]
146-
64 [0,0,0,1,0]
147+
32 [0,0,0,4,0]
147148
64 [0,0,0,-4,0]
149+
64 [0,0,0,1,0]

tests/tegros.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,11 @@ int main(void)
5454
cout<<endl;
5555

5656
vector<CurveRed> egr_S23_0 = egros_from_j_0(S23);
57-
std::sort(egr_S23_0.begin(), egr_S23_0.end());
5857
cout << egr_S23_0.size()<< " curves with j=0 and good reduction outside "<<S23<<" (should be 72):\n";
5958
for (auto E1: egr_S23_0) cout<<(Curve)E1<<" conductor "<<E1.conductor()<<" sort key "<<E1.sort_key()<<endl;
6059
cout<<endl;
6160

6261
vector<CurveRed> egr_S23_1728 = egros_from_j_1728(S23);
63-
std::sort(egr_S23_1728.begin(), egr_S23_1728.end());
6462
cout << egr_S23_1728.size()<< " curves with j=1728 and good reduction outside "<<S23<<" (should be 32):\n";
6563
for (auto E1: egr_S23_1728) cout<<(Curve)E1<<" conductor "<<E1.conductor()<<" sort key "<<E1.sort_key()<<endl;
6664
cout<<endl;
@@ -83,8 +81,9 @@ int main(void)
8381
cout << endl;
8482
egr_11.insert(egr_11.end(), EE.cbegin(), EE.cend());
8583
}
84+
cout<<endl;
8685
std::sort(egr_11.begin(), egr_11.end());
87-
cout<<"Sorted list:\n";
86+
cout<<"Full sorted list:\n";
8887
for (auto E1: egr_11)
8988
cout << "conductor " << E1.conductor() << "\t" << (Curve)E1 << "\tj = " << j_invariant(E1) << endl;
9089
cout << endl;
@@ -117,7 +116,8 @@ int main(void)
117116
cout << "Actual conductors and curves:\n";
118117
for (auto E1: E_j_0)
119118
cout << E1.conductor() << "\t" << (Curve)E1 << endl;
120-
cout << "Possible conductors < 100 of curves with j=1728: " << N_j_1728 << endl;
119+
cout << endl;
120+
cout << "Possible conductors <= 100 of curves with j=1728: " << N_j_1728 << endl;
121121
cout << "Actual conductors and curves:\n";
122122
for (auto E1: E_j_1728)
123123
cout << E1.conductor() << "\t" << (Curve)E1 << endl;

0 commit comments

Comments
 (0)