Changeset 1ac173 in git
 Timestamp:
 Aug 9, 2001, 10:39:10 AM (22 years ago)
 Branches:
 (u'spielwiese', '91fdef05f09f54b8d58d92a472e9c4a43aa4656f')
 Children:
 86c1f00ac7423a6cb67b950155c7809798a70e49
 Parents:
 8444b045c3217f44893e92cc7acc9a1bc7595178
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/linalg.lib
r8444b0 r1ac173 1 1 //GMG last modified: 04/25/2000 2 2 ////////////////////////////////////////////////////////////////////////////// 3 version="$Id: linalg.lib,v 1.1 6 20010801 13:02:20 mschulze Exp $";3 version="$Id: linalg.lib,v 1.17 20010809 08:39:10 mschulze Exp $"; 4 4 category="Linear Algebra"; 5 5 info=" … … 31 31 jordanmatrix(e,b); Jordan matrix with eigenvalues e and Jordan block sizes b 32 32 jordanform(M); Jordan matrix of constant square matrix M 33 commutator(A); matrix of commutator B>[A,B]=ABBA 33 34 "; 34 35 … … 1695 1696 /////////////////////////////////////////////////////////////////////////////// 1696 1697 1698 proc commutator(matrix A) 1699 "USAGE: (A); matrix A 1700 ASSUME: A is a square matrix 1701 RETURN: matrix C of the commutator B>[A,B]=ABBA w.r.t. rowwise ordered basis 1702 EXAMPLE: example commutator; shows examples 1703 " 1704 { 1705 int n=ncols(A); 1706 if(n!=nrows(A)) 1707 { 1708 ERROR("square matrix expected"); 1709 } 1710 int i,j,k; 1711 matrix C[n^2][n^2]; 1712 for(i=0;i<n;i++) 1713 { 1714 for(j=0;j<n;j++) 1715 { 1716 for(k=0;k<n;k++) 1717 { 1718 C[i*n+j+1,k*n+j+1]=C[i*n+j+1,k*n+j+1]+A[i+1,k+1]; 1719 C[i*n+j+1,i*n+k+1]=C[i*n+j+1,i*n+k+1]A[k+1,j+1]; 1720 } 1721 } 1722 } 1723 return(C); 1724 } 1725 example 1726 { "EXAMPLE:"; echo=2; 1727 ring R; 1728 matrix A[2][2]=1,2,3,4; 1729 print(A); 1730 print(commutator(A)); 1731 } 1732 1733 /////////////////////////////////////////////////////////////////////////////// 1734 1697 1735 /* 1698 1736 ///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.