Karim Belabas on Wed, 17 Mar 2004 20:33:59 +0100


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

Re: Math::Pari and CVS version


* Ilya Zakharevich [2004-03-17 19:45]:
> On Tue, Feb 03, 2004 at 02:55:15PM +0100, Karim Belabas wrote:
> > * 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.
> 
> Could you fix it?

Done.

>> Or, much better,
>> 
>>   void gen_output(GEN g, pariout_t *T)
>> 
>> where T specifies everything the output routine might need.
> 
> Yes, this is what the current Math::Pari is forced to use; however, it
> needs to copy the text of the static _initout().  I see little point
> in having get_output without exporting _initout()...

In all cases I can imagine, you simply don't need any of those parameters and
are happy with default values.

  static pariout_t out1 = { 'g', 0, -1, 1, f_RAW, 0 };
  void out(GEN x) { gen_output(x, &out1); }

or possibly 

  void out2(GEN x, char f, long d) { 
    pariout_t T = DFLT_OUTPUT; /* copy */
    T.format = f;
    T.fieldw = d; T.sp = 0;
    gen_output(x);
  }

That should emulate the old bruteall.

Well, I probably lack imagination...

Note: I just removed the (hackish, useless) 'initial' flag I had inserted
in the pariout_t struct. The above example assumes either 2.2.6 (no pariout_t
before), 2.2.7 or up to date CVS.

>> I will probably document this.
> 
> Restoring bruteall() may be an easier way to cover most important
> cases. ;-)

I'd like to avoid that: it was a specialized function with many arguments,
but still lacking some flexibility, and ignoring defaults like current
realprecision. It looks easier to me to either use one of the straightforward
documented routines, or copy a completely customized output type as out1
above.

    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]