ufs_diagonalize, ufs_lagrange - diagonalize a matrix using the lagrange method
Calling sequence:
ufs_diagonalize(M)
ufs_lagrange(M)
Parameters:
M - a symmetric matrix
Synopsis:
ufs_diagonalize diagonalizes the given matrix using completion of squares (Lagrange's method).
The argument must be a symmetric matrix, otherwise an error occurs.
Example:
> A:=matrix([[2,1,0,0],[1,2,3,0],[0,3,2,1],[0,0,1,1]]);
> B:=ufs_diagonalize(A);
> L:=ufs_lagrange(A);
> C:=evalm(transpose(L) &* A &* L);