Pari/GP Reference Documentation HOME Contents - Global index - GP keyboard shortcuts

GP defaults


TeXstyle   breakloop   colors   compatible   datadir   debug   debugfiles   debugmem   echo   factor_add_primes   factor_proven   format   graphcolormap   graphcolors   help   histfile   histsize   lines   linewrap   log   logfile   nbthreads   new_galois_format   output   parisize   parisizemax   path   prettyprinter   primelimit   prompt   prompt_cont   psfile   readline   realbitprecision   realprecision   recover   secure   seriesprecision   simplify   sopath   strictargs   strictmatch   threadsize   threadsizemax   timer  
 

This section documents the GP defaults, be sure to check out parisize and parisizemax !

TeXstyle HOME   TOP

The bits of this default allow gp to use less rigid TeX formatting commands in the logfile. This default is only taken into account when log = 3. The bits of TeXstyle have the following meaning

2: insert \right / \left pairs where appropriate.

4: insert discretionary breaks in polynomials, to enhance the probability of a good line break.

The default value is 0.

breakloop HOME   TOP

If true, enables the "break loop" debugging mode, see Section se:break_loop.

The default value is 1 if we are running an interactive gp session, and 0 otherwise.

colors HOME   TOP

This default is only usable if gp is running within certain color-capable terminals. For instance rxvt, color_xterm and modern versions of xterm under X Windows, or standard Linux/DOS text consoles. It causes gp to use a small palette of colors for its output. With xterms, the colormap used corresponds to the resources Xterm*colorn where n ranges from 0 to 15 (see the file misc/color.dft for an example). Accepted values for this default are strings "a_1,...,a_k" where k ≤ 7 and each a_i is either

* the keyword no (use the default color, usually black on transparent background)

* an integer between 0 and 15 corresponding to the aforementioned colormap

* a triple [c_0,c_1,c_2] where c_0 stands for foreground color, c_1 for background color, and c_2 for attributes (0 is default, 1 is bold, 4 is underline).

The output objects thus affected are respectively error messages, history numbers, prompt, input line, output, help messages, timer (that's seven of them). If k < 7, the remaining a_i are assumed to be no. For instance

  default(colors, "9, 5, no, no, 4")

typesets error messages in color 9, history numbers in color 5, output in color 4, and does not affect the rest.

A set of default colors for dark (reverse video or PC console) and light backgrounds respectively is activated when colors is set to darkbg, resp. lightbg (or any proper prefix: d is recognized as an abbreviation for darkbg). A bold variant of darkbg, called boldfg, is provided if you find the former too pale.

In the present version, this default is incompatible with PariEmacs. Changing it will just fail silently (the alternative would be to display escape sequences as is, since Emacs will refuse to interpret them). You must customize color highlighting from the PariEmacs side, see its documentation.

The default value is "" (no colors).

compatible HOME   TOP

Obsolete. This default is now a no-op.

datadir HOME   TOP

The name of directory containing the optional data files. For now, this includes the elldata, galdata, galpol, seadata packages.

The default value is /usr/local/share/pari, or the override specified via Configure --datadir = .

debug HOME   TOP

Debugging level. If it is non-zero, some extra messages may be printed, according to what is going on (see \g).

The default value is 0 (no debugging messages).

debugfiles HOME   TOP

File usage debugging level. If it is non-zero, gp will print information on file descriptors in use, from PARI's point of view (see \gf).

The default value is 0 (no debugging messages).

debugmem HOME   TOP

Memory debugging level. If it is non-zero, gp will regularly print information on memory usage. If it's greater than 2, it will indicate any important garbage collecting and the function it is taking place in (see \gm).

Important Note: As it noticeably slows down the performance, the first functionality (memory usage) is disabled if you're not running a version compiled for debugging (see Appendix A).

The default value is 0 (no debugging messages).

echo HOME   TOP

This toggle is either 1 (on) or 0 (off). When echo mode is on, each command is reprinted before being executed. This can be useful when reading a file with the \r or read commands. For example, it is turned on at the beginning of the test files used to check whether gp has been built correctly (see \e).

The default value is 0 (no echo).

factor_add_primes HOME   TOP

This toggle is either 1 (on) or 0 (off). If on, the integer factorization machinery calls addprimes on prime factors that were difficult to find (larger than 2^{24}), so they are automatically tried first in other factorizations. If a routine is performing (or has performed) a factorization and is interrupted by an error or via Control-C, this lets you recover the prime factors already found. The downside is that a huge addprimes table unrelated to the current computations will slow down arithmetic functions relying on integer factorization; one should then empty the table using removeprimes.

The default value is 0.

factor_proven HOME   TOP

This toggle is either 1 (on) or 0 (off). By default, the factors output by the integer factorization machinery are only pseudo-primes, not proven primes. If this toggle is set, a primality proof is done for each factor and all results depending on integer factorization are fully proven. This flag does not affect partial factorization when it is explicitly requested. It also does not affect the private table managed by addprimes: its entries are included as is in factorizations, without being tested for primality.

The default value is 0.

format HOME   TOP

Of the form x.n, where x (conversion style) is a letter in {e,f,g}, and n (precision) is an integer; this affects the way real numbers are printed:

* If the conversion style is e, real numbers are printed in scientific format, always with an explicit exponent, e.g. 3.3 E-5.

* In style f, real numbers are generally printed in fixed floating point format without exponent, e.g. 0.000033. A large real number, whose integer part is not well defined (not enough significant digits), is printed in style e. For instance 10.^100 known to ten significant digits is always printed in style e.

* In style g, non-zero real numbers are printed in f format, except when their decimal exponent is < -4, in which case they are printed in e format. Real zeroes (of arbitrary exponent) are printed in e format.

The precision n is the number of significant digits printed for real numbers, except if n < 0 where all the significant digits will be printed (initial default 28, or 38 for 64-bit machines). For more powerful formatting possibilities, see printf and Strprintf.

The default value is "g.28" and "g.38" on 32-bit and 64-bit machines, respectively.

graphcolormap HOME   TOP

A vector of colors, to be used by hi-res graphing routines. Its length is arbitrary, but it must contain at least 3 entries: the first 3 colors are used for background, frame/ticks and axes respectively. All colors in the colormap may be freely used in plotcolor calls.

A color is either given as in the default by character strings or by an RGB code. For valid character strings, see the standard rgb.txt file in X11 distributions, where we restrict to lowercase letters and remove all whitespace from color names. An RGB code is a vector with 3 integer entries between 0 and 255. For instance [250, 235, 215] and "antiquewhite" represent the same color. RGB codes are cryptic but often easier to generate.

The default value is ["white", "black", "blue", "violetred", "red", "green", "grey", "gainsboro"].

graphcolors HOME   TOP

Entries in the graphcolormap that will be used to plot multi-curves. The successive curves are drawn in colors

graphcolormap[graphcolors[1]], graphcolormap[graphcolors[2]], ...

cycling when the graphcolors list is exhausted.

The default value is [4,5].

help HOME   TOP

Name of the external help program to use from within gp when extended help is invoked, usually through a ?? or ??? request (see Section se:exthelp), or M-H under readline (see Section se:readline).

The default value is the path to the gphelp script we install.

histfile HOME   TOP

Name of a file where gp will keep a history of all input commands (results are omitted). If this file exists when the value of histfile changes, it is read in and becomes part of the session history. Thus, setting this default in your gprc saves your readline history between sessions. Setting this default to the empty string "" changes it to < undefined >

The default value is < undefined > (no history file).

histsize HOME   TOP

gp keeps a history of the last histsize results computed so far, which you can recover using the % notation (see Section se:history). When this number is exceeded, the oldest values are erased. Tampering with this default is the only way to get rid of the ones you do not need anymore.

The default value is 5000.

lines HOME   TOP

If set to a positive value, gp prints at most that many lines from each result, terminating the last line shown with [+++] if further material has been suppressed. The various print commands (see Section se:gp_program) are unaffected, so you can always type print(%) or \a to view the full result. If the actual screen width cannot be determined, a "line" is assumed to be 80 characters long.

The default value is 0.

linewrap HOME   TOP

If set to a positive value, gp wraps every single line after printing that many characters.

The default value is 0 (unset).

log HOME   TOP

This can be either 0 (off) or 1, 2, 3 (on, see below for the various modes). When logging mode is turned on, gp opens a log file, whose exact name is determined by the logfile default. Subsequently, all the commands and results will be written to that file (see \l). In case a file with this precise name already existed, it will not be erased: your data will be appended at the end.

The specific positive values of log have the following meaning

1: plain logfile

2: emit color codes to the logfile (if colors is set).

3: write LaTeX output to the logfile (can be further customized using TeXstyle).

The default value is 0.

logfile HOME   TOP

Name of the log file to be used when the log toggle is on. Environment and time expansion are performed.

The default value is "pari.log".

nbthreads HOME   TOP

Number of threads to use for parallel computing. The exact meaning an default depend on the mt engine used:

* single: not used (always one thread).

* pthread: number of threads (unlimited, default: number of core)

* mpi: number of MPI process to use (limited to the number allocated by mpirun, default: use all allocated process).

new_galois_format HOME   TOP

This toggle is either 1 (on) or 0 (off). If on, the polgalois command will use a different, more consistent, naming scheme for Galois groups. This default is provided to ensure that scripts can control this behavior and do not break unexpectedly.

The default value is 0. This value will change to 1 (set) in the next major version.

output HOME   TOP

There are three possible values: 0 ( =  raw), 1 ( =  prettymatrix), or 3 ( =  external prettyprint). This means that, independently of the default format for reals which we explained above, you can print results in three ways:

* raw format, i.e. a format which is equivalent to what you input, including explicit multiplication signs, and everything typed on a line instead of two dimensional boxes. This can have several advantages, for instance it allows you to pick the result with a mouse or an editor, and to paste it somewhere else.

* prettymatrix format: this is identical to raw format, except that matrices are printed as boxes instead of horizontally. This is prettier, but takes more space and cannot be used for input. Column vectors are still printed horizontally.

* external prettyprint: pipes all gp output in TeX format to an external prettyprinter, according to the value of prettyprinter. The default script (tex2mail) converts its input to readable two-dimensional text.

Independently of the setting of this default, an object can be printed in any of the three formats at any time using the commands \a and \m and \B respectively.

The default value is 1 (prettymatrix).

parisize HOME   TOP

gp, and in fact any program using the PARI library, needs a stack in which to do its computations; parisize is the stack size, in bytes. It is recommended to increase this default using a gprc, to the value you believe PARI should be happy with, given your typical computation. We strongly recommend to also set parisizemax to a much larger value, about what you believe your machine can stand: PARI will then try to fit its computations within about parisize bytes, but will increase the stack size if needed (up to parisizemax). Once the memory intensive computation is over, PARI will restore the stack size to the originally requested parisize.

The default value is 4M, resp. 8M on a 32-bit, resp. 64-bit machine.

parisizemax HOME   TOP

gp, and in fact any program using the PARI library, needs a stack in which to do its computations. If non-zero, parisizemax is the maximum size the stack can grow to, in bytes. If zero, the stack will not automatically grow, and will be limited to the value of parisize.

We strongly recommend to set parisizemax to a non-zero value, about what you believe your machine can stand: PARI will then try to fit its computations within about parisize bytes, but will increase the stack size if needed (up to parisizemax). Once the memory intensive computation is over, PARI will restore the stack size to the originally requested parisize.

The default value is 0.

path HOME   TOP

This is a list of directories, separated by colons ':' (semicolons ';' in the DOS world, since colons are preempted for drive names). When asked to read a file whose name is not given by an absolute path (does not start with /, ./ or ../), gp will look for it in these directories, in the order they were written in path. Here, as usual, . means the current directory, and .. its immediate parent. Environment expansion is performed.

The default value is ".:~:~/gp" on UNIX systems, ".;C:\;C:\GP" on DOS, OS/2 and Windows, and "." otherwise.

prettyprinter HOME   TOP

The name of an external prettyprinter to use when output is 3 (alternate prettyprinter). Note that the default tex2mail looks much nicer than the built-in "beautified format" (output = 2).

The default value is "tex2mail -TeX -noindent -ragged -by_par".

primelimit HOME   TOP

gp precomputes a list of all primes less than primelimit at initialization time, and can build fast sieves on demand to quickly iterate over primes up to the square of primelimit. These are used by many arithmetic functions, usually for trial division purposes. The maximal value is 2^{32} - 2049 (resp 2^{64} - 2049) on a 32-bit (resp. 64-bit) machine, but values beyond 10^8, allowing to iterate over primes up to 10^{16}, do not seem useful.

Since almost all arithmetic functions eventually require some table of prime numbers, PARI guarantees that the first 6547 primes, up to and including 65557, are precomputed, even if primelimit is 1.

This default is only used on startup: changing it will not recompute a new table.

Deprecated feature. primelimit was used in some situations by algebraic number theory functions using the nf_PARTIALFACT flag (nfbasis, nfdisc, nfinit,...): this assumes that all primes p > primelimit have a certain property (the equation order is p-maximal). This is never done by default, and must be explicitly set by the user of such functions. Nevertheless, these functions now provide a more flexible interface, and their use of the global default primelimit is deprecated.

Deprecated feature. factor(N, 0) was used to partially factor integers by removing all prime factors ≤ primelimit. Don't use this, supply an explicit bound: factor(N, bound), which avoids relying on an unpredictable global variable.

The default value is 500k.

prompt HOME   TOP

A string that will be printed as prompt. Note that most usual escape sequences are available there: \e for Esc, \n for Newline,..., \\ for \. Time expansion is performed.

This string is sent through the library function strftime (on a Unix system, you can try man strftime at your shell prompt). This means that % constructs have a special meaning, usually related to the time and date. For instance, %H = hour (24-hour clock) and %M = minute [00,59] (use %% to get a real %).

If you use readline, escape sequences in your prompt will result in display bugs. If you have a relatively recent readline (see the comment at the end of Section se:def,colors), you can brace them with special sequences (\[ and \]), and you will be safe. If these just result in extra spaces in your prompt, then you'll have to get a more recent readline. See the file misc/gprc.dft for an example.

S< >Caution: PariEmacs needs to know about the prompt pattern to separate your input from previous gp results, without ambiguity. It is not a trivial problem to adapt automatically this regular expression to an arbitrary prompt (which can be self-modifying!). See PariEmacs's documentation.

The default value is "? ".

prompt_cont HOME   TOP

A string that will be printed to prompt for continuation lines (e.g. in between braces, or after a line-terminating backslash). Everything that applies to prompt applies to prompt_cont as well.

The default value is "".

psfile HOME   TOP

Name of the default file where gp is to dump its PostScript drawings (these are appended, so that no previous data are lost). Environment and time expansion are performed.

The default value is "pari.ps".

readline HOME   TOP

Switches readline line-editing facilities on and off. This may be useful if you are running gp in a Sun cmdtool, which interacts badly with readline. Of course, until readline is switched on again, advanced editing features like automatic completion and editing history are not available.

The default value is 1.

realbitprecision HOME   TOP

The number of significant bits used to convert exact inputs given to transcendental functions (see Section se:trans), or to create absolute floating point constants (input as 1.0 or Pi for instance). Unless you tamper with the format default, this is also the number of significant bits used to print a t_REAL number; format will override this latter behaviour, and allow you to have a large internal precision while outputting few digits for instance.

Note that most PARI's functions currently handle precision on a word basis (by increments of 32 or 64 bits), hence bit precision may be a little larger than the number of bits you expected. For instance to get 10 bits of precision, you need one word of precision which, on a 64-bit machine, correspond to 64 bits. To make things even more confusing, this internal bit accuracy is converted to decimal digits when printing floating point numbers: now 64 bits correspond to 19 printed decimal digits (19 < log_{10}(2^{64}) < 20).

The value returned when typing default(realbitprecision) is the internal number of significant bits, not the number of printed decimal digits:

  ? default(realbitprecision, 10)
  ? \pb
        realbitprecision = 64 significant bits
  ? default(realbitprecision)
  %1 = 64
  ? \p
        realprecision = 3 significant digits
  ? default(realprecision)
  %2 = 19

Note that realprecision and \p allow to view and manipulate the internal precision in decimal digits.

The default value is 128, resp. 96, on a 64-bit, resp .32-bit, machine.

realprecision HOME   TOP

The number of significant digits used to convert exact inputs given to transcendental functions (see Section se:trans), or to create absolute floating point constants (input as 1.0 or Pi for instance). Unless you tamper with the format default, this is also the number of significant digits used to print a t_REAL number; format will override this latter behaviour, and allow you to have a large internal precision while outputting few digits for instance.

Note that PARI's internal precision works on a word basis (by increments of 32 or 64 bits), hence may be a little larger than the number of decimal digits you expected. For instance to get 2 decimal digits you need one word of precision which, on a 64-bit machine, actually gives you 19 digits (19 < log_{10}(2^{64}) < 20). The value returned when typing default(realprecision) is the internal number of significant digits, not the number of printed digits:

  ? default(realprecision, 2)
        realprecision = 19 significant digits (2 digits displayed)
  ? default(realprecision)
  %1 = 19

The default value is 38, resp. 28, on a 64-bit, resp. 32-bit, machine.

recover HOME   TOP

This toggle is either 1 (on) or 0 (off). If you change this to 0, any error becomes fatal and causes the gp interpreter to exit immediately. Can be useful in batch job scripts.

The default value is 1.

secure HOME   TOP

This toggle is either 1 (on) or 0 (off). If on, the system and extern command are disabled. These two commands are potentially dangerous when you execute foreign scripts since they let gp execute arbitrary UNIX commands. gp will ask for confirmation before letting you (or a script) unset this toggle.

The default value is 0.

seriesprecision HOME   TOP

Number of significant terms when converting a polynomial or rational function to a power series (see \ps).

The default value is 16.

simplify HOME   TOP

This toggle is either 1 (on) or 0 (off). When the PARI library computes something, the type of the result is not always the simplest possible. The only type conversions which the PARI library does automatically are rational numbers to integers (when they are of type t_FRAC and equal to integers), and similarly rational functions to polynomials (when they are of type t_RFRAC and equal to polynomials). This feature is useful in many cases, and saves time, but can be annoying at times. Hence you can disable this and, whenever you feel like it, use the function simplify (see Chapter 3) which allows you to simplify objects to the simplest possible types recursively (see \y).

The default value is 1.

sopath HOME   TOP

This is a list of directories, separated by colons ':' (semicolons ';' in the DOS world, since colons are preempted for drive names). When asked to install an external symbol from a shared library whose name is not given by an absolute path (does not start with /, ./ or ../), gp will look for it in these directories, in the order they were written in sopath. Here, as usual, . means the current directory, and .. its immediate parent. Environment expansion is performed.

The default value is "", corresponding to an empty list of directories: install will use the library name as input (and look in the current directory if the name is not an absolute path).

strictargs HOME   TOP

This toggle is either 1 (on) or 0 (off). If on, all arguments to new user functions are mandatory unless the function supplies an explicit default value. Otherwise arguments have the default value 0.

In this example,

    fun(a,b=2)=a+b

a is mandatory, while b is optional. If strictargs is on:

  ? fun()
   ***   at top-level: fun()
   ***                 ^-----
   ***   in function fun: a,b=2
   ***                    ^-----
   ***   missing mandatory argument 'a' in user function.

This applies to functions defined while strictargs is on. Changing strictargs does not affect the behavior of previously defined functions.

The default value is 0.

strictmatch HOME   TOP

Obsolete. This toggle is now a no-op.

threadsize HOME   TOP

In parallel mode, each thread needs its own private stack in which to do its computations, see parisize. This value determines the size in bytes of the stacks of each thread, so the total memory allocated will be parisize+nbthreads x threadsize.

If set to 0, the value used is the same as parisize.

The default value is 0.

threadsizemax HOME   TOP

In parallel mode, each threads needs its own private stack in which to do its computations, see parisize. This value determines the maximal size in bytes of the stacks of each thread, so the total memory allocated will be between parisize+nbthreads x threadsize. and parisize+nbthreads x threadsizemax.

If set to 0, the value used is the same as threadsize.

The default value is 0.

timer HOME   TOP

This toggle is either 1 (on) or 0 (off). Every instruction sequence in the gp calculator (anything ended by a newline in your input) is timed, to some accuracy depending on the hardware and operating system. When timer is on, each such timing is printed immediately before the output as follows:

  ? factor(2^2^7+1)
  time = 108 ms.     \\ this line omitted if 'timer' is 0
  %1 =
  [     59649589127497217 1]
  
  [5704689200685129054721 1]

(See also # and ##.)

The time measured is the user CPU time, not including the time for printing the results. If the time is negligible ( < 1 ms.), nothing is printed: in particular, no timing should be printed when defining a user function or an alias, or installing a symbol from the library.

The default value is 0 (off).