Code coverage tests

This page documents the degree to which the PARI/GP source code is tested by our public test suite, distributed with the source distribution in directory src/test/. This is measured by the gcov utility; we then process gcov output using the lcov frond-end.

We test a few variants depending on Configure flags on the pari.math.u-bordeaux.fr machine (x86_64 architecture), and agregate them in the final report:

The target is to exceed 90% coverage for all mathematical modules (given that branches depending on DEBUGLEVEL or DEBUGMEM are not covered). This script is run to produce the results below.

LCOV - code coverage report
Current view: top level - headers - paripriv.h (source / functions) Hit Total Coverage
Test: PARI/GP v2.14.0 lcov report (development 27377-eea28b22aa) Lines: 7 7 100.0 %
Date: 2022-01-28 08:19:09 Functions: 5 5 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* Copyright (C) 2004  The PARI group.
       2             : 
       3             : This file is part of the PARI/GP package.
       4             : 
       5             : PARI/GP is free software; you can redistribute it and/or modify it under the
       6             : terms of the GNU General Public License as published by the Free Software
       7             : Foundation; either version 2 of the License, or (at your option) any later
       8             : version. It is distributed in the hope that it will be useful, but WITHOUT
       9             : ANY WARRANTY WHATSOEVER.
      10             : 
      11             : Check the License for details. You should have received a copy of it, along
      12             : with the package; see the file 'COPYING'. If not, write to the Free Software
      13             : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
      14             : 
      15             : BEGINEXTERN
      16             : 
      17             : /* for qsort */
      18             : typedef int (*QSCOMP)(const void *, const void *);
      19             : 
      20             : #define uel(a,i)            (((ulong*)(a))[i])
      21             : #define ucoeff(a,i,j)       (((ulong**)(a))[j][i])
      22             : #define umael(a,i,j)        (((ulong**)(a))[i][j])
      23             : #define umael2(a,i,j)       (((ulong**)(a))[i][j])
      24             : #define umael3(a,i,j,k)     (((ulong***)(a))[i][j][k])
      25             : #define umael4(a,i,j,k,l)   (((ulong****)(a))[i][j][k][l])
      26             : #define umael5(a,i,j,k,l,m) (((ulong*****)(a))[i][j][k][l][m])
      27             : 
      28             : #define numberof(x) (sizeof(x) / sizeof((x)[0]))
      29             : 
      30             : /* to manipulate 'blocs' */
      31             : #define BL_HEAD 8
      32             : #define bl_base(x) (void*)((x) - BL_HEAD)
      33             : #define bl_height(x) (((GEN)x)[-8])
      34             : #define bl_left(x)   (((GEN*)x)[-7])
      35             : #define bl_right(x)  (((GEN*)x)[-6])
      36             : #define bl_size(x)   (((GEN)x)[-5])
      37             : #define bl_refc(x)   (((GEN)x)[-4])
      38             : #define bl_next(x)   (((GEN*)x)[-3])
      39             : #define bl_prev(x)   (((GEN*)x)[-2])
      40             : #define bl_num(x)    (((GEN)x)[-1])
      41             : 
      42             : void clone_lock(GEN C);
      43             : void clone_unlock(GEN C);
      44             : void clone_unlock_deep(GEN C);
      45             : 
      46             : /* swap */
      47             : #define lswap(x,y) {long _z=x; x=y; y=_z;}
      48             : #define pswap(x,y) {GEN *_z=x; x=y; y=_z;}
      49             : #define swap(x,y)  {GEN  _z=x; x=y; y=_z;}
      50             : #define dswap(x,y) { double _t=x; x=y; y=_t; }
      51             : #define pdswap(x,y) { double* _t=x; x=y; y=_t; }
      52             : #define swapspec(x,y, nx,ny) {swap(x,y); lswap(nx,ny);}
      53             : 
      54             : /* loops */
      55             : GEN incloop(GEN a);
      56             : GEN resetloop(GEN a, GEN b);
      57             : GEN setloop(GEN a);
      58             : 
      59             : /* parser */
      60             : 
      61             : /* GP control structures */
      62             : #define EXPR_WRAP(code, call) \
      63             : { GEN z; GEN __E = code; \
      64             :   push_lex(gen_0, __E); z = call; pop_lex(1); return z; }
      65             : #define EXPRVOID_WRAP(code, call) \
      66             : { GEN __E = code; \
      67             :   push_lex(gen_0, __E); call; pop_lex(1); }
      68             : #define EXPR_ARG __E, &gp_eval
      69             : #define EXPR_ARGPREC __E, &gp_evalprec
      70             : #define EXPR_ARGUPTO __E, &gp_evalupto
      71             : #define EXPR_ARGBOOL __E, &gp_evalbool
      72             : #define EXPR_ARGVOID __E, &gp_evalvoid
      73             : 
      74             : GEN  dirpowerssum0(GEN N, GEN s, GEN f, long prec);
      75             : GEN  iferrpari(GEN a, GEN b, GEN c);
      76             : void forfactored(GEN a, GEN b, GEN code);
      77             : void forpari(GEN a, GEN b, GEN node);
      78             : void foreachpari(GEN a, GEN node);
      79             : void forsquarefree(GEN a, GEN b, GEN code);
      80             : void untilpari(GEN a, GEN b);
      81             : void whilepari(GEN a, GEN b);
      82             : GEN  ifpari(GEN g, GEN a, GEN b);
      83             : GEN  andpari(GEN a, GEN b);
      84             : GEN  orpari(GEN a, GEN b);
      85             : void ifpari_void(GEN g, GEN a, GEN b);
      86             : GEN  ifpari_multi(GEN g, GEN a);
      87             : GEN  geval_gp(GEN x, GEN t);
      88             : 
      89             : GEN  gadde(GEN *x, GEN y);
      90             : GEN  gadd1e(GEN *x);
      91             : GEN  gdive(GEN *x, GEN y);
      92             : GEN  gdivente(GEN *x, GEN y);
      93             : GEN  gdivrounde(GEN *x, GEN y);
      94             : GEN  gmode(GEN *x, GEN y);
      95             : GEN  gmule(GEN *x, GEN y);
      96             : GEN  gshiftle(GEN *x, long n);
      97             : GEN  gshiftre(GEN *x, long n);
      98             : GEN  gsube(GEN *x, GEN y);
      99             : GEN  gsub1e(GEN *x);
     100             : GEN  gshift_right(GEN x, long n);
     101             : 
     102             : GEN  asympnum0(GEN u, GEN alpha, long prec);
     103             : GEN  asympnumraw0(GEN u, long LIM, GEN alpha, long prec);
     104             : GEN  derivnum0(GEN a, GEN code, GEN ind, long prec);
     105             : GEN  derivfun0(GEN args, GEN def, GEN code, long k, long prec);
     106             : GEN  direuler0(GEN a, GEN b, GEN code, GEN c);
     107             : GEN  direuler_bad(void *E, GEN (*eval)(void *, GEN, long), GEN a, GEN b, GEN c, GEN Sbad);
     108             : void forcomposite(GEN a, GEN b, GEN code);
     109             : void fordiv(GEN a, GEN code);
     110             : void fordivfactored(GEN a, GEN code);
     111             : void forell0(long a, long b, GEN code, long flag);
     112             : void forperm0(GEN k, GEN code);
     113             : void forprime(GEN a, GEN b, GEN code);
     114             : void forprimestep(GEN a, GEN b, GEN q, GEN code);
     115             : void forstep(GEN a, GEN b, GEN s, GEN code);
     116             : void forsubgroup0(GEN cyc, GEN bound, GEN code);
     117             : void forsubset0(GEN nk, GEN code);
     118             : void forvec(GEN x, GEN code, long flag);
     119             : void forpart0(GEN k, GEN code , GEN nbound, GEN abound);
     120             : GEN  intcirc0(GEN a, GEN R, GEN code, GEN tab, long prec);
     121             : GEN  intfuncinit0(GEN a, GEN b, GEN code, long m, long prec);
     122             : GEN  intnum0(GEN a, GEN b, GEN code, GEN tab, long prec);
     123             : GEN  intnumgauss0(GEN a, GEN b, GEN code, GEN tab, long prec);
     124             : GEN  intnumosc0(GEN a, GEN H, GEN code, long flag, GEN tab, long prec);
     125             : GEN  intnumromb0_bitprec(GEN a, GEN b, GEN code, long flag, long bit);
     126             : GEN  laurentseries0(GEN f, long M, long v, long prec);
     127             : GEN  limitnum0(GEN u, GEN alpha, long prec);
     128             : GEN  matrice(GEN nlig, GEN ncol, GEN code);
     129             : void pariplot0(GEN a, GEN b, GEN code, GEN ysmlu, GEN ybigu, long prec);
     130             : GEN  prodeuler0(GEN a, GEN b, GEN code, long prec);
     131             : GEN  prodinf0(GEN a, GEN code, long flag, long prec);
     132             : GEN  produit(GEN a, GEN b, GEN code, GEN x);
     133             : GEN  somme(GEN a, GEN b, GEN code, GEN x);
     134             : GEN  sumalt0(GEN a, GEN code,long flag, long prec);
     135             : GEN  sumdivexpr(GEN num, GEN code);
     136             : GEN  sumdivmultexpr0(GEN num, GEN code);
     137             : GEN  suminf0_bitprec(GEN a, GEN code, long bit);
     138             : GEN  sumnum0(GEN a, GEN code, GEN tab, long prec);
     139             : GEN  sumnumap0(GEN a, GEN code, GEN tab, long prec);
     140             : GEN  sumnumlagrange0(GEN a, GEN code, GEN tab, long prec);
     141             : GEN  sumnummonien0(GEN a, GEN code, GEN tab, long prec);
     142             : GEN  sumpos0(GEN a, GEN code, long flag,long prec);
     143             : GEN  vecexpr0(GEN nmax, GEN code, GEN pred);
     144             : GEN  vecexpr1(GEN nmax, GEN code, GEN pred);
     145             : GEN  vecteursmall(GEN nmax, GEN code);
     146             : GEN  vecteur(GEN nmax, GEN n);
     147             : GEN  vvecteur(GEN nmax, GEN n);
     148             : GEN  zbrent0(GEN a, GEN b, GEN code, long prec);
     149             : GEN  solvestep0(GEN a, GEN b, GEN step, GEN code, long flag, long prec);
     150             : 
     151             : GEN  ploth0(GEN a, GEN b, GEN code, long flag, long n, long prec);
     152             : GEN  plothexport0(GEN fmt, GEN a, GEN b, GEN code, long flags, long n, long prec);
     153             : GEN  psploth0(GEN a,GEN b,GEN code,long flag,long n,long prec);
     154             : GEN  plotrecth0(long ne,GEN a,GEN b,GEN code,ulong flags,long n,long prec);
     155             : 
     156             : GEN  listcreate_gp(long n);
     157             : 
     158             : /* mt */
     159             : void mt_sigint(void);
     160             : void mt_err_recover(long er);
     161             : void mt_export_add(const char *str, GEN val);
     162             : void mt_export_del(const char *str);
     163             : void mt_init_stack(size_t s);
     164             : int  mt_is_thread(void);
     165             : 
     166             : GEN  eisker_worker(GEN Ei, GEN M, GEN D, GEN co, GEN CD);
     167             : GEN  pareval_worker(GEN code);
     168             : GEN  parselect_worker(GEN d, GEN code);
     169             : void parfor0(GEN a, GEN b, GEN code, GEN code2);
     170             : GEN  parfor_worker(GEN i, GEN C);
     171             : void parforeach0(GEN x, GEN code, GEN code2);
     172             : void parforprime0(GEN a, GEN b, GEN code, GEN code2);
     173             : void parforprimestep0(GEN a, GEN b, GEN q, GEN code, GEN code2);
     174             : void parforvec0(GEN a, GEN code, GEN code2, long flag);
     175             : GEN  parvector_worker(GEN i, GEN C);
     176             : GEN  polmodular_worker(GEN pt, ulong L, GEN hilb, GEN factu,
     177             :        GEN vne, GEN vinfo, long compute_derivs, GEN j_powers, GEN fdb);
     178             : GEN  nf_L2_bound(GEN nf, GEN den, GEN *pL);
     179             : GEN  nmV_polint_center_tree_worker(GEN Va, GEN T, GEN R, GEN xa, GEN m2);
     180             : GEN  nmV_chinese_center_tree_seq(GEN A, GEN P, GEN T, GEN R);
     181             : GEN  nxMV_polint_center_tree_worker(GEN Va, GEN T, GEN R, GEN xa, GEN m2);
     182             : GEN  nxMV_chinese_center_tree_seq(GEN A, GEN P, GEN T, GEN R);
     183             : GEN  F2xq_log_Coppersmith_worker(GEN u, long i, GEN V, GEN R);
     184             : GEN  Flxq_log_Coppersmith_worker(GEN u, long i, GEN V, GEN R);
     185             : GEN  Fp_log_sieve_worker(long a, long prmax, GEN C, GEN c, GEN Ci, GEN ci, GEN pr, GEN sz);
     186             : GEN  QM_charpoly_ZX_worker(GEN P, GEN M, GEN dM);
     187             : GEN  QXQ_div_worker(GEN P, GEN A, GEN B, GEN C);
     188             : GEN  QXQ_inv_worker(GEN P, GEN A, GEN B);
     189             : GEN  ZX_resultant_worker(GEN P, GEN A, GEN B, GEN dB);
     190             : GEN  ZXQX_resultant_worker(GEN P, GEN A, GEN B, GEN T, GEN dB);
     191             : GEN  ZX_ZXY_resultant_worker(GEN P, GEN A, GEN B, GEN dB, GEN v);
     192             : GEN  ZX_direct_compositum_worker(GEN P, GEN A, GEN B);
     193             : GEN  ZXQX_direct_compositum_worker(GEN P, GEN A, GEN B, GEN C);
     194             : GEN  ZX_gcd_worker(GEN P, GEN A, GEN B, GEN g);
     195             : GEN  ZXQ_minpoly_worker(GEN P, GEN A, GEN B, long d);
     196             : GEN  ZM_det_worker(GEN P, GEN A);
     197             : GEN  ZM_inv_worker(GEN P, GEN A);
     198             : GEN  ZM_ker_worker(GEN P, GEN A);
     199             : GEN  ZM_mul_worker(GEN P, GEN A, GEN B);
     200             : GEN  ZabM_inv_worker(GEN P, GEN A, GEN Q);
     201             : GEN  aprcl_step4_worker(ulong q, GEN pC, GEN N, GEN v);
     202             : GEN  aprcl_step6_worker(GEN r, long t, GEN N, GEN N1, GEN et);
     203             : GEN  ecpp_sqrt_worker(GEN g, GEN N, GEN p);
     204             : GEN  ecpp_ispsp_worker(GEN N);
     205             : GEN  ecpp_step2_worker(GEN S, GEN HD, GEN primelist, long dbg);
     206             : GEN  primecertisvalid_ecpp_worker(GEN certi);
     207             : GEN  lfuninit_worker(long r, GEN K, GEN L, GEN peh2d, GEN vroots, GEN dr, GEN di, GEN an, GEN bn);
     208             : GEN  lfuninit_theta2_worker(long r, GEN L, GEN qk, GEN a, GEN di, GEN an, GEN bn);
     209             : GEN  gen_parapply(GEN worker, GEN D);
     210             : GEN  parapply_slice_worker(GEN worker, GEN D);
     211             : GEN  gen_parapply_slice(GEN worker, GEN D, long mmin);
     212             : GEN  gen_crt(const char *str, GEN worker, forprime_t *S, GEN dB, ulong bound, long mmin, GEN *pt_mod,
     213             :              GEN crt(GEN, GEN, GEN*), GEN center(GEN, GEN, GEN));
     214             : void gen_inccrt(const char *str, GEN worker, GEN dB, long n, long mmin,
     215             :            forprime_t *S, GEN *pt_H, GEN *pt_mod, GEN crt(GEN, GEN, GEN*),
     216             :            GEN center(GEN, GEN, GEN));
     217             : void gen_inccrt_i(const char *str, GEN worker, GEN dB, long n, long mmin,
     218             :            forprime_t *S, GEN *pH, GEN *pmod, GEN crt(GEN, GEN, GEN*),
     219             :            GEN center(GEN, GEN, GEN));
     220             : GEN  direllnf_worker(GEN P, ulong X, GEN E);
     221             : GEN  dirartin_worker(GEN P, ulong X, GEN nf, GEN G, GEN V, GEN aut);
     222             : GEN  direllsympow_worker(GEN P, ulong X, GEN E, ulong m);
     223             : GEN  dirgenus2_worker(GEN P, ulong X, GEN Q);
     224             : GEN  dirhgm_worker(GEN P, ulong X, GEN hgm, GEN t);
     225             : GEN  pardireuler(GEN worker, GEN a, GEN b, GEN c, GEN Sbad);
     226             : GEN  FpM_ratlift_worker(GEN A, GEN mod, GEN B);
     227             : GEN  ellQ_factorback_worker(GEN P, GEN E, GEN A, GEN L, ulong l);
     228             : GEN  chinese_unit_worker(GEN P, GEN A, GEN U, GEN B, GEN D, GEN C);
     229             : GEN  partmap_reverse_frac_worker(GEN t, GEN a, GEN b, GEN la, GEN lb, long v);
     230             : 
     231             : /* Relative number fields */
     232             : enum { rnf_NFABS = 1, rnf_MAPS };
     233             : 
     234             : /* Finite fields */
     235             : enum { t_FF_FpXQ = 0, t_FF_Flxq = 1, t_FF_F2xq = 2 };
     236             : GEN FF_ellinit(GEN E, GEN fg);
     237             : GEN FF_elldata(GEN E, GEN fg);
     238             : 
     239             : /* L functions */
     240             : enum { t_LFUN_GENERIC, t_LFUN_ZETA, t_LFUN_NF, t_LFUN_ELL, t_LFUN_KRONECKER,
     241             :        t_LFUN_CHIZ, t_LFUN_CHIGEN, t_LFUN_ETA,
     242             :        t_LFUN_DIV, t_LFUN_MUL, t_LFUN_CONJ,
     243             :        t_LFUN_SYMPOW_ELL, t_LFUN_QF, t_LFUN_ARTIN, t_LFUN_MFCLOS,
     244             :        t_LFUN_GENUS2, t_LFUN_TWIST, t_LFUN_CLOSURE0, t_LFUN_SHIFT,
     245             :        t_LFUN_HGM, t_LFUN_HECKE};
     246             : enum { t_LDESC_INIT, t_LDESC_THETA, t_LDESC_PRODUCT };
     247             : 
     248             : /* Elliptic curves */
     249             : /* common to Q and Rg */
     250             : enum { R_PERIODS = 1, R_ETA, R_ROOTS, R_AB };
     251             : 
     252             : enum { Qp_ROOT = 1, Qp_TATE };
     253             : enum { Q_GROUPGEN = 5, Q_GLOBALRED, Q_ROOTNO, Q_MINIMALMODEL };
     254             : enum { NF_MINIMALMODEL = 1, NF_GLOBALRED, NF_MINIMALPRIMES, NF_ROOTNO, NF_NF };
     255             : 
     256             : /* common to Fp and Fq */
     257             : enum { FF_CARD = 1, FF_GROUP, FF_GROUPGEN, FF_O };
     258             : 
     259             : /* for Buchall_param */
     260             : enum { fupb_NONE = 0, fupb_RELAT, fupb_LARGE, fupb_PRECI };
     261             : 
     262             : /* Polycyclic presentation for the classgroup of discriminant D */
     263             : typedef struct {
     264             :   long D; /* Negative discriminant */
     265             :   long D0; /* Attached fundamental discriminant */
     266             :   long u; /* Conductor of D = D0 u^2 */
     267             :   long h; /* Size of classgroup */
     268             :   long enum_cnt; /* Either h or h/2 (if L0 is set) */
     269             :   /* If nonzero, L0=L[0] and n[0]=2 and classpoly is a perfect square
     270             :    * (and we enumerate each double root just once), default is 0 */
     271             :   long L0;
     272             :   /* Product of primes L that are prohibited as norms of generators or
     273             :    * auxilliary prime forms (by default, primes that make enumeration hard) */
     274             :   long Lfilter;
     275             :   /* Norms of implicit generators (primeforms a=(L*x^2+b*x*y+c*y^2)
     276             :    * with norm L and b >=0) */
     277             :   long *L;
     278             :   long *m; /* products of relative orders: m[i] is the order of <g_1,...,g_i> */
     279             :   long *n; /* Relative orders */
     280             :   long *o; /* Absolute orders */
     281             :   /* Power relations (a[i]^n[i] = a[0]^e[0]*...*a[i-1]^e[i-1], where e
     282             :    * is an exponent vector of length i stored at offset binom(i,2) of r) */
     283             :   long *r;
     284             :   long *orient_p; /* Optional list of norms of orienting primes p ... */
     285             :   long *orient_q; /* or product of primes p*q (q=1 when only p is needed) */
     286             :   long *orient_reps; /* Representation of orienting norm p*q in terms of Ls */
     287             :   long inv; /* Attached invariant */
     288             :   long k; /* Number of generators */
     289             :   GEN _data; /* Storage space for the above arrays */
     290             : } classgp_pcp_struct;
     291             : typedef classgp_pcp_struct classgp_pcp_t[1];
     292             : 
     293             : /* Represents the data in the equation(s)
     294             :  *   4p = t^2 - v^2 D = t^2 - v^2 u^2 D_K = w^2 D_K.
     295             :  * t is the absolute trace, so always > 0.
     296             :  * T is a twisting parameter, which satisfies (T|p) == -1. */
     297             : typedef struct {
     298             :   GEN faw; /* factor(u*v) */
     299             :   long D, t, u, v;
     300             :   ulong p, pi, s2, T;
     301             : } norm_eqn_struct;
     302             : typedef norm_eqn_struct norm_eqn_t[1];
     303             : 
     304             : #define zv_to_longptr(v) (&((v)[1]))
     305             : #define zv_to_ulongptr(v) ((ulong *)&((v)[1]))
     306             : 
     307             : /* Modular invariants */
     308             : #define INV_J       0
     309             : #define INV_F       1
     310             : #define INV_F2      2
     311             : #define INV_F3      3
     312             : #define INV_F4      4
     313             : #define INV_G2      5
     314             : #define INV_W2W3    6
     315             : #define INV_F8      8
     316             : #define INV_W3W3    9
     317             : #define INV_W2W5    10
     318             : #define INV_W2W7    14
     319             : #define INV_W3W5    15
     320             : #define INV_W3W7    21
     321             : #define INV_W2W3E2  23
     322             : #define INV_W2W5E2  24
     323             : #define INV_W2W13   26
     324             : #define INV_W2W7E2  27
     325             : #define INV_W3W3E2  28
     326             : #define INV_W5W7    35
     327             : #define INV_W3W13   39
     328             : 
     329             : /* Get coefficient of x^d in f, assuming f is nonzero. */
     330    15744362 : INLINE ulong Flx_coeff(GEN f, long d) { return f[d + 2]; }
     331             : /* Return the root of f, assuming deg(f) = 1. */
     332      235057 : INLINE ulong Flx_deg1_root(GEN f, ulong p) {
     333      235057 :   if (degpol(f) != 1) pari_err_BUG("Flx_deg1_root");
     334      235057 :   return Fl_div(Fl_neg(Flx_coeff(f, 0), p), Flx_coeff(f, 1), p);
     335             : }
     336             : 
     337             : /* Allocation / gerepile */
     338             : long   getdebugvar(void);
     339             : void   setdebugvar(long n);
     340             : void   debug_stack(void);
     341             : void   fill_stack(void);
     342             : void   minim_alloc(long n, double ***q, GEN *x, double **y,  double **z, double **v);
     343             : int    pop_entree_block(entree *ep, long loc);
     344             : int    pop_val_if_newer(entree *ep, long loc);
     345             : 
     346             : /* general printing */
     347             : void print_errcontext(PariOUT *out, const char *msg, const char *s, const char *entry);
     348             : void print_prefixed_text(PariOUT *out, const char *s, const char *prefix, const char *str);
     349             : INLINE void
     350          76 : print_text(const char *s) { print_prefixed_text(pariOut, s,NULL,NULL); }
     351             : INLINE void
     352        5327 : out_print_text(PariOUT *out, const char *s) { print_prefixed_text(out, s,NULL,NULL); }
     353             : INLINE long
     354    39493988 : is_keyword_char(char c) { return (isalnum((int)c) || c=='_'); }
     355             : 
     356             : /* Interfaces (GP, etc.) */
     357             : hashtable *hash_from_link(GEN e, GEN names, int use_stack);
     358             : void gen_relink(GEN x, hashtable *table);
     359             : entree* do_alias(entree *ep);
     360             : char* get_sep(const char *t);
     361             : long get_int(const char *s, long dflt);
     362             : ulong get_uint(const char *s);
     363             : void gp_initrc(pari_stack *p_A);
     364             : 
     365             : void pari_sigint(const char *s);
     366             : void* get_stack(double fraction, long min);
     367             : void  free_graph(void);
     368             : void  initout(int initerr);
     369             : void  resetout(int initerr);
     370             : void  init_linewrap(long w);
     371             : void  print_functions_hash(const char *s);
     372             : GEN   readbin(const char *name, FILE *f, int *vector);
     373             : int   term_height(void);
     374             : int   term_width(void);
     375             : /* gp_colors */
     376             : void decode_color(long n, long *c);
     377             : 
     378             : /* defaults */
     379             : extern long precreal;
     380             : 
     381             : void lim_lines_output(char *s, long n, long max);
     382             : int tex2mail_output(GEN z, long n);
     383             : void gen_output(GEN x);
     384             : void fputGEN_pariout(GEN x, pariout_t *T, FILE *out);
     385             : 
     386             : void parsestate_reset(void);
     387             : void parsestate_save(struct pari_parsestate *state);
     388             : void parsestate_restore(struct pari_parsestate *state);
     389             : 
     390             : void compilestate_reset(void);
     391             : void compilestate_save(struct pari_compilestate *comp);
     392             : void compilestate_restore(struct pari_compilestate *comp);
     393             : 
     394             : void filestate_save(struct pari_filestate *file);
     395             : void filestate_restore(struct pari_filestate *file);
     396             : void tmp_restore(pariFILE *F);
     397             : 
     398             : long evalstate_get_trace(void);
     399             : void evalstate_set_trace(long lvl);
     400             : void evalstate_clone(void);
     401             : void evalstate_reset(void);
     402             : void evalstate_restore(struct pari_evalstate *state);
     403             : GEN  evalstate_restore_err(struct pari_evalstate *state);
     404             : void evalstate_save(struct pari_evalstate *state);
     405             : void varstate_save(struct pari_varstate *s);
     406             : void varstate_restore(struct pari_varstate *s);
     407             : 
     408             : void mtstate_save(struct pari_mtstate *s);
     409             : void mtstate_reset(void);
     410             : void mtstate_restore(struct pari_mtstate *s);
     411             : 
     412             : void debug_context(void);
     413             : 
     414             : typedef struct {
     415             :   const char *s;
     416             :   size_t ls;
     417             :   char **dir;
     418             : } forpath_t;
     419             : void forpath_init(forpath_t *T, gp_path *path, const char *s);
     420             : char *forpath_next(forpath_t *T);
     421             : 
     422             : /* GP output && output format */
     423             : void gpwritebin(const char *s, GEN x);
     424             : extern char *current_logfile;
     425             : 
     426             : /* colors */
     427             : extern long    gp_colors[];
     428             : extern int     disable_color;
     429             : 
     430             : /* entrees */
     431             : #define EpVALENCE(ep) ((ep)->valence & 0xFF)
     432             : #define EpSTATIC(ep) ((ep)->valence & 0x100)
     433             : #define EpSETSTATIC(ep) ((ep)->valence |= 0x100)
     434             : enum { EpNEW = 100, EpALIAS, EpVAR, EpINSTALL };
     435             : #define initial_value(ep) ((ep)+1)
     436             : 
     437             : /* functions lists */
     438             : extern const long functions_tblsz;  /* hashcodes table size */
     439             : extern entree **functions_hash;   /* functions hashtable */
     440             : extern entree **defaults_hash;    /* defaults hashtable */
     441             : 
     442             : /* buffers */
     443             : typedef struct Buffer {
     444             :   char *buf;
     445             :   ulong len;
     446             :   jmp_buf env;
     447             : } Buffer;
     448             : Buffer *new_buffer(void);
     449             : void delete_buffer(Buffer *b);
     450             : void fix_buffer(Buffer *b, long newlbuf);
     451             : 
     452             : typedef struct {
     453             :   const char *s; /* source */
     454             :   char *t, *end; /* target, last char read */
     455             :   int in_string, in_comment, more_input, wait_for_brace;
     456             :   Buffer *buf;
     457             : } filtre_t;
     458             : void init_filtre(filtre_t *F, Buffer *buf);
     459             : Buffer *filtered_buffer(filtre_t *F);
     460             : void kill_buffers_upto_including(Buffer *B);
     461             : void pop_buffer(void);
     462             : void kill_buffers_upto(Buffer *B);
     463             : int gp_read_line(filtre_t *F, const char *PROMPT);
     464             : void parse_key_val(char *src, char **ps, char **pt);
     465             : extern int (*cb_pari_get_line_interactive)(const char*, const char*, filtre_t *F);
     466             : extern char *(*cb_pari_fgets_interactive)(char *s, int n, FILE *f);
     467             : int get_line_from_file(const char *prompt, filtre_t *F, FILE *file);
     468             : void pari_skip_space(char **s);
     469             : void pari_skip_alpha(char **s);
     470             : char *pari_translate_string(const char *src, char *s, char *entry);
     471             : 
     472             : gp_data *default_gp_data(void);
     473             : 
     474             : typedef char *(*fgets_t)(char *, int, void*);
     475             : 
     476             : typedef struct input_method {
     477             : /* optional */
     478             :   fgets_t myfgets;  /* like libc fgets() but last argument is (void*) */
     479             : /* mandatory */
     480             :   char * (*getline)(char**, int f, struct input_method*, filtre_t *F);
     481             :   int free; /* boolean: must we free the output of getline() ? */
     482             : /* optional */
     483             :   const char *prompt, *prompt_cont;
     484             :   void *file;  /* can be used as last argument for fgets() */
     485             : } input_method;
     486             : 
     487             : int input_loop(filtre_t *F, input_method *IM);
     488             : char *file_input(char **s0, int junk, input_method *IM, filtre_t *F);
     489             : char *file_getline(Buffer *b, char **s0, input_method *IM);
     490             : 
     491             : /* readline */
     492             : typedef struct {
     493             :   /* pointers to readline variables/functions */
     494             :   char **line_buffer;
     495             :   int *point;
     496             :   int *end;
     497             :   char **(*completion_matches)(const char *, char *(*)(const char*, int));
     498             :   char *(*filename_completion_function)(const char *, int);
     499             :   char *(*username_completion_function)(const char *, int);
     500             :   int (*insert)(int, int);
     501             :   int *completion_append_character;
     502             : 
     503             :   /* PARI-specific */
     504             :   int back;  /* rewind the cursor by this number of chars */
     505             : } pari_rl_interface;
     506             : 
     507             : /* Code which wants to use readline needs to do the following:
     508             : 
     509             : #include <readline.h>
     510             : #include <paripriv.h>
     511             : pari_rl_interface pari_rl;
     512             : pari_use_readline(pari_rl);
     513             : 
     514             : This will initialize the pari_rl structure. A pointer to this structure
     515             : must be given as first argument to all PARI readline functions. */
     516             : 
     517             : /* IMPLEMENTATION NOTE: this really must be a macro (not a function),
     518             :  * since we refer to readline symbols. */
     519             : #define pari_use_readline(pari_rl) do {\
     520             :     (pari_rl).line_buffer = &rl_line_buffer; \
     521             :     (pari_rl).point = &rl_point; \
     522             :     (pari_rl).end = &rl_end; \
     523             :     (pari_rl).completion_matches = &rl_completion_matches; \
     524             :     (pari_rl).filename_completion_function = &rl_filename_completion_function; \
     525             :     (pari_rl).username_completion_function = &rl_username_completion_function; \
     526             :     (pari_rl).insert = &rl_insert; \
     527             :     (pari_rl).completion_append_character = &rl_completion_append_character; \
     528             :     (pari_rl).back = 0; } while(0)
     529             : 
     530             : /* FIXME: EXPORT AND DOCUMENT THE FOLLOWING */
     531             : 
     532             : /* PROBABLY NOT IN THE RIGHT FILE, SORT BY THEME */
     533             : 
     534             : /* multiprecision */
     535             : GEN   adduispec_offset(ulong s, GEN x, long offset, long nx);
     536             : int   lgcdii(ulong* d, ulong* d1, ulong* u, ulong* u1, ulong* v, ulong* v1, ulong vmax);
     537             : ulong rgcduu(ulong d, ulong d1, ulong vmax, ulong* u, ulong* u1, ulong* v, ulong* v1, long *s);
     538             : ulong xgcduu(ulong d, ulong d1, int f, ulong* v, ulong* v1, long *s);
     539             : ulong xxgcduu(ulong d, ulong d1, int f, ulong* u, ulong* u1, ulong* v, ulong* v1, long *s);
     540             : GEN   muliispec(GEN x, GEN y, long nx, long ny);
     541             : GEN   red_montgomery(GEN T, GEN N, ulong inv);
     542             : GEN   sqrispec(GEN x, long nx);
     543             : ulong *convi(GEN x, long *l);
     544             : 
     545             : /* powers */
     546             : GEN    rpowuu(ulong a, ulong n, long prec);
     547             : 
     548             : /* floats */
     549             : double dabs(double s, double t);
     550             : double darg(double s, double t);
     551             : void   dcxlog(double s, double t, double *a, double *b);
     552             : double dnorm(double s, double t);
     553             : double dbllog2(GEN z);
     554             : double dbllambertW0(double a);
     555             : double dbllambertW_1(double a);
     556             : 
     557             : /* hnf */
     558             : GEN hnfadd(GEN m,GEN p,GEN* ptdep,GEN* ptA,GEN* ptC,GEN extramat,GEN extraC);
     559             : GEN hnfadd_i(GEN m,GEN p,GEN* ptdep,GEN* ptA,GEN* ptC,GEN extramat,GEN extraC);
     560             : GEN hnfspec_i(GEN m,GEN p,GEN* ptdep,GEN* ptA,GEN* ptC,long k0);
     561             : GEN hnfspec(GEN m,GEN p,GEN* ptdep,GEN* ptA,GEN* ptC,long k0);
     562             : GEN mathnfspec(GEN x, GEN *ptperm, GEN *ptdep, GEN *ptB, GEN *ptC);
     563             : GEN ZM_hnfmodall_i(GEN x, GEN dm, long flag);
     564             : 
     565             : GEN LLL_check_progress(GEN Bnorm, long n0, GEN m, int final, long *ti_LLL);
     566             : 
     567             : /* integer factorization / discrete log */
     568             : ulong is_kth_power(GEN x, ulong p, GEN *pt);
     569             : GEN   mpqs(GEN N);
     570             : 
     571             : /* Polynomials */
     572             : /* a) Arithmetic/conversions */
     573             : GEN  lift_if_rational(GEN x);
     574             : GEN  monomial(GEN a, long degpol, long v);
     575             : GEN  monomialcopy(GEN a, long degpol, long v);
     576             : GEN  ser2pol_i(GEN x, long lx);
     577             : GEN  ser2rfrac_i(GEN x);
     578             : GEN  swap_vars(GEN b0, long v);
     579             : GEN  RgX_recipspec_shallow(GEN x, long l, long n);
     580             : 
     581             : /* b) Modular */
     582             : GEN  bezout_lift_fact(GEN T, GEN Tmod, GEN p, long e);
     583             : GEN  polsym_gen(GEN P, GEN y0, long n, GEN T, GEN N);
     584             : GEN  ZXQ_charpoly_sqf(GEN A, GEN B, long *lambda, long v);
     585             : GEN  ZX_disc_all(GEN,ulong);
     586             : GEN  ZX_resultant_all(GEN A, GEN B, GEN dB, ulong bound);
     587             : GEN  ZX_ZXY_resultant_all(GEN A, GEN B, long *lambda, GEN *LPRS);
     588             : 
     589             : GEN FlxqM_mul_Kronecker(GEN A, GEN B, GEN T, ulong p);
     590             : GEN FqM_mul_Kronecker(GEN x, GEN y, GEN T, GEN p);
     591             : 
     592             : /* c) factorization */
     593             : GEN chk_factors_get(GEN lt, GEN famod, GEN c, GEN T, GEN N);
     594             : long cmbf_maxK(long nb);
     595             : GEN ZX_DDF(GEN x);
     596             : GEN initgaloisborne(GEN T, GEN dn, long prec, GEN *pL, GEN *pprep, GEN *pdis);
     597             : 
     598             : /* number fields */
     599             : GEN nflist_C3_worker(GEN gv, GEN T);
     600             : GEN nflist_C4vec_worker(GEN gm, GEN X, GEN Xinf, GEN gs);
     601             : GEN nflist_V4_worker(GEN D1, GEN X, GEN Xinf, GEN gs);
     602             : GEN nflist_D4_worker(GEN D, GEN X, GEN Xinf, GEN listarch);
     603             : GEN nflist_A4S4_worker(GEN P3, GEN X, GEN Xinf, GEN cards);
     604             : GEN nflist_C5_worker(GEN N, GEN bnfC5);
     605             : GEN nflist_CL_worker(GEN Fcond, GEN bnf, GEN ellprec);
     606             : GEN nflist_DL_worker(GEN P2, GEN X1pow, GEN X0pow, GEN X, GEN Xinf, GEN ells);
     607             : GEN nflist_Mgen_worker(GEN field, GEN X, GEN Xinf, GEN ella);
     608             : GEN nflist_C6_worker(GEN P3, GEN X, GEN Xinf, GEN M, GEN T);
     609             : GEN nflist_D612_worker(GEN P3, GEN X, GEN Xinf, GEN limd2s2);
     610             : GEN nflist_A46S46P_worker(GEN P3, GEN Xinf, GEN sqX, GEN cards);
     611             : GEN nflist_S46M_worker(GEN P3, GEN X, GEN Xinf, GEN gs);
     612             : GEN nflist_A462_worker(GEN P3, GEN X, GEN Xinf, GEN listarch, GEN GAL);
     613             : GEN nflist_S3C3_worker(GEN D2, GEN X, GEN Xinf);
     614             : GEN nflist_S462_worker(GEN P3, GEN X, GEN Xinf, GEN listarch13, GEN GAL);
     615             : GEN nflist_S36_worker(GEN pol, GEN X, GEN Xinf);
     616             : GEN nflist_C32C4_worker(GEN P4, GEN X, GEN Xinf, GEN GAL);
     617             : GEN nflist_C32D4_worker(GEN P, GEN X, GEN Xinf, GEN gs);
     618             : GEN nflist_C9_worker(GEN P, GEN X, GEN Xinf);
     619             : GEN nflist_C3C3_worker(GEN gi, GEN V3, GEN V3D, GEN X);
     620             : GEN nflist_S3R_worker(GEN ga, GEN ALLCTS);
     621             : GEN nflist_S3I_worker(GEN ga, GEN ALLCTS);
     622             : GEN nflist_D9_worker(GEN P2, GEN X, GEN Xinf);
     623             : GEN nflist_S32_worker(GEN all1, GEN X, GEN Xinf, GEN V3, GEN gs);
     624             : 
     625             : /* pari_init / pari_close */
     626             : void pari_close_compiler(void);
     627             : void pari_close_evaluator(void);
     628             : void pari_close_files(void);
     629             : void pari_close_floats(void);
     630             : void pari_close_homedir(void);
     631             : void pari_close_parser(void);
     632             : void pari_close_paths(void);
     633             : void pari_close_primes(void);
     634             : void pari_init_buffers(void);
     635             : void pari_init_compiler(void);
     636             : void pari_init_defaults(void);
     637             : void pari_init_ellcondfile(void);
     638             : void pari_init_evaluator(void);
     639             : void pari_init_files(void);
     640             : void pari_init_floats(void);
     641             : void pari_close_hgm(void);
     642             : void pari_init_hgm(void);
     643             : void pari_init_homedir(void);
     644             : void pari_init_graphics(void);
     645             : void pari_init_parser(void);
     646             : void pari_init_rand(void);
     647             : void pari_init_paths(void);
     648             : void pari_init_primetab(void);
     649             : void pari_init_seadata(void);
     650             : GEN pari_get_seadata(void);
     651             : void pari_set_primetab(GEN global_primetab);
     652             : void pari_set_seadata(GEN seadata);
     653             : void pari_set_varstate(long *vp, struct pari_varstate *vs);
     654             : void pari_thread_close_files(void);
     655             : 
     656             : void export_add(const char *str, GEN val);
     657             : void export_del(const char *str);
     658             : GEN  export_get(const char *str);
     659             : void exportall(void);
     660             : void unexportall(void);
     661             : 
     662             : /* BY FILES */
     663             : 
     664             : /* parinf.h */
     665             : 
     666             : GEN fincke_pohst(GEN a,GEN BOUND,long stockmax,long PREC, FP_chk_fun *CHECK);
     667             : void init_zlog(zlog_S *S, GEN bid);
     668             : GEN  log_gen_arch(zlog_S *S, long index);
     669             : GEN  log_gen_pr(zlog_S *S, long index, GEN nf, long e);
     670             : GEN  sprk_log_gen_pr(GEN nf, GEN sprk, long e);
     671             : GEN  sprk_log_gen_pr2(GEN nf, GEN sprk, long e);
     672             : GEN  sprk_log_prk1(GEN nf, GEN a, GEN sprk);
     673             : GEN    poltobasis(GEN nf,GEN x);
     674             : GEN    coltoalg(GEN nf,GEN x);
     675             : 
     676             : GEN    rnfdisc_get_T(GEN nf, GEN P, GEN *lim);
     677             : GEN    make_integral(GEN nf, GEN L0, GEN f, GEN listpr);
     678             : GEN    rnfallbase(GEN nf, GEN pol, GEN lim, GEN rnfeq, GEN *pD, GEN *pfi,
     679             :                   GEN *pdKP);
     680             : GEN    subgroupcondlist(GEN cyc, GEN bound, GEN listKer);
     681             : 
     682             : /* Qfb.c */
     683             : 
     684             : GEN     redimagsl2(GEN q, GEN *U);
     685             : 
     686             : /* alglin1.c */
     687             : 
     688             : typedef long (*pivot_fun)(GEN,GEN,long,GEN);
     689             : GEN ZM_pivots(GEN x0, long *rr);
     690             : GEN RgM_pivots(GEN x0, GEN data, long *rr, pivot_fun pivot);
     691             : void RgMs_structelim_col(GEN M, long nbcol, long nbrow, GEN A, GEN *p_col, GEN *p_lin);
     692             : 
     693             : /* arith1.c */
     694             : 
     695             : int     is_gener_Fp(GEN x, GEN p, GEN p_1, GEN L);
     696             : int     is_gener_Fl(ulong x, ulong p, ulong p_1, GEN L);
     697             : 
     698             : /* arith2.c */
     699             : 
     700             : int     divisors_init(GEN n, GEN *pP, GEN *pE);
     701             : long    set_optimize(long what, GEN g);
     702             : 
     703             : /* base1.c */
     704             : 
     705             : GEN     zk_galoisapplymod(GEN nf, GEN z, GEN S, GEN p);
     706             : int     ZX_canon_neg(GEN z);
     707             : 
     708             : /* base2.c */
     709             : 
     710             : GEN     dim1proj(GEN prh);
     711             : GEN     gen_if_principal(GEN bnf, GEN x);
     712             : 
     713             : /* base3.c */
     714             : 
     715             : void    check_nfelt(GEN x, GEN *den);
     716             : GEN     zk_ei_mul(GEN nf, GEN x, long i);
     717             : GEN     log_prk(GEN nf, GEN a, GEN sprk, GEN mod);
     718             : GEN     log_prk_units(GEN nf, GEN D, GEN sprk);
     719             : GEN     log_prk_units_init(GEN bnf);
     720             : GEN     veclog_prk(GEN nf, GEN v, GEN sprk);
     721             : GEN     log_prk_init(GEN nf, GEN pr, long k, GEN mod);
     722             : GEN     check_mod_factored(GEN nf, GEN ideal, GEN *fa, GEN *fa2, GEN *archp, GEN MOD);
     723             : GEN     sprk_get_cyc(GEN s);
     724             : GEN     sprk_get_expo(GEN s);
     725             : GEN     sprk_get_gen(GEN s);
     726             : GEN     sprk_get_prk(GEN s);
     727             : GEN     sprk_get_ff(GEN s);
     728             : GEN     sprk_get_pr(GEN s);
     729             : void    sprk_get_AgL2(GEN s, GEN *A, GEN *g, GEN *L2);
     730             : void    sprk_get_U2(GEN s, GEN *U1, GEN *U2);
     731             : GEN     famat_zlog_pr(GEN nf, GEN g, GEN e, GEN sprk, GEN mod);
     732             : 
     733             : /* base4.c */
     734             : 
     735             : GEN     factorbackprime(GEN nf, GEN L, GEN e);
     736             : 
     737             : /* bb_group.c */
     738             : 
     739             : GEN     producttree_scheme(long n);
     740             : 
     741             : /* bern.c */
     742             : long bernbitprec(long N);
     743             : 
     744             : /* bibli2.c */
     745             : 
     746             : GEN sort_factor_pol(GEN y, int (*cmp)(GEN,GEN));
     747             : 
     748             : /* buch1.c */
     749             : 
     750             : long   bnf_increase_LIMC(long LIMC, long LIMCMAX);
     751             : 
     752             : /* buch2.c */
     753             : 
     754             : typedef struct GRHprime_t { ulong p; double logp; GEN dec; } GRHprime_t;
     755             : typedef struct GRHcheck_t { double cD, cN; GRHprime_t *primes; long clone, nprimes, maxprimes; ulong limp; forprime_t P; } GRHcheck_t;
     756             : void    free_GRHcheck(GRHcheck_t *S);
     757             : void    init_GRHcheck(GRHcheck_t *S, long N, long R1, double LOGD);
     758             : void    GRH_ensure(GRHcheck_t *S, long nb);
     759             : ulong   GRH_last_prime(GRHcheck_t *S);
     760             : int     GRHok(GRHcheck_t *S, double L, double SA, double SB);
     761             : GEN     extract_full_lattice(GEN x);
     762             : GEN     init_red_mod_units(GEN bnf, long prec);
     763             : GEN     isprincipalarch(GEN bnf, GEN col, GEN kNx, GEN e, GEN dx, long *pe);
     764             : GEN     red_mod_units(GEN col, GEN z);
     765             : 
     766             : /* buch3.c */
     767             : 
     768             : GEN     minkowski_bound(GEN D, long N, long r2, long prec);
     769             : int     subgroup_conductor_ok(GEN H, GEN L);
     770             : GEN     subgrouplist_cond_sub(GEN bnr, GEN C, GEN bound);
     771             : 
     772             : /* crvwtors.c */
     773             : 
     774             : void random_curves_with_m_torsion(ulong *a4, ulong *a6, ulong *tx, ulong *ty, long ncurves, long m, ulong p);
     775             : 
     776             : /* dirichlet.c */
     777             : 
     778             : GEN direuler_factor(GEN s, long n);
     779             : 
     780             : /* ellanal.c */
     781             : 
     782             : GEN hnaive_max(GEN ell, GEN ht);
     783             : 
     784             : /* elliptic.c */
     785             : 
     786             : GEN  ellQ_genreduce(GEN E, GEN G, GEN M, long prec);
     787             : GEN  ellQ_isdivisible(GEN E, GEN P, ulong l);
     788             : GEN  ellminimalbmodel(GEN E, GEN *ptv);
     789             : GEN  ellintegralbmodel(GEN e, GEN *pv);
     790             : void ellprint(GEN e);
     791             : 
     792             : /* ellrank.c */
     793             : 
     794             : GEN     ell2selmer_basis(GEN ell, GEN *cb, long prec);
     795             : 
     796             : /* es.c */
     797             : 
     798             : void    killallfiles(void);
     799             : pariFILE* newfile(FILE *f, const char *name, int type);
     800             : int     popinfile(void);
     801             : pariFILE* try_pipe(const char *cmd, int flag);
     802             : 
     803             : /* F2m.c */
     804             : 
     805             : GEN     F2m_gauss_pivot(GEN x, long *rr);
     806             : GEN     F2m_gauss_sp(GEN a, GEN b);
     807             : GEN     F2m_invimage_i(GEN A, GEN B);
     808             : 
     809             : /* Fle.c */
     810             : 
     811             : void    FleV_add_pre_inplace(GEN P, GEN Q, GEN a4, ulong p, ulong pi);
     812             : void    FleV_dbl_pre_inplace(GEN P, GEN a4, ulong p, ulong pi);
     813             : void    FleV_mulu_pre_inplace(GEN P, ulong n, GEN a4, ulong p, ulong pi);
     814             : void    FleV_sub_pre_inplace(GEN P, GEN Q, GEN a4, ulong p, ulong pi);
     815             : 
     816             : /* Flv.c */
     817             : 
     818             : GEN     Flm_gauss_sp(GEN a, GEN b, ulong *detp, ulong p);
     819             : GEN     Flm_invimage_i(GEN A, GEN B, ulong p);
     820             : GEN     Flm_inv_sp(GEN a, ulong *detp, ulong p);
     821             : GEN     Flm_pivots(GEN x, ulong p, long *rr, long inplace);
     822             : 
     823             : /* Flxq_log.c */
     824             : 
     825             : GEN Flxq_log_index(GEN a0, GEN b0, GEN m, GEN T0, ulong p);
     826             : int Flxq_log_use_index(GEN m, GEN T0, ulong p);
     827             : 
     828             : /* FlxqE.c */
     829             : 
     830             : GEN     ZpXQ_norm_pcyc(GEN x, GEN T, GEN q, GEN p);
     831             : long    zx_is_pcyc(GEN T);
     832             : 
     833             : /* FpV.c */
     834             : 
     835             : GEN FpMs_leftkernel_elt_col(GEN M, long nbcol, long nbrow, GEN p);
     836             : GEN FpX_to_mod_raw(GEN z, GEN p);
     837             : 
     838             : /* FpX.c */
     839             : 
     840             : GEN     ZlXQXn_expint(GEN h, long e, GEN T, GEN p, ulong pp);
     841             : 
     842             : /* FpX_factor.c */
     843             : 
     844             : GEN     ddf_to_ddf2(GEN V);
     845             : long    ddf_to_nbfact(GEN D);
     846             : GEN     vddf_to_simplefact(GEN V, long d);
     847             : 
     848             : /* FpXQX_factor.c */
     849             : 
     850             : GEN     FpXQX_factor_Berlekamp(GEN x, GEN T, GEN p);
     851             : 
     852             : /* forprime.c*/
     853             : 
     854             : void    init_modular_big(forprime_t *S);
     855             : void    init_modular_small(forprime_t *S);
     856             : 
     857             : /* galconj.c */
     858             : 
     859             : GEN     galoiscosets(GEN O, GEN perm);
     860             : GEN     galoisinitfromaut(GEN T, GEN aut, ulong l);
     861             : GEN     matrixnorm(GEN M, long prec);
     862             : 
     863             : /* gen1.c */
     864             : 
     865             : GEN     gred_rfrac_simple(GEN n, GEN d);
     866             : GEN     sqr_ser_part(GEN x, long l1, long l2);
     867             : 
     868             : /* hash.c */
     869             : 
     870             : hashtable *hashstr_import_static(hashentry *e, ulong size);
     871             : 
     872             : /* hyperell.c */
     873             : 
     874             : GEN     ZlXQX_hyperellpadicfrobenius(GEN H, GEN T, ulong p, long n);
     875             : GEN     hyperell_redsl2(GEN Q);
     876             : 
     877             : /* ifactor1.c */
     878             : 
     879             : ulong snextpr(ulong p, byteptr *d, long *rcn, long *q, int (*ispsp)(ulong));
     880             : 
     881             : /* intnum.c */
     882             : 
     883             : GEN     contfraceval_inv(GEN CF, GEN tinv, long nlim);
     884             : 
     885             : /* mftrace.c */
     886             : 
     887             : void pari_close_mf(void);
     888             : long polishomogeneous(GEN P);
     889             : GEN sertocol(GEN S);
     890             : GEN mfrhopol(long n);
     891             : GEN mfrhopol_u_eval(GEN Q, ulong t2);
     892             : GEN mfrhopol_eval(GEN Q, GEN t2);
     893             : 
     894             : /* prime.c */
     895             : 
     896             : long    BPSW_psp_nosmalldiv(GEN N);
     897             : int     MR_Jaeschke(GEN n);
     898             : long    isanypower_nosmalldiv(GEN N, GEN *px);
     899             : void    prime_table_next_p(ulong a, byteptr *pd, ulong *pp, ulong *pn);
     900             : 
     901             : /* perm.c */
     902             : 
     903             : long    cosets_perm_search(GEN C, GEN p);
     904             : GEN     perm_generate(GEN S, GEN H, long o);
     905             : long    perm_relorder(GEN p, GEN S);
     906             : GEN     vecperm_extendschreier(GEN C, GEN v, long n);
     907             : 
     908             : /* polclass.c */
     909             : 
     910             : GEN polclass0(long D, long inv, long vx, GEN *db);
     911             : 
     912             : /* polmodular.c */
     913             : 
     914             : GEN polmodular0_ZM(long L, long inv, GEN J, GEN Q, int compute_derivs, GEN *db);
     915             : GEN Flm_Fl_polmodular_evalx(GEN phi, long L, ulong j, ulong p, ulong pi);
     916             : GEN polmodular_db_init(long inv);
     917             : void polmodular_db_clear(GEN db);
     918             : void polmodular_db_add_level(GEN *db, long L, long inv);
     919             : void polmodular_db_add_levels(GEN *db, long *levels, long k, long inv);
     920             : GEN polmodular_db_for_inv(GEN db, long inv);
     921             : GEN polmodular_db_getp(GEN fdb, long L, ulong p);
     922             : 
     923             : long modinv_level(long inv);
     924             : long modinv_degree(long *p1, long *p2, long inv);
     925             : long modinv_ramified(long D, long inv, long *pN);
     926             : long modinv_j_from_2double_eta(GEN F, long inv, ulong x0, ulong x1, ulong p, ulong pi);
     927             : GEN double_eta_raw(long inv);
     928             : ulong modfn_root(ulong j, norm_eqn_t ne, long inv);
     929             : long modfn_unambiguous_root(ulong *r, long inv, ulong j0, norm_eqn_t ne, GEN jdb);
     930             : GEN qfb_nform(long D, long n);
     931             : 
     932             : /* Fle.c */
     933             : 
     934             : ulong   Flj_order_ufact(GEN P, ulong n, GEN F, ulong a4, ulong p, ulong pi);
     935             : 
     936             : /* polarit3.c */
     937             : 
     938             : GEN     Flm_Frobenius_pow(GEN M, long d, GEN T, ulong p);
     939             : GEN     FpM_Frobenius_pow(GEN M, long d, GEN T, GEN p);
     940             : GEN     Flx_direct_compositum(GEN A, GEN B, ulong p);
     941             : GEN     FlxV_direct_compositum(GEN V, ulong p);
     942             : GEN     FlxqX_direct_compositum(GEN P, GEN Q, GEN T, ulong p);
     943             : GEN     FpX_direct_compositum(GEN A, GEN B, GEN p);
     944             : GEN     FpXV_direct_compositum(GEN V, GEN p);
     945             : GEN     nf_direct_compositum(GEN nf, GEN A, GEN B);
     946             : ulong   ZX_ZXY_ResBound(GEN A, GEN B, GEN dB);
     947             : GEN     ffinit_Artin_Schreier(ulong p, long l);
     948             : GEN     ffinit_rand(GEN p, long n);
     949             : 
     950             : /* nflistQT.c */
     951             : 
     952             : GEN nflistQT(long n, long k, long v);
     953             : 
     954             : /* ramanujantau.c */
     955             : GEN     ramanujantau_worker(GEN gt, GEN p2_7, GEN p_9, GEN p);
     956             : GEN     taugen_n_worker(GEN t, GEN pol, GEN p4);
     957             : 
     958             : /* readline.c */
     959             : 
     960             : char**  pari_completion(pari_rl_interface *pari_rl, char *text, int START, int END);
     961             : char**  pari_completion_matches(pari_rl_interface *pari_rl, const char *s, long pos, long *wordpos);
     962             : 
     963             : /* RgX.c */
     964             : 
     965             : GEN     RgX_homogenous_evalpow(GEN P, GEN A, GEN B);
     966             : GEN     QXQX_homogenous_evalpow(GEN P, GEN A, GEN B, GEN T);
     967             : 
     968             : /* subcyclo.c */
     969             : 
     970             : GEN     galoiscyclo(long n, long v);
     971             : long    subcyclo_nH(const char *fun, GEN N, GEN *psg);
     972             : GEN     znstar_bits(long n, GEN H);
     973             : long    znstar_conductor(GEN H);
     974             : long    znstar_conductor_bits(GEN bits);
     975             : GEN     znstar_cosets(long n, long phi_n, GEN H);
     976             : GEN     znstar_elts(long n, GEN H);
     977             : GEN     znstar_generate(long n, GEN V);
     978             : GEN     znstar_hnf(GEN Z, GEN M);
     979             : GEN     znstar_hnf_elts(GEN Z, GEN H);
     980             : GEN     znstar_hnf_generators(GEN Z, GEN M);
     981             : GEN     znstar_reduce_modulus(GEN H, long n);
     982             : GEN     znstar_small(GEN zn);
     983             : 
     984             : /* trans1.c */
     985             : 
     986             : struct abpq { GEN *a, *b, *p, *q; };
     987             : struct abpq_res { GEN P, Q, B, T; };
     988             : void    abpq_init(struct abpq *A, long n);
     989             : void    abpq_sum(struct abpq_res *r, long n1, long n2, struct abpq *A);
     990             : GEN     logagmcx(GEN q, long prec);
     991             : GEN     zellagmcx(GEN a0, GEN b0, GEN r, GEN t, long prec);
     992             : 
     993             : /* trans2.c */
     994             : 
     995             : GEN     trans_fix_arg(long *prec, GEN *s0, GEN *sig, GEN *tau, pari_sp *av, GEN *res);
     996             : 
     997             : /* trans3.c */
     998             : 
     999             : GEN     double_eta_quotient(GEN a, GEN w, GEN D, long p, long q, GEN pq, GEN sqrtD);
    1000             : GEN     inv_szeta_euler(long n, long prec);
    1001             : 
    1002             : /* volcano.c */
    1003             : 
    1004             : long j_level_in_volcano(GEN phi, ulong j, ulong p, ulong pi, long L, long depth);
    1005             : ulong ascend_volcano(GEN phi, ulong j, ulong p, ulong pi, long level, long L, long depth, long steps);
    1006             : ulong descend_volcano(GEN phi, ulong j, ulong p, ulong pi, long level, long L, long depth, long steps);
    1007             : long next_surface_nbr(ulong *nJ, GEN phi, long L, long h, ulong J, const ulong *pJ, ulong p, ulong pi);
    1008             : GEN enum_roots(ulong j, norm_eqn_t ne, GEN fdb, classgp_pcp_t G);
    1009             : 
    1010             : ENDEXTERN

Generated by: LCOV version 1.13