spielwiese
Last change
on this file since bf8015 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:
572 bytes
|
Line | |
---|
1 | LIB "tst.lib"; |
---|
2 | tst_init(); |
---|
3 | |
---|
4 | proc tensorMaps(matrix M, matrix N) |
---|
5 | { |
---|
6 | int r=ncols(M); |
---|
7 | int s=nrows(M); |
---|
8 | int p=ncols(N); |
---|
9 | int q=nrows(N); |
---|
10 | int a,b,c,d; |
---|
11 | matrix R[s*q][r*p]; |
---|
12 | for(b=1;b<=p;b++) |
---|
13 | { |
---|
14 | for(d=1;d<=q;d++) |
---|
15 | { |
---|
16 | for(a=1;a<=r;a++) |
---|
17 | { |
---|
18 | for(c=1;c<=s;c++) |
---|
19 | { |
---|
20 | R[(c-1)*q+d,(a-1)*p+b]=M[c,a]*N[d,b]; |
---|
21 | } |
---|
22 | } |
---|
23 | } |
---|
24 | } |
---|
25 | return(R); |
---|
26 | } |
---|
27 | |
---|
28 | ring A=0,(x,y,z),dp; |
---|
29 | matrix M[3][3]=1,2,3,4,5,6,7,8,9; |
---|
30 | matrix N[2][2]=x,y,0,z; |
---|
31 | print(M); |
---|
32 | |
---|
33 | print(N); |
---|
34 | |
---|
35 | print(tensorMaps(M,N)); |
---|
36 | |
---|
37 | |
---|
38 | tst_status(1);$ |
---|
Note: See
TracBrowser
for help on using the repository browser.