Bill Allombert on Mon, 13 Jan 2014 17:39:00 +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 05:08:03PM +0100, Peter Bruin wrote:
> Hello,
> Here are a couple of functions for multiplying matrices over finite
> fields.  I would be very happy if these functions (with any appropriate
> improvements) could be included in the PARI library.
> I implemented F2xqM_mul, FlxqM_mul, FqM_mul, the variants where the
> right-hand side is a column vector (F2xqM_F2xqC_mul, etc.), and FFM_mul.
> All of the functions are pretty straightforward.  I personally didn't
> need FFM_FFC_mul or anything involving FFV, so I didn't implement those.
> The patch also modifies RgM_mul to call FFM_mul when appropriate.  I ran
> a small number of examples; the new functions seem to be up to 2.5 times
> as fast as the existing code.

Thanks for your patch!

> One thing I'm not sure about is how much consistency checking to do in
> the lower-level functions (FlxqM_FlxqC_mul, etc.); currently they check
> if the dimensions are compatible but not if the input types (t_MAT etc.)
> are correct.

Yes, a function FlxqM_xxx must assume the input is actually a FlxqM.

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.