On 2012-10-26, Volker van Nek <volkervannek at gmail.com> wrote:
> A real slow down occurs when a computation permanently has to toggle
> between at least two different fields (or quotient rings) and always needs
> a full gf_set. In this situation your idea of reusing the already computed
> globals would be a way to avoid unnecessary computations. At the moment
> gf_set returns a list containing the computed primitive (or false in case
> it doesn't exist) and the reduction polynomial. I can imagine to add all
> the necessary information to this list which allows another function
> "gf_set_again" to reconstruct the field (setting the globals) by this
> information without any recomputations.
Well, I think it's worth considering using a structure (as defined by
defstruct) to refer to the various bits by name. E.g. something like:
defstruct (gf_data (primitive, reduction, foo, bar, baz));
gf1 : gf_construction (stuff1); /* returns gf_data struct */
gf2 : gf_construction (stuff2);
printf ("primitive of 1st: ~S, reduction of 2nd: ~S~%", gf1 at primitive, gf2 at reduction);
gf_something (gf1);
gf_something_else (gf2);
Hope this helps,
Robert Dodier