/*********************************************************************12(c) Copyright 2006-2010 Salman Baig and Chris Hall34This file is part of ELLFF56ELLFF is free software: you can redistribute it and/or modify7it under the terms of the GNU General Public License as published by8the Free Software Foundation, either version 3 of the License, or9(at your option) any later version.1011ELLFF is distributed in the hope that it will be useful,12but WITHOUT ANY WARRANTY; without even the implied warranty of13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14GNU General Public License for more details.1516You should have received a copy of the GNU General Public License17along with this program. If not, see <http://www.gnu.org/licenses/>.1819*********************************************************************/2021#ifndef ELL_SURFACE_H22#define ELL_SURFACE_H2324#include "helper.h"25#include "lzz_pEratX.h"2627// meant for elliptic surfaces in char != 2,32829class ell_surfaceInfoT {30public:31class affine_model {32public:33// divisors for additive reduction34zz_pEX A, I_star, II, II_star, III, III_star, IV, IV_star;3536// divisors for multiplicative reduction37zz_pEX M_sp, M_ns;3839// true if and only if curve is constant40// - false if isotrivial but not constant41bool constant_f;4243private:44void init();4546// cardinality of scalar field47long q;4849void minimize();5051public:52affine_model();5354void init(const zz_pEratX& a4, const zz_pEratX& a6);55void init(const zz_pEX& a4, const zz_pEX& a6);5657// j-invariant58zz_pEratX j;5960// coefficients61zz_pEX a4, a6;6263// discriminant64zz_pEX disc;6566// contribution to sign of functional equation67int epsilon;6869// calculates Kodaira type about pi70void kodaira(const zz_pEX& pi);71};7273public:74long ref_count; // for garbage collection75long q;7677// true if and only if curve is constant78// - false if isotrivial but not constant79bool constant_f;8081ell_surfaceInfoT(const zz_pEratX& a4, const zz_pEratX& a6);8283~ell_surfaceInfoT();8485affine_model finite_model, infinite_model;86int sign, deg_L;8788zz_pEX finite_A();89int infinite_A();9091zz_pEX finite_M();92int infinite_M();93};9495typedef ell_surfaceInfoT *ell_surfaceInfoPtr;9697extern ell_surfaceInfoPtr ell_surfaceInfo;9899class ell_surfaceContext {100private:101ell_surfaceInfoT *ptr;102103public:104void save();105void restore() const;106107ell_surfaceContext() { ptr = NULL; }108ell_surfaceContext(const zz_pEratX& a4, const zz_pEratX& a6);109110ell_surfaceContext(const ell_surfaceContext&);111112ell_surfaceContext& operator=(const ell_surfaceContext&);113114~ell_surfaceContext();115};116117class ell_surface {118private:119120public:121// set curve to E/F_q : y^2 = x^3 + a4*x + a6122static void init(const zz_pEX& a4, const zz_pEX& a6);123static void init(const zz_pEratX& a4, const zz_pEratX& a6);124static void init(const zz_pEratX& a1, const zz_pEratX& a2,125const zz_pEratX& a3, const zz_pEratX& a4,126const zz_pEratX& a5);127128static ell_surfaceInfoPtr getSurfaceInfo() { return ell_surfaceInfo; }129};130131void get_an(ZZ_pEX& a4, ZZ_pEX& a6);132void get_j_invariant(ZZ_pEX& j_num, ZZ_pEX& j_den);133134void get_reduction(ZZ_pEX **divisors, int finite);135void get_disc(ZZ_pEX& disc, int finite);136137#endif // ELL_SURFACE_H138139140141