Changeset 4889a2 in git


Ignore:
Timestamp:
Jan 19, 1999, 11:34:26 AM (25 years ago)
Author:
Mathias Schulze <mschulze@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
7dc74ad56f66b202480c84d6188177a90e61065a
Parents:
f6c713380f345a494946449c99a39906eb272086
Message:
*mschulze: changed proc headers


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/jordan.lib

    rf6c7133 r4889a2  
    11///////////////////////////////////////////////////////////////////////////////
    22
    3 version="$Id: jordan.lib,v 1.5 1999-01-12 08:53:23 mschulze Exp $";
     3version="$Id: jordan.lib,v 1.6 1999-01-19 10:34:26 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 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
     9 jordan(M[,opt]);    eigenvalues, corresponding jordan block size vectors,
     10                     and jordan basis of constant square matrix M
     11 jordanmatrix(d);    jordan matrix with eigenvalues d[1] and corresponding
     12                     jordan block size vectors d[2]
     13 jordanform(M);      jordan normal form of constant square matrix M
     14 invmat(M);          inverse matrix of invertible constant matrix M
    1815";
    1916
     
    2219
    2320proc jordan(matrix M,list #)
    24 USAGE:  <list<ideal,list<intvec>,module>> ret=jordan(<matrix> M[,<int> opt=0]);
    25 ASSUME:  characteristic polynomial of the constant part of M completely
    26          factorizable
    27 RETURN:  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
     21USAGE:   jordan(M[,opt]); M constant square matrix, opt integer
     22ASSUME:  eigenvalues of M in the coefficient field
     23RETURN:  list with first entry the eigenvalues of of M, second entry,
     24         if opt<=1, the list of corresponding jordan block size vectors of M,
     25         and third entry, if opt>=1, a jordan basis of M
     26NOTE:    non constant M is replaced by its constant part
    3027EXAMPLE: example jordan; shows an example
    3128{
     
    5350  // get multiplicities mM
    5451  def eM,mM=l[1..2];
    55   kill l;
    56 
    57   // test if factorization complete
     52
     53  // test if eigenvalues in the coefficient field
    5854  int i;
    5955  for(i=size(eM);i>=1;i--)
     
    6258    {
    6359      kill pr;
    64       "//unable to factorize characteristic polynomial";
     60      "//eigenvalues not in the coefficient field";
    6561      return();
    6662    }
     
    9692  kill e,m;
    9793
    98   // check option parameter
     94  // get option parameter
    9995  int opt=0;
    10096  if(size(#)>0)
     
    112108  module sNi;
    113109  list K;
    114   if(opt>0)
     110  if(opt>=1)
    115111  {
    116112    module V,K1,K2;
    117113    matrix v[n][1];
    118114  }
    119   if(opt<2)
     115  if(opt<=1)
    120116  {
    121117    list bM;
     
    136132    }
    137133
    138     if(opt<2)
     134    if(opt<=1)
    139135    {
    140136      // compute jordan block size vector corresponding to eigenvalue eM[i]
     
    151147    }
    152148
    153     if(opt>0)
     149    if(opt>=1)
    154150    {
    155151      // compute generating vectors for jordan basis vectors corresponding to
     
    184180
    185181  // create return list
    186   list ret=eM;
    187   if(opt<2)
    188   {
    189     ret[2]=bM;
    190   }
    191   if(opt>0)
    192   {
    193     ret[3]=V;
    194   }
    195 
    196   return(ret);
     182  list d=eM;
     183  if(opt<=1)
     184  {
     185    d[2]=bM;
     186  }
     187  if(opt>=1)
     188  {
     189    d[3]=V;
     190  }
     191
     192  return(d);
    197193}
    198194example
     
    207203///////////////////////////////////////////////////////////////////////////////
    208204
    209 proc jordanmatrix(list eb)
    210 USAGE:   <matrix> J=jordanmatrix(<list<ideal,list<intvec>> eb);
    211 RETURN:  jordan matrix J with eigenvalues eb[1] and corresponding
    212          jordan block size vectors eb[2]
     205proc jordanmatrix(list d)
     206USAGE:   jordanmatrix(d); d list of ideal and list of integer vectors
     207RETURN:  jordan matrix with eigenvalues d[1] and corresponding jordan block
     208         size vectors d[2]
    213209EXAMPLE: example jordanmatrix; shows an example
    214210{
    215211  // check parameters
    216   if(size(eb)<2)
     212  if(size(d)<2)
    217213  {
    218214    "//not enough entries in argument list";
    219215    return();
    220216  }
    221   def eJ,bJ=eb[1..2];
     217  def eJ,bJ=d[1..2];
     218  kill d;
    222219  if(typeof(eJ)!="ideal")
    223220  {
     
    239236  }
    240237
    241   // get size of Jordan matrix
     238  // get size of jordan matrix
    242239  int i,j,k,n;
    243240  for(i=s;i>=1;i--)
     
    245242    if(typeof(bJ[i])!="intvec")
    246243    {
    247       "//second entry in argument list not a list of intvecs";
     244      "//second entry in argument list not a list of integer vectors";
    248245      return();
    249246    }
     
    262259  matrix J[n][n];
    263260
    264   // create Jordan matrix
     261  // create jordan matrix
    265262  int l;
    266263  for(i,l=1,1;i<=s;i++)
     
    295292
    296293proc jordanform(matrix M)
    297 USAGE:   <matrix> J=jordanform(<matrix> M);
    298 ASSUME:  characteristic polynomial of the constant part of M completely
    299          factorizable
    300 RETURN:  jordan normal form J of the constant part of M
     294USAGE:   jordanform(M); M constant square matrix
     295ASSUME:  eigenvalues of M in the coefficient field
     296RETURN:  jordan normal form of M
     297NOTE:    non constant M is replaced by its constant part
    301298EXAMPLE: example jordanform; shows an example
    302299{
     
    314311///////////////////////////////////////////////////////////////////////////////
    315312
    316 proc invmat(matrix U)
    317 USAGE:   <matrix> invU=invmat(<matrix> U);
    318 ASSUME:  constant part of U invertible
    319 RETURN:  inverse matrix invU of the constant part of U
     313proc invmat(matrix M)
     314USAGE:   invmat(M); M constant square matrix
     315ASSUME:  M invertible
     316RETURN:  inverse matrix of M
     317NOTE:    non constant M is replaced by its constant part
    320318EXAMPLE: example invmat; shows an example
    321319{
    322320  // test if square matrix
    323   int n=nrows(U);
    324   if(n!=ncols(U))
     321  int n=nrows(M);
     322  if(n!=ncols(M))
    325323  {
    326324    "//no square matrix";
     
    331329  def br=basering;
    332330  map zero=br,0;
    333   U=zero(U);
     331  M=zero(M);
    334332
    335333  // compute inverse
    336   return(lift(U,freemodule(n)));
     334  return(lift(M,freemodule(n)));
    337335}
    338336example
     
    341339  echo=2;
    342340  ring R=0,x,dp;
    343   matrix U[3][3]=3,2,1,0,2,1,0,0,3;
    344   print(U);
    345   print(invmat(U));
    346 }
    347 ///////////////////////////////////////////////////////////////////////////////
     341  matrix M[3][3]=3,2,1,0,2,1,0,0,3;
     342  print(M);
     343  print(invmat(M));
     344}
     345///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.