Karim Belabas on Tue, 03 Feb 2004 15:22:33 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Math::Pari and CVS version


* Ilya Zakharevich [2004-02-03 04:55]:
>  a) The function bruteall() disappeared.  How one is supposed to
>     replace it?  I needed to copy the text of this function and of all the
>     static functions it used to compile Math::Pari.

It was not documented, so I did not add an entry in COMPAT.

One may use one of the old standard documented functions ( output(), etc ) or

  void brute(GEN g, char f, long d)

[ corresponds to old bruteall(g, f, d, 1 ) ] for fine tuning.

Or, much better,

  void gen_output(GEN g, pariout_t *T)

where T specifies everything the output routine might need.

  T = NULL: default output as specified by current values of PARI defaults

( GP_DATA->fmt if set, global DFLT_OUTPUT otherwise ), otherwise

  typedef struct {
    char format; /* e,f,g */
    long fieldw; /* 0 (ignored) or field width */
    long sigd;   /* -1 (all) or number of significant digits printed */
    int sp;      /* 0 = suppress whitespace from output */
    int prettyp; /* output style: raw, prettyprint, etc */
    int TeXstyle;
    int initial; /* private */
  } pariout_t;

A specialized output routine might look like this:

  pariout_t t;
  t = GP_DATA? GP_DATA->fmt: DFLT_OUTPUT; /* get global defaults. Copy */
  t.xxx = yyy; /* change a few relevant fields */
  ...
  gen_output(g, &t);

I will probably document this.

    Karim.
-- 
Karim Belabas                     Tel: (+33) (0)1 69 15 57 48
Dep. de Mathematiques, Bat. 425   Fax: (+33) (0)1 69 15 60 19
Universite Paris-Sud              http://www.math.u-psud.fr/~belabas/ 
F-91405 Orsay (France)            http://pari.math.u-bordeaux.fr/  [PARI/GP]