source: git/Tst/Buch/Example_2_6_11.tst @ 107aac

spielwiese
Last change on this file since 107aac was 891438c, checked in by Gerhard Pfister <pfister@…>, 23 years ago
*GP: initial release git-svn-id: file:///usr/local/Singular/svn/trunk@5579 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.3 KB
Line 
1LIB "tst.lib";
2tst_init();
3
4proc normalForm(matrix M)
5{
6   int n=nrows(M);
7   int m=ncols(M);
8   matrix N[n][m];
9   M=transpose(interred(transpose(interred(M))));
10   N[1..nrows(M),1..ncols(M)]=M;
11   return(N);
12}
13
14option(redSB);
15ring R=0,(x),(C,dp);
16
17matrix M0[5][5]=1, 1,0,0,0,
18               -2,-1,0,0,0,
19                0, 0,2,1,0,
20                0, 0,0,2,0,
21                0, 0,0,0,3;
22matrix N[5][5]=1, 1, -1,  1,-1,
23               2, 2,  1,  1, 0,
24              -1, 2,  2,  1, 1,
25              -2, 1,  1, -1, 0,
26               1, 2, -2,  1, 1;
27matrix M=lift(N,freemodule(nrows(N)))*M0*N-x*freemodule(5);
28print(M);
29
30N=normalForm(M);
31print(N);
32
33factorize(N[1,1]);
34
35LIB"matrix.lib";
36
37proc extendedNormalForm(matrix M)
38{
39   intvec v=1..nrows(M);
40   intvec w=nrows(M)+1..nrows(M)+ncols(M);
41   matrix N=concat(freemodule(nrows(M)),M);
42   N=transpose(interred(transpose(N)));
43   matrix C=submat(N,v,v);
44   C=lift(C,freemodule(nrows(C))); //the inverse matrix of C
45   matrix D=submat(N,v,w);
46   D=transpose(interred(D));
47   list Re=C,D;
48   return(Re); 
49}
50
51matrix M1[2][2]=x2+1,0,
52                0,   x-1;
53matrix N1[2][2]=1, 1,
54                1, 2;
55matrix N2[2][2]=0,-1,
56                1, 1;
57               
58M=N1*M1*N2;
59print(M);
60
61list L=extendedNormalForm(M);
62print(L[1]);
63 
64print(L[2]);
65
66tst_status(1);$
Note: See TracBrowser for help on using the repository browser.