1 // mlocsol.h: declaration of functions for local solubility of quartics
2 //////////////////////////////////////////////////////////////////////////
3 //
4 // Copyright 1990-2012 John Cremona
5 //
6 // This file is part of the eclib package.
7 //
8 // eclib is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General Public License as published by the
10 // Free Software Foundation; either version 2 of the License, or (at your
11 // option) any later version.
12 //
13 // eclib is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 // for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with eclib; if not, write to the Free Software Foundation,
20 // Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #if     !defined(_ECLIB_MLOCSOL_H)
25 #define _ECLIB_MLOCSOL_H      1       //flags that this file has been included
26 
27 #include "mquartic.h"
28 
29 // Checks for solublility in Qp:
30 
31 int qpsoluble(const quartic& g, const bigint& p);
32 int qpsoluble(const bigint& a, const bigint& b, const bigint& c, const bigint& d,
33 	      const bigint& e, const bigint& p);
34 int qpsoluble(const bigint& a, const bigint& c, const bigint& e, const bigint& p);
35 // latter assumes b=d=0
36 
37 int Rsoluble(const quartic& g);
38 int Rsoluble(const bigint& a, const bigint& b, const bigint& c, const bigint& d,
39 	      const bigint& e);
40 
41 
42 // Checks for local solubility in Qp for all p in plist;
43 //if not, badp will hold the first p for which NOT soluble in Qp:
44 
45 int locallysoluble(const quartic& g, const vector<bigint>& plist, bigint& badp);
46 int locallysoluble(const bigint& a, const bigint& b, const bigint& c, const bigint& d,
47 	      const bigint& e, const vector<bigint>& plist, bigint& badp);
48 int locallysoluble(const bigint& a, const bigint& c, const bigint& e,
49 		   const vector<bigint>& plist, bigint& badp);
50 // latter assumes b=d=0
51 
52 
53 /* Samir Siksek's Local Solubility Test for odd p */
54 
55 int local_sol(const bigint& p,bigint *c, int verbose=0);
56 
57  // Checks for solublility in Qp
58 int new_qpsoluble(const quartic& g, const bigint& p, int verbose=0);
59 int new_qpsoluble(const bigint& a, const bigint& b, const bigint& c,
60 		  const bigint& d, const bigint& e,
61 		  const bigint& p, int verbose=0);
62 int new_qpsoluble(const bigint& a, const bigint& c, const bigint& e,
63 		  const bigint& p, int verbose=0);
64 
65 int new_zpsol(const bigint& a,const bigint& b,const bigint& c,const bigint& d,
66 	      const bigint& e, const bigint& p, int verbose=0);
67 
68 #endif
69