Bill Allombert on Tue, 14 Jan 2014 11:48:29 +0100


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

Re: new FFM_mul (and FlxqM_mul, FqM_mul, ...)


On Mon, Jan 13, 2014 at 09:28:30PM +0000, Bruin, Pieter wrote:
> Bill Allombert <Bill.Allombert@math.u-bordeaux.fr> wrote:
> 
> >> I wonder if it would be worthwhile to implement
> >> gen_matmut()/gen_matcolmut() in term of the bb_field interface and
> >> uses it instead of duplicating the code.
> >
> > What I meant was to add a function gen_matmul() similar to gen_ker():
> >
> > GEN
> > gen_matmul(GEN x, GEN y, void *E, const struct bb_field *ff)
> > {
> >   ...
> > }
> > And define
> >
> > FlxqM_mul(GEN x, GEN y, GEN T, ulong p)
> > {
> >   void *E;
> >   const struct bb_field *ff=get_Flxq_field(&E,T,p);
> >   return gen_matmul(x,y, E, ff);
> > }
> 
> The more I think about it, the more I actually prefer this approach to
> the code duplication in my patch, so if you want to do it in this way,
> I'll certainly be happy with that.

Yes. Would you provide a patch for gen_matmul?

> > Relatedly, I have created a branch bill-FpM_powu, which
> > adds the functions FpM_powu, Flm_powu, F2m_pow.
> 
> That looks good, and I guess it will be very easy to add those functions
> for non-prime finite fields, too...

We could even write a gen_matpow function (and gen_matpowers).

Do you know how to compute the square of a matrix faster than by using M*M ?

Cheers,
Bill.