Ramón Casero Cañas on Tue, 7 Jan 2003 01:03:19 +0100 (MET)

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

inverse of a modulo 2 matrix

Hi, I'm Ramón, rcasero@tsc.uc3m.es; our mail server has been down for the
whole Christmas, so I have to use this address meanwhile.

> 1) To inverse a matrix, use A^-1 or 1/A.
> 2) If A is invertible, you should rather use matsolve() than
> 3) matsolve(A,X) is faster than computing A^-1, but not much, so you are
> it is best to compute A^-1 if you have many vectors X.

Thanks, Bill. I tried this in GP, and it worked. I actually did this


? a=[Mod(0,2),Mod(1,2); Mod(1,2),Mod(1,2)]
%2 =
[Mod(0, 2) Mod(1, 2)]

[Mod(1, 2) Mod(1, 2)]

? a^(-1)
%3 =
[Mod(1, 2) Mod(1, 2)]

[Mod(1, 2) Mod(0, 2)]

? a^(-1)*a
%4 =
[Mod(1, 2) Mod(0, 2)]

[Mod(0, 2) Mod(1, 2)]


Why? Because I want to invert a modulo 2 matrix, and then use it to span
modulo 2 vectors. I know that I can work with reals and do

a^(-1) = inv(a) * det(a)

but I would like to stay in {0, 1}. Maybe pari can do this, and this is the
reason of my interest in inversing a matrix. But I would like to do this with
a function, using the C interface, not the gp program. The inversion
function is what I cannot find in the documentation (I did find the data type for
the modulo 2 symbols). 

Happy New Year,


+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!