Annotation of OpenXM_contrib/pari-2.2/examples/EXPLAIN, Revision 1.2
1.1 noro 1: This directory contains:
2:
3: * the C program matexp.c using the Pari library described in Chapter 4 of
4: the users' manual. A generic Makefile (adapted to your system by Configure)
5: for PARI programs is included.
6:
7: * Inputrc: an example of .inputrc file for the readline library.
8:
9: * Several examples of complete and non-trivial GP programs. The rest of this
10: file gives a brief description of these programs. They should be read into GP
11: by the command \r file.
12:
13: -- bench.gp: This program computes the first 1000 terms of the Fibonacci
14: sequence, the product p of successive terms, and the lowest common multiple
15: q. It outputs the ratio log(p)/log(q) every 50 terms (this ratio tends to
1.2 ! noro 16: Pi^2/6 as k tends to infinity). The name bench.gp comes from the fact that
1.1 noro 17: this program is one (among many) examples where GP/PARI performs orders of
18: magnitude faster than systems such as Maple or Mathematica (try it!).
19:
20: -- cl.gp: Written entirely in the GP language without using bnfclassunit, the
21: programs included in this file allows you in many cases to compute the class
22: number, the structure of the class group and a system of fundamental units of
23: a general number field (they sometimes fail to give an answer). It can work
1.2 ! noro 24: only if nfinit finds a power basis. Evidently it is much less powerful, less
! 25: reliable and much slower than bnfinit, but it is given as an example of a
! 26: sophisticated use of GP. The first thing to do is to call
! 27:
! 28: clareg(pol, {limp=19},{lima=50},{extra=5})
! 29:
! 30: where pol is the monic irreducible polynomial defining the number field, limp
! 31: is the prime factor base limit (try values between 19 and 113), lima is
! 32: another search limit (try 50 or 100) and extra is the number of desired extra
! 33: relations (try 2 to 10). Default values are provided, so that you need only
! 34: supply pol.
1.1 noro 35:
36: The program prints the number of relations that it needs, and tries to find
1.2 ! noro 37: them. If you see that it slows down too much before succeeding, abort and try
! 38: other values. If it succeeds, it will print the class number, class group,
! 39: regulator. These are tentative values. Then use
! 40:
! 41: check({lim = 100})
! 42:
! 43: to check if the value is consistent with the value of the L-series (the value
! 44: returned should be close to 1). Finally,
! 45:
! 46: fu() (no parameters)
! 47:
! 48: returns a family of units which generates the unit group (you must extract a
! 49: system of fundamental units yourself).
1.1 noro 50:
51: -- classno.gp: A very simple function to compute analytically the class
52: number of imaginary quadratic fields (written by Fernando Rodriguez Villegas)
53:
54: -- contfrac.gp: period(D) computes period of continued fraction for sqrt(D)
55: [much slower than quadregulator, which does a bit more work, but is written
56: in C!] (written by Igor Schein)
57:
58: -- lucas.gp: The function lucas(p) defined in this file performs the
59: Lucas-Lehmer primality test on the Mersenne number 2^p-1. If the result is
60: 1, the Mersenne number is prime, otherwise not.
61:
62: -- rho.gp: A simple implementation of Pollard's rho method. The function
63: rho(n) outputs the complete factorization of n in the same format as factor.
64:
65: -- squfof.gp: This defines a function squfof of a positive integer variable
66: n, which may allow you to factor the number n. SQUFOF is a very nice
67: factoring method invented in the 70's by D. Shanks for factoring integers,
68: and is reasonably fast for numbers having up to 15 or 16 digits. The squfof
69: program which is given is a very crude implementation. It also prints out
70: some intermediate information as it goes along. The final result is some
71: factor of the number to be factored.
72:
73: -- taylor.gp: Given a user function f (e.g defined by f(x) = sin(x)), defines
1.2 ! noro 74: a function
! 75:
! 76: plot_taylor(xmin,xmax, ordlim, first,step)
! 77:
! 78: which plots f together with its Taylor polynomials T_i (truncated series
! 79: expansion of order i) in the interval [xmin,xmax]; i goes from first to
! 80: ordlim in increments of steps. Sensible default values are provided for all
! 81: arguments (written by Ilya Zakharevich)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>