Peter Bruin on Wed, 11 Feb 2015 14:15:19 +0100


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

Re: FlxqM_mul_Kronecker


Hello Bill,

> Thanks! I have commited your change to master.
>
>> > I think the function FlxM_to_ZM and ZM_to_FlxqM should be renamed
>> > to something more awkward, maybe FlxM_pack_ZM/ZM_pack_FlxqM
>> 
>> They are now called kron_pack_FlxM and kron_unpack_FlxM; how about that?
>
> Well, I changed it to FlxM_pack_ZM and ZM_unpack_FlxqM 
> because the convetion is to start the function name with the input type.

Thanks!

> Also I have changed RgM_sqr to call FFM_mul.

The following part of your patch does not seem to do what it should do,
because N is compared to the converted M as opposed to the original one:

--- a/src/basemath/FF.c
+++ b/src/basemath/FF.c
@@ -1781,7 +1781,7 @@ FFM_mul(GEN M, GEN N, GEN ff)
   GEN P, T, p;
   _getFF(ff, &T, &p, &pp);
   M = FFM_to_raw(M);
-  N = FFM_to_raw(N);
+  N = N==M ? M: FFM_to_raw(N);
   switch (ff[1])
   {
   case t_FF_FpXQ: P = FqM_mul(M, N, T, p); break;

Shouldn't lines 1783-1784 be

if (N == M)
  N = M = FFM_to_raw(M);
else {
  M = FFM_to_raw(M);
  N = FFM_to_raw(N);
}

or something equivalent?

Peter