> < ^ Date: Thu, 14 Apr 1994 12:08:00 +0100 (MET)
> < ^ From: Martin Schoenert <martin.schoenert@math.rwth-aachen.de >
> < ^ Subject: Re: matrices
Alice Niemeyer writes in her e-mail message of 1994/04/14

I am currently working with matrices over finite fields in GAP.
In my code I use the product A * Transposed(B). I was wondering
whether it might be possible to have an internal function for
this product avoiding the extra storage required for creating
Transposed(B).

Maybe I don't fully understand your problem, but wouldn't the following
function do?

ProductMatTransposedMat := function ( A, B )
    local  P, i, k;
    P := [];
    for i  in [1..Length(A)]  do
        P[i] := [];
        for k  in [1..Length(B)]  do
            P[i][k] := A[i] * B[k];
        od;
    od;
    return P;
end;

No extra storage required, and it should be reasonably fast, since most
of the time should be spent in the 'A[i] * B[k]' calculations, which is
handled in the kernel.

Martin.

-- .- .-. - .. -.  .-.. --- ...- . ...  .- -. -. .. -.- .-
Martin Sch"onert,   Martin.Schoenert@Math.RWTH-Aachen.DE,   +49 241 804551
Lehrstuhl D f"ur Mathematik, Templergraben 64, RWTH, 52056 Aachen, Germany

> < [top]