Changeset f9edcc in git for Singular/LIB


Ignore:
Timestamp:
Jan 11, 1999, 2:00:04 PM (25 years ago)
Author:
Mathias Schulze <mschulze@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
d2fb5627b9860b3fb2b77f2ea8fdb2d2632e2385
Parents:
eb84e2280f9f3c5793449b970a73c225493ab039
Message:
monodromy.lib


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/jordan.lib

    reb84e2 rf9edcc  
    11///////////////////////////////////////////////////////////////////////////////
    22
    3 version="$Id: jordan.lib,v 1.3 1998-12-28 14:30:54 mschulze Exp $";
     3version="$Id: jordan.lib,v 1.4 1999-01-11 13:00:04 mschulze Exp $";
    44info="
    55LIBRARY: jordan.lib  PROCEDURES TO COMPUTE THE JORDAN NORMAL FORM
     
    77                     email: mschulze@mathematik.uni-kl.de
    88
    9  jordan        : eigenvalues, jordan block sizes and jordan basis
    10  jordanmatrix  : jordan matrix from eigenvalues and jordan block sizes
    11  jordanform    : jordan normal form
    12  invmat        : inverse matrix
     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
    1315";
    1416
     
    1719
    1820proc jordan(matrix M,list #)
    19 USAGE:   <list> ret=jordan(<matrix> M[,<int> opt=0]);
    20 INPUT:   <matrix> M : square matrix with factorizable characteristic
    21                       polynomial of the constant part
    22           <int> opt : compute ret[2], iff opt<2
    23                       compute ret[3], iff opt>0
    24 OUTPUT:         <ideal> ret[1] : eigenvalues of the constant part of M
    25          <list<intvec>> ret[2] : jordan block sizes of the constant part of M
    26                <module> ret[3] : jordan basis for the constant part of M
     21USAGE:   <list> ret=jordan(<matrix> M[,<int> opt=0]);
     22ASSUME:  characteristic polynomial of the constant part of M factorizable
     23RETURN:   <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
    2728EXAMPLE: example jordan; shows an example
    2829{
     
    100101  if(opt>0)
    101102  {
    102     module V,K1,K2,sNi;
     103    module V,K1,K2;
    103104    matrix v[n][1];
    104105  }
     
    176177  "EXAMPLE:";
    177178  echo=2;
    178   LIB "random.lib";
    179   ring r;
    180   list eb=ideal(2,3),list(intvec(1,1,2,2,2),intvec(3,4,5));
    181   matrix J=jordanmatrix(eb);
    182   print(J);
    183   int n=nrows(J);
    184   matrix U;
    185   while(det(U)==0)
    186   {
    187     U=randommat(n,n,ideal(1));
    188   }
    189   matrix invU=invmat(U);
    190   matrix M=invU*J*U;
     179  ring R=0,x,dp;
     180  matrix M[3][3]=3,2,1,0,2,1,0,0,3;
    191181  print(M);
    192182  jordan(M);
     
    195185
    196186proc jordanmatrix(list eb)
    197 USAGE:   <matrix> J=jordanmatrix(<list> eb);
    198 INPUT:          <ideal> eb[1] : eigenvalues
    199          <list<intvec>> eb[2] : jordan block sizes
    200 OUTPUT:  <matrix> J : jordan matrix defined by eb
     187USAGE:   <matrix> J=jordanmatrix(<list<ideal,list<intvec>> eb);
     188RETURN:  <matrix> J : jordan matrix with eigenvalues eb[1] and
     189                      jordan block sizes eb[2]
    201190EXAMPLE: example jordanmatrix; shows an example
    202191{
     
    217206    return();
    218207  }
    219   int s=size(eJ);
    220208  if(size(eJ)<size(bJ))
    221209  {
     
    249237  matrix J[n][n];
    250238
    251   int k,l;
     239  int l;
    252240  for(i,l=1,1;i<=s;i++)
    253241  {
     
    275263  "EXAMPLE:";
    276264  echo=2;
    277   ring r;
    278   list eb=ideal(2,3),list(intvec(1,1,2,2,2),intvec(3,4,5));
    279   eb;
    280   matrix J=jordanmatrix(eb);
    281   print(J);
     265  ring R=0,x,dp;
     266  print(jordanmatrix(list(ideal(2,3),list(intvec(1),intvec(2)))));
    282267}
    283268///////////////////////////////////////////////////////////////////////////////
    284269
    285270proc jordanform(matrix M)
    286 USAGE:   <matrix J> jordanform(<matrix M>);
    287 INPUT:   <matrix> M : square matrix with factorizable characteristic
    288                       polynomial of the constant part
    289 OUTPUT:  <matrix J> : jordan normal form of M
     271USAGE:   <matrix> J=jordanform(<matrix> M);
     272ASSUME:  characteristic polynomial of the constant part of M factorizable
     273RETURN:  <matrix> J : jordan normal form of the constant part of M
    290274EXAMPLE: example jordanform; shows an example
    291275{
     
    296280  "EXAMPLE:";
    297281  echo=2;
    298   LIB "random.lib";
    299   ring r;
    300   list eb=ideal(2,3),list(intvec(1,1,2,2,2),intvec(3,4,5));
    301   matrix J=jordanmatrix(eb);
    302   print(J);
    303   int n=nrows(J);
    304   matrix U;
    305   while(det(U)==0)
    306   {
    307     U=randommat(n,n,ideal(1));
    308   }
    309   matrix invU=invmat(U);
    310   matrix M=invU*J*U;
     282  ring R=0,x,dp;
     283  matrix M[3][3]=3,2,1,0,2,1,0,0,3;
    311284  print(M);
    312   J=jordanform(M);
    313   print(J);
     285  print(jordanform(M));
    314286}
    315287///////////////////////////////////////////////////////////////////////////////
     
    317289proc invmat(matrix U)
    318290USAGE:   <matrix> invU=invmat(<matrix> U);
    319 INPUT:   <matrix> U : matrix with invertible constant part
    320 OUTPUT:  <matrix> invU : inverse matrix of constant part of U
     291ASSUME:  constant part of U invertible
     292RETURN:  <matrix> invU : inverse matrix of constant part of U
    321293EXAMPLE: example invmat; shows an example
    322294{
     
    338310  "EXAMPLE:";
    339311  echo=2;
    340   LIB "random.lib";
    341   ring r;
    342   int n=10;
    343   matrix U;
    344   while(det(U)==0)
    345   {
    346     U=randommat(n,n,ideal(1));
    347   }
     312  ring R=0,x,dp;
     313  matrix U[3][3]=3,2,1,0,2,1,0,0,3;
    348314  print(U);
    349   matrix invU=invmat(U);
    350   print(invU*U);
    351 }
    352 ///////////////////////////////////////////////////////////////////////////////
     315  print(invmat(U));
     316}
     317///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.