|  |  D.3.2.6 diag_test Procedure from librarylinalg.lib(see  linalg_lib).
 
Example:Usage:
diag_test(A); A = const square matrix
Return:
int, 1 if A is diagonalizable,0 if not
 -1 if no statement is possible, since A does not split.
 
Note:
The test works only for split matrices, i.e if eigenvalues of A
are in the ground field.
Does not work with parameters (uses factorize,gcd).
 
 |  | LIB "linalg.lib";
ring r=0,(x),dp;
matrix A[4][4]=6,0,0,0,0,0,6,0,0,6,0,0,0,0,0,6;
print(A);
==> 6,0,0,0,
==> 0,0,6,0,
==> 0,6,0,0,
==> 0,0,0,6 
diag_test(A);
==> 1
 | 
 
 |