2012/10/26 Robert Dodier <robert.dodier at gmail.com>
> 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);
>
>
I already thought about that. At first sight it seemed to be too
complicated. Lists are the usual data structures in Maxima at the users top
level. But what convinces me is that the return value of what you name
gf_construction is much more readable than a list:
(%i abc) GF2_4 : gf_construction(2, 4)$
(%i xyz) GF2_4;
(%o xyz) gf_data(characteristic = 2, exponent = 4, reduction = x^4+x+1,
primitive = x, cardinality = 16, order = 15,
factors_of_order = [[3,1], [5,1]])
This return value is self explaining. And its extendable. If for some
reason I had to add one more field attribute in future releases it won't
break anything.
Thanks for pointing on this.
Volker
> Hope this helps,
>
> Robert Dodier
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>