spielwiese
Last change
on this file since 1ebec3 was
15bd61f,
checked in by Hans Schönemann <hannes@…>, 23 years ago
|
*hannes: branch, GP corr, new Ex 7.9.6
git-svn-id: file:///usr/local/Singular/svn/trunk@5625 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
748 bytes
|
Line | |
---|
1 | LIB "tst.lib"; |
---|
2 | tst_init(); |
---|
3 | |
---|
4 | proc contraHom(matrix M,int s) |
---|
5 | { |
---|
6 | int n=ncols(M); |
---|
7 | int m=nrows(M); |
---|
8 | int a,b,c; |
---|
9 | matrix R[s*n][s*m]; |
---|
10 | for(b=1;b<=m;b++) |
---|
11 | { |
---|
12 | for(a=1;a<=s;a++) |
---|
13 | { |
---|
14 | for(c=1;c<=n;c++) |
---|
15 | { |
---|
16 | R[(a-1)*n+c,(a-1)*m+b]=M[b,c]; |
---|
17 | } |
---|
18 | } |
---|
19 | } |
---|
20 | return(R); |
---|
21 | } |
---|
22 | |
---|
23 | ring A=0,(x,y,z),dp; |
---|
24 | matrix M[3][3]=1,2,3, |
---|
25 | 4,5,6, |
---|
26 | 7,8,9; |
---|
27 | |
---|
28 | print(contraHom(M,2)); |
---|
29 | |
---|
30 | proc coHom(matrix M,int s) |
---|
31 | { |
---|
32 | int n=ncols(M); |
---|
33 | int m=nrows(M); |
---|
34 | int a,b,c; |
---|
35 | matrix R[s*m][s*n]; |
---|
36 | for(b=1;b<=s;b++) |
---|
37 | { |
---|
38 | for(a=1;a<=m;a++) |
---|
39 | { |
---|
40 | for(c=1;c<=n;c++) |
---|
41 | { |
---|
42 | R[(a-1)*s+b,(c-1)*s+b]=M[a,c]; |
---|
43 | } |
---|
44 | } |
---|
45 | } |
---|
46 | return(R); |
---|
47 | } |
---|
48 | |
---|
49 | print(coHom(M,2)); |
---|
50 | |
---|
51 | tst_status(1);$ |
---|
Note: See
TracBrowser
for help on using the repository browser.