Bill Allombert on Mon, 27 Sep 2004 00:19:46 +0200


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

new function matfrobenius().


Hello PARI-dev,

I have added a new function to GP, matfrobenius() which compute the
elementary divisors and the Frobenius form of a square matrix.

? ??matfrobenius
matfrobenius(M,{flag = 0}):

   returns the Frobenius form of the square matrix M. If flag = 1, returns only
the  elementary divisors.   If flag = 2,  returns a two-components vector [F,B]
where F is the Frobenius form and B is the basis change so that M = B^{-1}FB.

   The library syntax is matfrobenius(M,flag).

? matfrobenius([1,1;0,1])
%1 =
[0 -1]

[1 2]

? matfrobenius([1,1;0,1],1)
%2 = [x^2 - 2*x + 1]

? matfrobenius([1,1;0,1],2)
%3 = [[0, -1; 1, 2], [1, -1; -1, 0]]

? %[2]^-1*%[1]*%[2]
%4 =
[1 1]

[0 1]

Cheers,
Bill.