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

Generated by: LCOV version 1.11