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 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.10.0 lcov report (development 20277-2bd9113) Lines: 9 9 100.0 %
Date: 2017-02-21 05:49:51 Functions: 7 7 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. It is distributed in the hope that it will be useful, but WITHOUT
       8             : ANY WARRANTY WHATSOEVER.
       9             : 
      10             : Check the License for details. You should have received a copy of it, along
      11             : with the package; see the file 'COPYING'. If not, write to the Free Software
      12             : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
      13             : 
      14             : BEGINEXTERN
      15             : 
      16             : /* for qsort */
      17             : typedef int (*QSCOMP)(const void *, const void *);
      18             : 
      19             : #define ucoeff(a,i,j)  (((ulong**)(a))[j][i])
      20             : #define umael(a,i,j)   (((ulong**)(a))[i][j])
      21             : #define uel(a,i)       (((ulong*)(a))[i])
      22             : 
      23             : #define numberof(x) (sizeof(x) / sizeof((x)[0]))
      24             : 
      25             : /* to manipulate 'blocs' */
      26             : #define BL_HEAD 4
      27             : #define bl_base(x) (void*)((x) - BL_HEAD)
      28             : #define bl_refc(x) (((GEN)x)[-4])
      29             : #define bl_next(x) (((GEN*)x)[-3])
      30             : #define bl_prev(x) (((GEN*)x)[-2])
      31             : #define bl_num(x)  (((GEN)x)[-1])
      32             : INLINE void
      33   189044660 : clone_lock(GEN C) { if (isclone(C)) ++bl_refc(C); }
      34             : INLINE void
      35   189448166 : clone_unlock(GEN C) { if (isclone(C)) gunclone(C); }
      36             : 
      37             : /* swap */
      38             : #define lswap(x,y) {long _z=x; x=y; y=_z;}
      39             : #define pswap(x,y) {GEN *_z=x; x=y; y=_z;}
      40             : #define swap(x,y)  {GEN  _z=x; x=y; y=_z;}
      41             : #define dswap(x,y) { double _t=x; x=y; y=_t; }
      42             : #define pdswap(x,y) { double* _t=x; x=y; y=_t; }
      43             : #define swapspec(x,y, nx,ny) {swap(x,y); lswap(nx,ny);}
      44             : 
      45             : /* loops */
      46             : GEN incloop(GEN a);
      47             : GEN resetloop(GEN a, GEN b);
      48             : GEN setloop(GEN a);
      49             : 
      50             : /* parser */
      51             : GEN  iferrpari(GEN a, GEN b, GEN c);
      52             : void forpari(GEN a, GEN b, GEN node);
      53             : void untilpari(GEN a, GEN b);
      54             : void whilepari(GEN a, GEN b);
      55             : GEN  ifpari(GEN g, GEN a, GEN b);
      56             : GEN  andpari(GEN a, GEN b);
      57             : GEN  orpari(GEN a, GEN b);
      58             : void ifpari_void(GEN g, GEN a, GEN b);
      59             : GEN  ifpari_multi(GEN g, GEN a);
      60             : GEN  geval_gp(GEN x, GEN t);
      61             : 
      62             : GEN  gadde(GEN *x, GEN y);
      63             : GEN  gadd1e(GEN *x);
      64             : GEN  gdive(GEN *x, GEN y);
      65             : GEN  gdivente(GEN *x, GEN y);
      66             : GEN  gdivrounde(GEN *x, GEN y);
      67             : GEN  gmode(GEN *x, GEN y);
      68             : GEN  gmule(GEN *x, GEN y);
      69             : GEN  gshiftle(GEN *x, long n);
      70             : GEN  gshiftre(GEN *x, long n);
      71             : GEN  gsube(GEN *x, GEN y);
      72             : GEN  gsub1e(GEN *x);
      73             : GEN  gshift_right(GEN x, long n);
      74             : 
      75             : GEN  asympnum0(GEN u, long muli, GEN alpha, long prec);
      76             : GEN  derivnum0(GEN a, GEN code, GEN ind, long prec);
      77             : GEN  derivfun0(GEN code, GEN args, long prec);
      78             : GEN  direuler0(GEN a, GEN b, GEN code, GEN c);
      79             : GEN  direuler_bad(void *E, GEN (*eval)(void *, GEN), GEN a, GEN b, GEN c, GEN Sbad);
      80             : void forcomposite(GEN a, GEN b, GEN code);
      81             : void fordiv(GEN a, GEN code);
      82             : void forell0(long a, long b, GEN code, long flag);
      83             : void forperm0(GEN k, GEN code);
      84             : void forprime(GEN a, GEN b, GEN code);
      85             : void forstep(GEN a, GEN b, GEN s, GEN code);
      86             : void forsubgroup0(GEN cyc, GEN bound, GEN code);
      87             : void forsubset0(GEN nk, GEN code);
      88             : void forvec(GEN x, GEN code, long flag);
      89             : void forpart0(GEN k, GEN code , GEN nbound, GEN abound);
      90             : GEN  intcirc0(GEN a, GEN R, GEN code, GEN tab, long prec);
      91             : GEN  intfuncinit0(GEN a, GEN b, GEN code, long m, long prec);
      92             : GEN  intnum0(GEN a, GEN b, GEN code, GEN tab, long prec);
      93             : GEN  intnumgauss0(GEN a, GEN b, GEN code, GEN tab, long prec);
      94             : GEN  intnumromb0_bitprec(GEN a, GEN b, GEN code, long flag, long bit);
      95             : GEN  limitnum0(GEN u, long muli, GEN alpha, long prec);
      96             : GEN  matrice(GEN nlig, GEN ncol, GEN code);
      97             : GEN  prodeuler0(GEN a, GEN b, GEN code, long prec);
      98             : GEN  prodinf0(GEN a, GEN code, long flag, long prec);
      99             : GEN  produit(GEN a, GEN b, GEN code, GEN x);
     100             : GEN  somme(GEN a, GEN b, GEN code, GEN x);
     101             : GEN  sumalt0(GEN a, GEN code,long flag, long prec);
     102             : GEN  sumdivexpr(GEN num, GEN code);
     103             : GEN  sumdivmultexpr(GEN num, GEN code);
     104             : GEN  suminf0(GEN a, GEN code, long prec);
     105             : GEN  sumnum0(GEN a, GEN code, GEN tab, long prec);
     106             : GEN  sumnumap0(GEN a, GEN code, GEN tab, long prec);
     107             : GEN  sumnumlagrange0(GEN a, GEN code, GEN tab, long prec);
     108             : GEN  sumnummonien0(GEN a, GEN code, GEN tab, long prec);
     109             : GEN  sumpos0(GEN a, GEN code, long flag,long prec);
     110             : GEN  vecexpr0(GEN nmax, GEN code, GEN pred);
     111             : GEN  vecexpr1(GEN nmax, GEN code, GEN pred);
     112             : GEN  vecteursmall(GEN nmax, GEN code);
     113             : GEN  vecteur(GEN nmax, GEN n);
     114             : GEN  vvecteur(GEN nmax, GEN n);
     115             : GEN  zbrent0(GEN a, GEN b, GEN code, long prec);
     116             : GEN  solvestep0(GEN a, GEN b, GEN step, GEN code, long flag, long prec);
     117             : 
     118             : GEN  listcreate_gp(long n);
     119             : 
     120             : /* mt */
     121             : void mt_sigint(void);
     122             : void mt_err_recover(long er);
     123             : void mt_init_stack(size_t s);
     124             : int  mt_is_thread(void);
     125             : GEN  parapply_worker(GEN d, GEN code);
     126             : GEN  pareval_worker(GEN code);
     127             : void parfor0(GEN a, GEN b, GEN code, GEN code2);
     128             : GEN  parfor_worker(GEN i, GEN C);
     129             : void parforprime0(GEN a, GEN b, GEN code, GEN code2);
     130             : void parforvec0(GEN a, GEN code, GEN code2, long flag);
     131             : GEN  parvector_worker(GEN i, GEN C);
     132             : GEN  polmodular_worker(ulong p, ulong t, ulong L, GEN hilb, GEN factu,
     133             :        GEN vne, GEN vinfo, long compute_derivs, GEN j_powers, GEN fdb);
     134             : GEN  nmV_polint_center_tree_worker(GEN Va, GEN T, GEN R, GEN xa, GEN m2);
     135             : GEN  F2xq_log_Coppersmith_worker(GEN u, long i, GEN V, GEN R);
     136             : GEN  Flxq_log_Coppersmith_worker(GEN u, long i, GEN V, GEN R);
     137             : GEN  Fp_log_sieve_worker(long a, long prmax, GEN C, GEN c, GEN Ci, GEN ci, GEN pr, GEN sz);
     138             : GEN  ZX_resultant_worker(GEN P, GEN A, GEN B, GEN dB);
     139             : 
     140             : /* Relative number fields */
     141             : enum { rnf_NFABS = 1, rnf_MAPS };
     142             : 
     143             : /* Finite fields */
     144             : enum { t_FF_FpXQ = 0, t_FF_Flxq = 1, t_FF_F2xq = 2 };
     145             : GEN FF_ellinit(GEN E, GEN fg);
     146             : GEN FF_elldata(GEN E, GEN fg);
     147             : 
     148             : /* L functions */
     149             : enum { t_LFUN_GENERIC, t_LFUN_ZETA, t_LFUN_NF, t_LFUN_ELL, t_LFUN_KRONECKER,
     150             :        t_LFUN_CHIZ, t_LFUN_CHIGEN, t_LFUN_ETA,
     151             :        t_LFUN_DIV, t_LFUN_MUL, t_LFUN_CONJ,
     152             :        t_LFUN_SYMSQ_ELL, t_LFUN_QF, t_LFUN_ARTIN,
     153             :        t_LFUN_GENUS2 };
     154             : enum { t_LDESC_INIT, t_LDESC_THETA, t_LDESC_PRODUCT };
     155             : 
     156             : /* Elliptic curves */
     157             : /* common to Q and Rg */
     158             : enum { R_PERIODS = 1, R_ETA, R_ROOTS, R_AB };
     159             : 
     160             : enum { Qp_ROOT = 1, Qp_TATE };
     161             : enum { Q_GROUPGEN = 5, Q_GLOBALRED, Q_ROOTNO, Q_MINIMALMODEL };
     162             : enum { NF_MINIMALMODEL = 1, NF_GLOBALRED };
     163             : 
     164             : /* common to Fp and Fq */
     165             : enum { FF_CARD = 1, FF_GROUP, FF_GROUPGEN, FF_O };
     166             : 
     167             : /* for Buchall_param */
     168             : enum { fupb_NONE, fupb_RELAT, fupb_LARGE, fupb_PRECI };
     169             : 
     170             : /* Polycyclic presentation for the classgroup of discriminant D */
     171             : typedef struct {
     172             :   long D; /* Negative discriminant */
     173             :   long h; /* Size of classgroup */
     174             :   long enum_cnt; /* Either h or h/2 (if L0 is set) */
     175             :   /* If nonzero, L0=L[0] and n[0]=2 and classpoly is a perfect square
     176             :    * (and we enumerate each double root just once), default is 0 */
     177             :   long L0;
     178             :   /* Product of primes L that are prohibited as norms of generators or
     179             :    * auxilliary prime forms (by default, primes that make enumeration hard) */
     180             :   long Lfilter;
     181             :   /* Norms of implicit generators (primeforms a=(L*x^2+b*x*y+c*y^2)
     182             :    * with norm L and b >=0) */
     183             :   long *L;
     184             :   long *m; /* products of relative orders: m[i] is the order of <g_1,...,g_i> */
     185             :   long *n; /* Relative orders */
     186             :   long *o; /* Absolute orders */
     187             :   /* Power relations (a[i]^n[i] = a[0]^e[0]*...*a[i-1]^e[i-1], where e
     188             :    * is an exponent vector of length i stored at offset binom(i,2) of r) */
     189             :   long *r;
     190             :   long *orient_p; /* Optional list of norms of orienting primes p ... */
     191             :   long *orient_q; /* or product of primes p*q (q=1 when only p is needed) */
     192             :   long *orient_reps; /* Representation of orienting norm p*q in terms of Ls */
     193             :   long inv; /* Attached invariant */
     194             :   long k; /* Number of generators */
     195             :   GEN _data; /* Storage space for the above arrays */
     196             : } classgp_pcp_struct;
     197             : typedef classgp_pcp_struct classgp_pcp_t[1];
     198             : 
     199             : /* Represents the data in the equation(s)
     200             :  *   4p = t^2 - v^2 D = t^2 - v^2 u^2 D_K = w^2 D_K.
     201             :  * t is the absolute trace, so always > 0.
     202             :  * T is a twisting parameter, which satisfies (T|p) == -1. */
     203             : typedef struct {
     204             :   long D, t, u, v;
     205             :   ulong p, pi, T;
     206             : } norm_eqn_struct;
     207             : typedef norm_eqn_struct norm_eqn_t[1];
     208             : 
     209             : #define zv_to_longptr(v) (&((v)[1]))
     210             : #define zv_to_ulongptr(v) ((ulong *)&((v)[1]))
     211             : 
     212             : /* Modular invariants */
     213             : #define INV_J       0
     214             : #define INV_F       1
     215             : #define INV_F2      2
     216             : #define INV_F3      3
     217             : #define INV_F4      4
     218             : #define INV_G2      5
     219             : #define INV_W2W3    6
     220             : #define INV_F8      8
     221             : #define INV_W3W3    9
     222             : #define INV_W2W5    10
     223             : #define INV_W2W7    14
     224             : #define INV_W3W5    15
     225             : #define INV_W3W7    21
     226             : #define INV_W2W3E2  23
     227             : #define INV_W2W5E2  24
     228             : #define INV_W2W13   26
     229             : #define INV_W2W7E2  27
     230             : #define INV_W3W3E2  28
     231             : #define INV_W5W7    35
     232             : #define INV_W3W13   39
     233             : 
     234             : /* Get coefficient of x^d in f, assuming f is nonzero. */
     235    13595852 : INLINE ulong Flx_coeff(GEN f, long d) { return f[d + 2]; }
     236             : /* Return the root of f, assuming deg(f) = 1. */
     237      209886 : INLINE ulong Flx_deg1_root(GEN f, ulong p) {
     238      209886 :   if (degpol(f) != 1) pari_err_BUG("Flx_deg1_root");
     239      209886 :   return Fl_div(Fl_neg(Flx_coeff(f, 0), p), Flx_coeff(f, 1), p);
     240             : }
     241             : 
     242             : /* Allocation / gerepile */
     243             : long   getdebugvar(void);
     244             : void   setdebugvar(long n);
     245             : void   debug_stack(void);
     246             : void   fill_stack(void);
     247             : void   minim_alloc(long n, double ***q, GEN *x, double **y,  double **z, double **v);
     248             : int    pop_entree_block(entree *ep, long loc);
     249             : int    pop_val_if_newer(entree *ep, long loc);
     250             : 
     251             : /* general printing */
     252             : void print_errcontext(PariOUT *out, const char *msg, const char *s, const char *entry);
     253             : void print_prefixed_text(PariOUT *out, const char *s, const char *prefix, const char *str);
     254             : INLINE void
     255          56 : print_text(const char *s) { print_prefixed_text(pariOut, s,NULL,NULL); }
     256             : INLINE void
     257        5411 : out_print_text(PariOUT *out, const char *s) { print_prefixed_text(out, s,NULL,NULL); }
     258             : INLINE long
     259     1462415 : is_keyword_char(char c) { return (isalnum((int)c) || c=='_'); }
     260             : 
     261             : /* Interfaces (GP, etc.) */
     262             : hashtable *hash_from_link(GEN e, GEN names, int use_stack);
     263             : void gen_relink(GEN x, hashtable *table);
     264             : entree* do_alias(entree *ep);
     265             : char* get_sep(const char *t);
     266             : long get_int(const char *s, long dflt);
     267             : ulong get_uint(const char *s);
     268             : void gp_initrc(pari_stack *p_A);
     269             : 
     270             : void pari_sigint(const char *s);
     271             : pariFILE *pari_last_tmp_file(void);
     272             : void* get_stack(double fraction, long min);
     273             : void  init_graph(void);
     274             : void  free_graph(void);
     275             : void  initout(int initerr);
     276             : void  resetout(int initerr);
     277             : void  init_linewrap(long w);
     278             : void  print_functions_hash(const char *s);
     279             : GEN   readbin(const char *name, FILE *f, int *vector);
     280             : int   term_height(void);
     281             : int   term_width(void);
     282             : /* gp_colors */
     283             : void decode_color(long n, long *c);
     284             : 
     285             : /* defaults */
     286             : extern long precreal;
     287             : 
     288             : void lim_lines_output(char *s, long n, long max);
     289             : int tex2mail_output(GEN z, long n);
     290             : void gen_output(GEN x);
     291             : void fputGEN_pariout(GEN x, pariout_t *T, FILE *out);
     292             : 
     293             : void parsestate_reset(void);
     294             : void parsestate_save(struct pari_parsestate *state);
     295             : void parsestate_restore(struct pari_parsestate *state);
     296             : 
     297             : void compilestate_reset(void);
     298             : void compilestate_save(struct pari_compilestate *comp);
     299             : void compilestate_restore(struct pari_compilestate *comp);
     300             : 
     301             : void evalstate_clone(void);
     302             : void evalstate_reset(void);
     303             : void evalstate_restore(struct pari_evalstate *state);
     304             : GEN  evalstate_restore_err(struct pari_evalstate *state);
     305             : void evalstate_save(struct pari_evalstate *state);
     306             : void varstate_save(struct pari_varstate *s);
     307             : void varstate_restore(struct pari_varstate *s);
     308             : 
     309             : void mtstate_save(long *pending);
     310             : void mtstate_reset(void);
     311             : void mtstate_restore(long *pending);
     312             : 
     313             : void debug_context(void);
     314             : 
     315             : typedef struct {
     316             :   const char *s;
     317             :   size_t ls;
     318             :   char **dir;
     319             : } forpath_t;
     320             : void forpath_init(forpath_t *T, gp_path *path, const char *s);
     321             : char *forpath_next(forpath_t *T);
     322             : 
     323             : /* GP output && output format */
     324             : void gpwritebin(const char *s, GEN x);
     325             : extern char *current_logfile;
     326             : 
     327             : /* colors */
     328             : extern long    gp_colors[];
     329             : extern int     disable_color;
     330             : 
     331             : /* entrees */
     332             : #define EpVALENCE(ep) ((ep)->valence & 0xFF)
     333             : #define EpSTATIC(ep) ((ep)->valence & 0x100)
     334             : #define EpSETSTATIC(ep) ((ep)->valence |= 0x100)
     335             : enum { EpNEW = 100, EpALIAS, EpVAR, EpINSTALL };
     336             : #define initial_value(ep) ((ep)+1)
     337             : 
     338             : /* functions lists */
     339             : extern const long functions_tblsz;  /* hashcodes table size */
     340             : extern entree **functions_hash;   /* functions hashtable */
     341             : extern entree **defaults_hash;    /* defaults hashtable */
     342             : 
     343             : /* buffers */
     344             : typedef struct Buffer {
     345             :   char *buf;
     346             :   ulong len;
     347             :   jmp_buf env;
     348             : } Buffer;
     349             : Buffer *new_buffer(void);
     350             : void delete_buffer(Buffer *b);
     351             : void fix_buffer(Buffer *b, long newlbuf);
     352             : 
     353             : typedef struct {
     354             :   const char *s; /* source */
     355             :   char *t, *end; /* target, last char read */
     356             :   int in_string, in_comment, more_input, wait_for_brace;
     357             :   Buffer *buf;
     358             : } filtre_t;
     359             : void init_filtre(filtre_t *F, Buffer *buf);
     360             : Buffer *filtered_buffer(filtre_t *F);
     361             : void kill_buffers_upto_including(Buffer *B);
     362             : void pop_buffer(void);
     363             : void kill_buffers_upto(Buffer *B);
     364             : int gp_read_line(filtre_t *F, const char *PROMPT);
     365             : void parse_key_val(char *src, char **ps, char **pt);
     366             : extern int (*cb_pari_get_line_interactive)(const char*, const char*, filtre_t *F);
     367             : extern char *(*cb_pari_fgets_interactive)(char *s, int n, FILE *f);
     368             : int get_line_from_file(const char *prompt, filtre_t *F, FILE *file);
     369             : void pari_skip_space(char **s);
     370             : void pari_skip_alpha(char **s);
     371             : char *pari_translate_string(const char *src, char *s, char *entry);
     372             : 
     373             : gp_data *default_gp_data(void);
     374             : 
     375             : void delete_dirs(gp_path *p);
     376             : void gp_expand_path(gp_path *p);
     377             : 
     378             : typedef char *(*fgets_t)(char *, int, void*);
     379             : 
     380             : typedef struct input_method {
     381             : /* optional */
     382             :   fgets_t fgets;  /* like libc fgets() but last argument is (void*) */
     383             : /* mandatory */
     384             :   char * (*getline)(char**, int f, struct input_method*, filtre_t *F);
     385             :   int free; /* boolean: must we free the output of getline() ? */
     386             : /* optional */
     387             :   const char *prompt, *prompt_cont;
     388             :   void *file;  /* can be used as last argument for fgets() */
     389             : } input_method;
     390             : 
     391             : int input_loop(filtre_t *F, input_method *IM);
     392             : char *file_input(char **s0, int junk, input_method *IM, filtre_t *F);
     393             : char *file_getline(Buffer *b, char **s0, input_method *IM);
     394             : 
     395             : /* readline */
     396             : typedef struct {
     397             :   /* pointers to readline variables/functions */
     398             :   char **line_buffer;
     399             :   int *point;
     400             :   int *end;
     401             :   char **(*completion_matches)(const char *, char *(*)(const char*, int));
     402             :   char *(*filename_completion_function)(const char *, int);
     403             :   char *(*username_completion_function)(const char *, int);
     404             :   int (*insert)(int, int);
     405             :   int *completion_append_character;
     406             : 
     407             :   /* PARI-specific */
     408             :   int back;  /* rewind the cursor by this number of chars */
     409             : } pari_rl_interface;
     410             : 
     411             : /* Code which wants to use readline needs to do the following:
     412             : 
     413             : #include <readline.h>
     414             : #include <paripriv.h>
     415             : pari_rl_interface pari_rl;
     416             : pari_use_readline(pari_rl);
     417             : 
     418             : This will initialize the pari_rl structure. A pointer to this structure
     419             : must be given as first argument to all PARI readline functions. */
     420             : 
     421             : /* IMPLEMENTATION NOTE: this really must be a macro (not a function),
     422             :  * since we refer to readline symbols. */
     423             : #define pari_use_readline(pari_rl) do {\
     424             :     (pari_rl).line_buffer = &rl_line_buffer; \
     425             :     (pari_rl).point = &rl_point; \
     426             :     (pari_rl).end = &rl_end; \
     427             :     (pari_rl).completion_matches = &rl_completion_matches; \
     428             :     (pari_rl).filename_completion_function = &rl_filename_completion_function; \
     429             :     (pari_rl).username_completion_function = &rl_username_completion_function; \
     430             :     (pari_rl).insert = &rl_insert; \
     431             :     (pari_rl).completion_append_character = &rl_completion_append_character; \
     432             :     (pari_rl).back = 0; } while(0)
     433             : 
     434             : /* FIXME: EXPORT AND DOCUMENT THE FOLLOWING */
     435             : 
     436             : /* PROBABLY NOT IN THE RIGHT FILE, SORT BY THEME */
     437             : 
     438             : /* multiprecision */
     439             : GEN   adduispec_offset(ulong s, GEN x, long offset, long nx);
     440             : int   lgcdii(ulong* d, ulong* d1, ulong* u, ulong* u1, ulong* v, ulong* v1, ulong vmax);
     441             : ulong rgcduu(ulong d, ulong d1, ulong vmax, ulong* u, ulong* u1, ulong* v, ulong* v1, long *s);
     442             : ulong xgcduu(ulong d, ulong d1, int f, ulong* v, ulong* v1, long *s);
     443             : ulong xxgcduu(ulong d, ulong d1, int f, ulong* u, ulong* u1, ulong* v, ulong* v1, long *s);
     444             : GEN   divgunu(GEN x, ulong i);
     445             : GEN   divrunu(GEN x, ulong i);
     446             : GEN   muliispec(GEN x, GEN y, long nx, long ny);
     447             : GEN   red_montgomery(GEN T, GEN N, ulong inv);
     448             : GEN   sqrispec(GEN x, long nx);
     449             : ulong *convi(GEN x, long *l);
     450             : 
     451             : int approx_0(GEN x, GEN y);
     452             : GEN bernfrac_using_zeta(long n);
     453             : 
     454             : /* powers */
     455             : GEN    rpowuu(ulong a, ulong n, long prec);
     456             : 
     457             : /* floats */
     458             : double dabs(double s, double t);
     459             : double darg(double s, double t);
     460             : void   dcxlog(double s, double t, double *a, double *b);
     461             : double dnorm(double s, double t);
     462             : double dbllog2(GEN z);
     463             : 
     464             : /* hnf */
     465             : GEN hnfadd(GEN m,GEN p,GEN* ptdep,GEN* ptA,GEN* ptC,GEN extramat,GEN extraC);
     466             : GEN hnfadd_i(GEN m,GEN p,GEN* ptdep,GEN* ptA,GEN* ptC,GEN extramat,GEN extraC);
     467             : GEN hnfspec_i(GEN m,GEN p,GEN* ptdep,GEN* ptA,GEN* ptC,long k0);
     468             : GEN hnfspec(GEN m,GEN p,GEN* ptdep,GEN* ptA,GEN* ptC,long k0);
     469             : GEN mathnfspec(GEN x, GEN *ptperm, GEN *ptdep, GEN *ptB, GEN *ptC);
     470             : GEN ZM_hnfmodall_i(GEN x, GEN dm, long flag);
     471             : 
     472             : GEN LLL_check_progress(GEN Bnorm, long n0, GEN m, int final, long *ti_LLL);
     473             : 
     474             : /* integer factorization / discrete log */
     475             : ulong is_kth_power(GEN x, ulong p, GEN *pt);
     476             : GEN   mpqs(GEN N);
     477             : ulong gcduodd(ulong x, ulong y);
     478             : 
     479             : /* Polynomials */
     480             : /* a) Arithmetic/conversions */
     481             : GEN  addmulXn(GEN x, GEN y, long d);
     482             : GEN  addshiftpol(GEN x, GEN y, long d);
     483             : GEN  lift_if_rational(GEN x);
     484             : GEN  monomial(GEN a, long degpol, long v);
     485             : GEN  monomialcopy(GEN a, long degpol, long v);
     486             : GEN  mulmat_pol(GEN A, GEN x);
     487             : GEN  ser2pol_i(GEN x, long lx);
     488             : GEN  ser2rfrac_i(GEN x);
     489             : GEN  swap_vars(GEN b0, long v);
     490             : GEN  RgX_recipspec_shallow(GEN x, long l, long n);
     491             : 
     492             : /* b) Modular */
     493             : GEN  bezout_lift_fact(GEN T, GEN Tmod, GEN p, long e);
     494             : GEN  FpX_quad_root(GEN x, GEN p, int unknown);
     495             : GEN  polsym_gen(GEN P, GEN y0, long n, GEN T, GEN N);
     496             : GEN  ZXQ_charpoly_sqf(GEN A, GEN B, long *lambda, long v);
     497             : GEN  ZX_disc_all(GEN,ulong);
     498             : GEN  ZX_resultant_all(GEN A, GEN B, GEN dB, ulong bound);
     499             : GEN  ZX_ZXY_resultant_all(GEN A, GEN B, long *lambda, GEN *LPRS);
     500             : GEN  RgXQ_minpoly_naive(GEN y, GEN P);
     501             : 
     502             : /* c) factorization */
     503             : GEN chk_factors_get(GEN lt, GEN famod, GEN c, GEN T, GEN N);
     504             : long cmbf_maxK(long nb);
     505             : GEN ZX_DDF(GEN x);
     506             : GEN initgaloisborne(GEN T, GEN dn, long prec, GEN *pL, GEN *pprep, GEN *pdis);
     507             : GEN polint_i(GEN xa, GEN ya, GEN x, long n, GEN *ptdy);
     508             : GEN quicktrace(GEN x, GEN sym);
     509             : 
     510             : /* pari_init / pari_close */
     511             : void pari_close_compiler(void);
     512             : void pari_close_evaluator(void);
     513             : void pari_close_files(void);
     514             : void pari_close_floats(void);
     515             : void pari_close_homedir(void);
     516             : void pari_close_parser(void);
     517             : void pari_close_primes(void);
     518             : void pari_init_buffers(void);
     519             : void pari_init_compiler(void);
     520             : void pari_init_defaults(void);
     521             : void pari_init_evaluator(void);
     522             : void pari_init_files(void);
     523             : void pari_init_floats(void);
     524             : void pari_init_homedir(void);
     525             : void pari_init_parser(void);
     526             : void pari_init_rand(void);
     527             : void pari_init_primetab(void);
     528             : void pari_init_seadata(void);
     529             : void pari_pthread_init_primetab(void);
     530             : void pari_pthread_init_seadata(void);
     531             : void pari_pthread_init_varstate(void);
     532             : void pari_thread_close_files(void);
     533             : void pari_thread_init_primetab(void);
     534             : void pari_thread_init_seadata(void);
     535             : void pari_thread_init_varstate(void);
     536             : 
     537             : /* BY FILES */
     538             : 
     539             : /* parinf.h */
     540             : 
     541             : GEN fincke_pohst(GEN a,GEN BOUND,long stockmax,long PREC, FP_chk_fun *CHECK);
     542             : void init_zlog(zlog_S *S, GEN bid);
     543             : GEN  log_gen_arch(zlog_S *S, long index);
     544             : GEN  log_gen_pr(zlog_S *S, long index, GEN nf, long e);
     545             : /* conversions basis / alg */
     546             : /* nf a genuine NF, x an nfelt (t_COL) or t_MAT whose columns represent nfelts.
     547             :  * Return the corresponding elements as t_POLs (implicitly mod nf.pol) */
     548             : #define coltoliftalg(nf,x) (gmul(gel((nf),7), (x)))
     549             : GEN    poltobasis(GEN nf,GEN x);
     550             : GEN    coltoalg(GEN nf,GEN x);
     551             : 
     552             : GEN    get_arch_real(GEN nf,GEN x,GEN *emb,long prec);
     553             : GEN    get_proj_modT(GEN basis, GEN T, GEN p);
     554             : GEN    make_integral(GEN nf, GEN L0, GEN f, GEN listpr);
     555             : GEN    rnfallbase(GEN nf, GEN *ppol, GEN *pD, GEN *pd, GEN *pfi);
     556             : GEN    subgroupcondlist(GEN cyc, GEN bound, GEN listKer);
     557             : GEN    ideallog_sgn(GEN nf, GEN x, GEN sgn, GEN bid);
     558             : 
     559             : /* Qfb.c */
     560             : 
     561             : GEN     redimagsl2(GEN q, GEN *U);
     562             : GEN     redrealsl2(GEN V, GEN d, GEN rd);
     563             : GEN     redrealsl2step(GEN A, GEN d, GEN rd);
     564             : 
     565             : /* alglin1.c */
     566             : 
     567             : typedef long (*pivot_fun)(GEN,GEN,long,GEN);
     568             : GEN ZM_pivots(GEN x0, long *rr);
     569             : GEN RgM_pivots(GEN x0, GEN data, long *rr, pivot_fun pivot);
     570             : void RgMs_structelim_col(GEN M, long nbcol, long nbrow, GEN A, GEN *p_col, GEN *p_lin);
     571             : 
     572             : /* arith1.c */
     573             : 
     574             : int     is_gener_Fp(GEN x, GEN p, GEN p_1, GEN L);
     575             : int     is_gener_Fl(ulong x, ulong p, ulong p_1, GEN L);
     576             : 
     577             : /* arith2.c */
     578             : 
     579             : int     divisors_init(GEN n, GEN *pP, GEN *pE);
     580             : long    set_optimize(long what, GEN g);
     581             : 
     582             : /* base2.c */
     583             : 
     584             : GEN     dim1proj(GEN prh);
     585             : GEN     gen_if_principal(GEN bnf, GEN x);
     586             : GEN     polsymmodp(GEN g, GEN p);
     587             : GEN     nfbasis_gp(GEN T);
     588             : 
     589             : /* base3.c */
     590             : 
     591             : void    check_nfelt(GEN x, GEN *den);
     592             : GEN     zk_ei_mul(GEN nf, GEN x, long i);
     593             : GEN     zlog_pr(GEN nf, GEN a, GEN sprk);
     594             : GEN     vzlog_pr(GEN nf, GEN v, GEN sprk);
     595             : GEN     zlog_pr_init(GEN nf, GEN pr, long k);
     596             : 
     597             : /* base4.c */
     598             : 
     599             : GEN     factorbackprime(GEN nf, GEN L, GEN e);
     600             : 
     601             : /* bb_group.c */
     602             : 
     603             : GEN     producttree_scheme(long n);
     604             : 
     605             : /* bibli2.c */
     606             : 
     607             : GEN sort_factor_pol(GEN y, int (*cmp)(GEN,GEN));
     608             : 
     609             : /* buch1.c */
     610             : 
     611             : long   bnf_increase_LIMC(long LIMC, long LIMCMAX);
     612             : 
     613             : /* buch2.c */
     614             : 
     615             : typedef struct GRHprime_t { ulong p; double logp; GEN dec; } GRHprime_t;
     616             : typedef struct GRHcheck_t { double cD, cN; GRHprime_t *primes; long clone, nprimes, maxprimes; ulong limp; forprime_t P; } GRHcheck_t;
     617             : void    free_GRHcheck(GRHcheck_t *S);
     618             : void    init_GRHcheck(GRHcheck_t *S, long N, long R1, double LOGD);
     619             : void    GRH_ensure(GRHcheck_t *S, long nb);
     620             : ulong   GRH_last_prime(GRHcheck_t *S);
     621             : int     GRHok(GRHcheck_t *S, double L, double SA, double SB);
     622             : GEN     extract_full_lattice(GEN x);
     623             : GEN     init_red_mod_units(GEN bnf, long prec);
     624             : GEN     isprincipalarch(GEN bnf, GEN col, GEN kNx, GEN e, GEN dx, long *pe);
     625             : GEN     red_mod_units(GEN col, GEN z);
     626             : 
     627             : /* buch3.c */
     628             : 
     629             : GEN     minkowski_bound(GEN D, long N, long r2, long prec);
     630             : int     subgroup_conductor_ok(GEN H, GEN L);
     631             : GEN     subgrouplist_cond_sub(GEN bnr, GEN C, GEN bound);
     632             : 
     633             : /* buch4.c */
     634             : 
     635             : GEN     bnfsunit0(GEN bnf, GEN S, long flag, long prec);
     636             : 
     637             : /* crvwtors.c */
     638             : 
     639             : void random_curves_with_m_torsion(ulong *a4, ulong *a6, ulong *tx, ulong *ty, long ncurves, long m, ulong p);
     640             : 
     641             : /* elliptic.c */
     642             : 
     643             : void ellprint(GEN e);
     644             : 
     645             : /* es.c */
     646             : 
     647             : const char * eng_ord(long i);
     648             : void    filestate_restore(pariFILE *F);
     649             : void    killallfiles(void);
     650             : pariFILE* newfile(FILE *f, const char *name, int type);
     651             : int     popinfile(void);
     652             : pariFILE* try_pipe(const char *cmd, int flag);
     653             : 
     654             : /* Flx.c */
     655             : 
     656             : GEN FlxqM_mul_Kronecker(GEN A, GEN B, GEN T, ulong p);
     657             : 
     658             : /* Flxq_log.c */
     659             : 
     660             : GEN Flxq_log_index(GEN a0, GEN b0, GEN m, GEN T0, ulong p);
     661             : int Flxq_log_use_index(GEN m, GEN T0, ulong p);
     662             : 
     663             : /* FlxqE.c */
     664             : 
     665             : GEN     ZpXQ_norm_pcyc(GEN x, GEN T, GEN q, GEN p);
     666             : long    zx_is_pcyc(GEN T);
     667             : 
     668             : /* FpV.c */
     669             : 
     670             : GEN FpMs_leftkernel_elt_col(GEN M, long nbcol, long nbrow, GEN p);
     671             : 
     672             : /* forprime.c*/
     673             : 
     674             : void    init_modular(forprime_t *S);
     675             : void    init_modular_big(forprime_t *S);
     676             : void    init_modular_small(forprime_t *S);
     677             : 
     678             : /* galconj.c */
     679             : 
     680             : GEN     galoiscosets(GEN O, GEN perm);
     681             : GEN     matrixnorm(GEN M, long prec);
     682             : 
     683             : /* galois.c */
     684             : 
     685             : GEN     polgaloisnamesbig(long n, long k);
     686             : 
     687             : /* gen1.c */
     688             : 
     689             : int     ff_poltype(GEN *x, GEN *p, GEN *pol);
     690             : GEN     gred_rfrac_simple(GEN n, GEN d);
     691             : GEN     sqr_ser_part(GEN x, long l1, long l2);
     692             : 
     693             : /* gen3.c */
     694             : 
     695             : GEN     gsubst_expr(GEN pol, GEN from, GEN to);
     696             : GEN     poltoser(GEN x, long v, long prec);
     697             : GEN     rfractoser(GEN x, long v, long prec);
     698             : 
     699             : /* hash.c */
     700             : 
     701             : hashtable *hashstr_import_static(hashentry *e, ulong size);
     702             : 
     703             : /* hyperell.c */
     704             : 
     705             : GEN     ZlXQX_hyperellpadicfrobenius(GEN H, GEN T, ulong p, long n);
     706             : 
     707             : /* ifactor1.c */
     708             : 
     709             : GEN     ellfacteur(GEN n, int insist);
     710             : ulong   snextpr(ulong p, byteptr *d, long *rcn, long *q, long k);
     711             : 
     712             : /* intnum.c */
     713             : 
     714             : GEN     contfraceval_inv(GEN CF, GEN tinv, long nlim);
     715             : 
     716             : /* prime.c */
     717             : 
     718             : long    BPSW_psp_nosmalldiv(GEN N);
     719             : int     Fl_MR_Jaeschke(ulong n, long k);
     720             : int     MR_Jaeschke(GEN n);
     721             : long    isanypower_nosmalldiv(GEN N, GEN *px);
     722             : void    prime_table_next_p(ulong a, byteptr *pd, ulong *pp, ulong *pn);
     723             : 
     724             : /* perm.c */
     725             : 
     726             : long    cosets_perm_search(GEN C, GEN p);
     727             : GEN     group_export_GAP(GEN G);
     728             : GEN     group_export_MAGMA(GEN G);
     729             : GEN     perm_generate(GEN S, GEN H, long o);
     730             : long    perm_relorder(GEN p, GEN S);
     731             : GEN     perm_to_GAP(GEN p);
     732             : 
     733             : /* polarit1.c */
     734             : 
     735             : GEN     F2x_factcantor(GEN f, long flag);
     736             : GEN     Flx_factcantor(GEN f, ulong p, long flag);
     737             : GEN     FpX_factcantor(GEN f, GEN pp, long flag);
     738             : GEN     factcantor0(GEN f, GEN pp, long flag);
     739             : 
     740             : /* polarit2.c */
     741             : 
     742             : GEN     sylvestermatrix_i(GEN x, GEN y);
     743             : 
     744             : /* polclass.c */
     745             : 
     746             : GEN polclass0(long D, long inv, long xvar, GEN *db);
     747             : 
     748             : /* polmodular.c */
     749             : 
     750             : GEN polmodular0_ZM(long L, long inv, GEN J, GEN Q, int compute_derivs, GEN *db);
     751             : GEN Flm_Fl_polmodular_evalx(GEN phi, long L, ulong j, ulong p, ulong pi);
     752             : GEN polmodular_db_init(long inv);
     753             : void polmodular_db_clear(GEN db);
     754             : void polmodular_db_add_level(GEN *db, long L, long inv);
     755             : void polmodular_db_add_levels(GEN *db, long *levels, long k, long inv);
     756             : GEN polmodular_db_for_inv(GEN db, long inv);
     757             : GEN polmodular_db_getp(GEN fdb, long L, ulong p);
     758             : 
     759             : long disc_best_inv(long D);
     760             : int inv_is_valid(long inv);
     761             : long inv_level(long inv);
     762             : long inv_degree(long *p1, long *p2, long inv);
     763             : long inv_ramified(long D, long inv);
     764             : double inv_height_factor(long inv);
     765             : int inv_good_discriminant(long D, long inv);
     766             : int inv_good_prime(long p, long inv);
     767             : int inv_weber(long inv);
     768             : int inv_double_eta(long inv);
     769             : long inv_j_from_2double_eta(GEN F, long inv, ulong *j, ulong x0, ulong x1, ulong p, ulong pi);
     770             : GEN double_eta_raw(long inv);
     771             : ulong modfn_root(ulong j, norm_eqn_t ne, long inv);
     772             : long modfn_unambiguous_root(ulong *r, long inv, ulong j0, norm_eqn_t ne, GEN jdb);
     773             : GEN qfb_nform(long D, long n);
     774             : 
     775             : /* Fle.c */
     776             : 
     777             : ulong   Flj_order_ufact(GEN P, ulong n, GEN F, ulong a4, ulong p, ulong pi);
     778             : 
     779             : /* polarit3.c */
     780             : 
     781             : GEN     Flm_Frobenius_pow(GEN M, long d, GEN T, ulong p);
     782             : GEN     FpM_Frobenius_pow(GEN M, long d, GEN T, GEN p);
     783             : GEN     FpX_compositum(GEN A, GEN B, GEN p);
     784             : GEN     FpX_direct_compositum(GEN A, GEN B, GEN p);
     785             : ulong   ZX_ZXY_ResBound(GEN A, GEN B, GEN dB);
     786             : GEN     ffinit_Artin_Shreier(GEN ip, long l);
     787             : GEN     ffinit_rand(GEN p, long n);
     788             : 
     789             : /* readline.c */
     790             : 
     791             : char**  pari_completion(pari_rl_interface *pari_rl, char *text, int START, int END);
     792             : char*   pari_completion_word(pari_rl_interface *pari_rl, long end);
     793             : char**  pari_completion_matches(pari_rl_interface *pari_rl, const char *s, long pos, long *wordpos);
     794             : 
     795             : /* rootpol.c */
     796             : 
     797             : GEN     FFT(GEN x, GEN Omega);
     798             : GEN     FFTinit(long k, long prec);
     799             : 
     800             : /* subcyclo.c */
     801             : 
     802             : GEN     bnr_to_znstar(GEN bnr, long *complex);
     803             : GEN     galoiscyclo(long n, long v);
     804             : GEN     znstar_bits(long n, GEN H);
     805             : long    znstar_conductor(long n, GEN H);
     806             : GEN     znstar_cosets(long n, long phi_n, GEN H);
     807             : GEN     znstar_elts(long n, GEN H);
     808             : GEN     znstar_generate(long n, GEN V);
     809             : GEN     znstar_hnf(GEN Z, GEN M);
     810             : GEN     znstar_hnf_elts(GEN Z, GEN H);
     811             : GEN     znstar_hnf_generators(GEN Z, GEN M);
     812             : GEN     znstar_reduce_modulus(GEN H, long n);
     813             : GEN     znstar_small(GEN zn);
     814             : 
     815             : /* trans1.c */
     816             : 
     817             : struct abpq { GEN *a, *b, *p, *q; };
     818             : struct abpq_res { GEN P, Q, B, T; };
     819             : void    abpq_init(struct abpq *A, long n);
     820             : void    abpq_sum(struct abpq_res *r, long n1, long n2, struct abpq *A);
     821             : GEN     logagmcx(GEN q, long prec);
     822             : GEN     zellagmcx(GEN a0, GEN b0, GEN r, GEN t, long prec);
     823             : 
     824             : /* trans2.c */
     825             : 
     826             : GEN     trans_fix_arg(long *prec, GEN *s0, GEN *sig, GEN *tau, pari_sp *av, GEN *res);
     827             : 
     828             : /* trans3.c */
     829             : 
     830             : GEN     bernreal_using_zeta(long n, GEN iz, long prec);
     831             : GEN     double_eta_quotient(GEN a, GEN w, GEN D, long p, long q, GEN pq, GEN sqrtD);
     832             : GEN     inv_szeta_euler(long n, double lba, long prec);
     833             : GEN     trueE2(GEN tau, long prec);
     834             : 
     835             : /* volcano.c */
     836             : 
     837             : long j_level_in_volcano(GEN phi, ulong j, ulong p, ulong pi, long L, long depth);
     838             : ulong ascend_volcano(GEN phi, ulong j, ulong p, ulong pi, long level, long L, long depth, long steps);
     839             : ulong descend_volcano(GEN phi, ulong j, ulong p, ulong pi, long level, long L, long depth, long steps);
     840             : long next_surface_nbr(ulong *nJ, GEN phi, long L, long h, ulong J, const ulong *pJ, ulong p, ulong pi);
     841             : GEN enum_roots(ulong j, norm_eqn_t ne, GEN fdb, classgp_pcp_t G);
     842             : 
     843             : ENDEXTERN

Generated by: LCOV version 1.11