Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
241782 views
1
/*********************************************************************
2
3
(c) Copyright 2006-2010 Salman Baig and Chris Hall
4
5
This file is part of ELLFF
6
7
ELLFF is free software: you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation, either version 3 of the License, or
10
(at your option) any later version.
11
12
ELLFF is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20
*********************************************************************/
21
22
#ifndef ELL_SURFACE_H
23
#define ELL_SURFACE_H
24
25
#include "helper.h"
26
#include "lzz_pEratX.h"
27
28
// meant for elliptic surfaces in char != 2,3
29
30
class ell_surfaceInfoT {
31
public:
32
class affine_model {
33
public:
34
// divisors for additive reduction
35
zz_pEX A, I_star, II, II_star, III, III_star, IV, IV_star;
36
37
// divisors for multiplicative reduction
38
zz_pEX M_sp, M_ns;
39
40
// true if and only if curve is constant
41
// - false if isotrivial but not constant
42
bool constant_f;
43
44
private:
45
void init();
46
47
// cardinality of scalar field
48
long q;
49
50
void minimize();
51
52
public:
53
affine_model();
54
55
void init(const zz_pEratX& a4, const zz_pEratX& a6);
56
void init(const zz_pEX& a4, const zz_pEX& a6);
57
58
// j-invariant
59
zz_pEratX j;
60
61
// coefficients
62
zz_pEX a4, a6;
63
64
// discriminant
65
zz_pEX disc;
66
67
// contribution to sign of functional equation
68
int epsilon;
69
70
// calculates Kodaira type about pi
71
void kodaira(const zz_pEX& pi);
72
};
73
74
public:
75
long ref_count; // for garbage collection
76
long q;
77
78
// true if and only if curve is constant
79
// - false if isotrivial but not constant
80
bool constant_f;
81
82
ell_surfaceInfoT(const zz_pEratX& a4, const zz_pEratX& a6);
83
84
~ell_surfaceInfoT();
85
86
affine_model finite_model, infinite_model;
87
int sign, deg_L;
88
89
zz_pEX finite_A();
90
int infinite_A();
91
92
zz_pEX finite_M();
93
int infinite_M();
94
};
95
96
typedef ell_surfaceInfoT *ell_surfaceInfoPtr;
97
98
extern ell_surfaceInfoPtr ell_surfaceInfo;
99
100
class ell_surfaceContext {
101
private:
102
ell_surfaceInfoT *ptr;
103
104
public:
105
void save();
106
void restore() const;
107
108
ell_surfaceContext() { ptr = NULL; }
109
ell_surfaceContext(const zz_pEratX& a4, const zz_pEratX& a6);
110
111
ell_surfaceContext(const ell_surfaceContext&);
112
113
ell_surfaceContext& operator=(const ell_surfaceContext&);
114
115
~ell_surfaceContext();
116
};
117
118
class ell_surface {
119
private:
120
121
public:
122
// set curve to E/F_q : y^2 = x^3 + a4*x + a6
123
static void init(const zz_pEX& a4, const zz_pEX& a6);
124
static void init(const zz_pEratX& a4, const zz_pEratX& a6);
125
static void init(const zz_pEratX& a1, const zz_pEratX& a2,
126
const zz_pEratX& a3, const zz_pEratX& a4,
127
const zz_pEratX& a5);
128
129
static ell_surfaceInfoPtr getSurfaceInfo() { return ell_surfaceInfo; }
130
};
131
132
void get_an(ZZ_pEX& a4, ZZ_pEX& a6);
133
void get_j_invariant(ZZ_pEX& j_num, ZZ_pEX& j_den);
134
135
void get_reduction(ZZ_pEX **divisors, int finite);
136
void get_disc(ZZ_pEX& disc, int finite);
137
138
#endif // ELL_SURFACE_H
139
140
141