Changeset d2fb562 in git for Singular/LIB


Ignore:
Timestamp:
Jan 12, 1999, 9:53:23 AM (25 years ago)
Author:
Mathias Schulze <mschulze@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
8552c7ec6ef8b40263c2fe0ab9ce32c4c17d6654
Parents:
f9edcc229e151e8a6db292b78692694b5bcd3ad2
Message:
*mschulze: added comments


git-svn-id: file:///usr/local/Singular/svn/trunk@2789 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/jordan.lib

    rf9edcc rd2fb562  
    11///////////////////////////////////////////////////////////////////////////////
    22
    3 version="$Id: jordan.lib,v 1.4 1999-01-11 13:00:04 mschulze Exp $";
     3version="$Id: jordan.lib,v 1.5 1999-01-12 08:53:23 mschulze Exp $";
    44info="
    55LIBRARY: jordan.lib  PROCEDURES TO COMPUTE THE JORDAN NORMAL FORM
     
    77                     email: mschulze@mathematik.uni-kl.de
    88
    9  jordan(M[,opt]);    eigenvalues, jordan block sizes and jordan basis of
    10                      constant part of square matrix M
    11  jordanmatrix(eb);   jordan matrix with eigenvalues eb[1] and
    12                      jordan block sizes eb[2]
    13  jordanform(M);      jordan normal form of constant part of square matrix M
    14  invmat(U);          inverse matrix of constant part of matrix U
     9 jordan(M[,opt]);    eigenvalues and corresponding jordan block size vectors
     10                     of the constant part of the square matrix M and
     11                     a jordan basis for the constant part of M
     12 jordanmatrix(eb);   jordan matrix with eigenvalues eb[1] and corresponding
     13                     jordan block size vectors eb[2]
     14 jordanform(M);      jordan normal form of the constant part
     15                     of the square matrix M
     16 invmat(U);          inverse matrix of the invertible constant part
     17                     of the matrix U
    1518";
    1619
     
    1922
    2023proc jordan(matrix M,list #)
    21 USAGE:   <list> ret=jordan(<matrix> M[,<int> opt=0]);
    22 ASSUME:  characteristic polynomial of the constant part of M factorizable
    23 RETURN:   <ideal> ret[1] : eigenvalues of the constant part of M
    24          <intvec> ret[2] : jordan block sizes of the constant part of M
    25                            if opt<2
    26          <module> ret[3] : jordan basis for the constant part of M
    27                            if opt>0
     24USAGE:  <list<ideal,list<intvec>,module>> ret=jordan(<matrix> M[,<int> opt=0]);
     25ASSUME:  characteristic polynomial of the constant part of M completely
     26         factorizable
     27RETURN:  eigenvalues ret[1] and, if opt<2, corresponding jordan block
     28         size vectors ret[2] of the constant part of M and, if opt>0,
     29         a jordan basis ret[3] for the constant part of M
    2830EXAMPLE: example jordan; shows an example
    2931{
     32  // test if square matrix
    3033  int n=nrows(M);
    3134  if(n!=ncols(M))
     
    3538  }
    3639
     40  // get constant part
    3741  def br=basering;
    3842  map zero=br,0;
     
    4044  kill zero;
    4145
     46  // change to polynomial ring for factorization
    4247  changeord("pr","dp");
    4348  matrix M=imap(br,M);
    4449
     50  // factorize characteristic polynomial
    4551  list l=factorize(det(M-var(1)*freemodule(n)),2);
     52
     53  // get multiplicities mM
    4654  def eM,mM=l[1..2];
    47 
     55  kill l;
     56
     57  // test if factorization complete
    4858  int i;
    4959  for(i=size(eM);i>=1;i--)
     
    5767  }
    5868
     69  // get eigenvalues eM
    5970  map inv=pr,-var(1);
    6071  eM=simplify(inv(eM),1);
     
    6475  kill pr;
    6576
     77  // sort eigenvalues
    6678  int j;
    6779  poly e;
     
    8496  kill e,m;
    8597
     98  // check option parameter
    8699  int opt=0;
    87100  if(size(#)>0)
     
    93106  }
    94107
     108  // define needed variables
    95109  int k,l;
    96110  matrix E=freemodule(n);
     
    98112  module sNi;
    99113  list K;
    100 
    101114  if(opt>0)
    102115  {
     
    110123  }
    111124
     125  // do the following for all eigenvalues eM[i]
    112126  for(i=ncols(eM);i>=1;i--)
    113127  {
    114128    Mi=M-eM[i]*E;
    115  
     129
     130    // compute kernels K of powers of Mi
    116131    K=list(module());
    117132    for(Ni,sNi=Mi,0;size(sNi)<mM[i];Ni=Ni*Mi)
     
    123138    if(opt<2)
    124139    {
     140      // compute jordan block size vector corresponding to eigenvalue eM[i]
    125141      bMi=0;
    126142      bMi[size(K[2])]=0;
     
    137153    if(opt>0)
    138154    {
     155      // compute generating vectors for jordan basis vectors corresponding to
     156      // eigenvalue eM[i]
    139157      if(size(K)>1)
    140158      {
     
    147165        K[j]=interred(reduce(K[j],std(K1)));
    148166      }
     167
     168      // compute jordan basis vectors corresponding to eigenvalue eM[i] from
     169      // generating vectors
    149170      for(j=size(K);j>=2;j--)
    150171      {
     
    162183  }
    163184
     185  // create return list
    164186  list ret=eM;
    165187  if(opt<2)
     
    171193    ret[3]=V;
    172194  }
     195
    173196  return(ret);
    174197}
     
    186209proc jordanmatrix(list eb)
    187210USAGE:   <matrix> J=jordanmatrix(<list<ideal,list<intvec>> eb);
    188 RETURN:  <matrix> J : jordan matrix with eigenvalues eb[1] and
    189                       jordan block sizes eb[2]
     211RETURN:  jordan matrix J with eigenvalues eb[1] and corresponding
     212         jordan block size vectors eb[2]
    190213EXAMPLE: example jordanmatrix; shows an example
    191214{
     215  // check parameters
    192216  if(size(eb)<2)
    193217  {
     
    215239  }
    216240
     241  // get size of Jordan matrix
    217242  int i,j,k,n;
    218243  for(i=s;i>=1;i--)
     
    220245    if(typeof(bJ[i])!="intvec")
    221246    {
    222       "//second entry in argument list not a list of int vectors";
     247      "//second entry in argument list not a list of intvecs";
    223248      return();
    224249    }
     
    237262  matrix J[n][n];
    238263
     264  // create Jordan matrix
    239265  int l;
    240266  for(i,l=1,1;i<=s;i++)
     
    270296proc jordanform(matrix M)
    271297USAGE:   <matrix> J=jordanform(<matrix> M);
    272 ASSUME:  characteristic polynomial of the constant part of M factorizable
    273 RETURN:  <matrix> J : jordan normal form of the constant part of M
     298ASSUME:  characteristic polynomial of the constant part of M completely
     299         factorizable
     300RETURN:  jordan normal form J of the constant part of M
    274301EXAMPLE: example jordanform; shows an example
    275302{
     
    290317USAGE:   <matrix> invU=invmat(<matrix> U);
    291318ASSUME:  constant part of U invertible
    292 RETURN:  <matrix> invU : inverse matrix of constant part of U
     319RETURN:  inverse matrix invU of the constant part of U
    293320EXAMPLE: example invmat; shows an example
    294321{
     322  // test if square matrix
    295323  int n=nrows(U);
    296324  if(n!=ncols(U))
     
    300328  }
    301329
     330  // get constant part
    302331  def br=basering;
    303332  map zero=br,0;
    304333  U=zero(U);
    305334
     335  // compute inverse
    306336  return(lift(U,freemodule(n)));
    307337}
Note: See TracChangeset for help on using the changeset viewer.