1 | LIB "tst.lib"; tst_init(); |
---|
2 | LIB "multigrading.lib"; |
---|
3 | ring r = 0,(x,y,z),dp; |
---|
4 | //Grading and Torsion matrices: |
---|
5 | intmat M[3][3] = |
---|
6 | 1,0,0, |
---|
7 | 0,1,0, |
---|
8 | 0,0,1; |
---|
9 | intmat T[3][1] = |
---|
10 | 1,2,3; |
---|
11 | setBaseMultigrading(M,T); |
---|
12 | attrib(r); |
---|
13 | poly f = x-yz; |
---|
14 | multiDegPartition(f); |
---|
15 | print(multiDeg(_)); |
---|
16 | isHomogeneous(f); // f: is not homogeneous |
---|
17 | poly g = 1-xy2z3; |
---|
18 | isHomogeneous(g); // g: is homogeneous |
---|
19 | multiDegPartition(g); |
---|
20 | kill T; |
---|
21 | ///////////////////////////////////////////////////////// |
---|
22 | // new Torsion matrix: |
---|
23 | intmat T[3][4] = |
---|
24 | 3,3,3,3, |
---|
25 | 2,1,3,0, |
---|
26 | 1,2,0,3; |
---|
27 | setBaseMultigrading(M,T); |
---|
28 | f; |
---|
29 | isHomogeneous(f); |
---|
30 | multiDegPartition(f); |
---|
31 | // --------------------- |
---|
32 | g; |
---|
33 | isHomogeneous(g); |
---|
34 | multiDegPartition(g); |
---|
35 | kill r, T, M; |
---|
36 | ring R = 0, (x,y,z), dp; |
---|
37 | intmat A[2][3] = |
---|
38 | 0,0,1, |
---|
39 | 3,2,1; |
---|
40 | intmat T[2][1] = |
---|
41 | -1, |
---|
42 | 4; |
---|
43 | setBaseMultigrading(A, T); |
---|
44 | isHomogeneous(ideal(x2 - y3 -xy +z, x*y-z, x^3 - y^2*z + x^2 -y^3)); // 1 |
---|
45 | isHomogeneous(ideal(x2 - y3 -xy +z, x*y-z, x^3 - y^2*z + x^2 -y^3), "checkGens"); |
---|
46 | isHomogeneous(ideal(x+y, x2 - y2)); // 0 |
---|
47 | // Degree partition: |
---|
48 | multiDegPartition(x2 - y3 -xy +z); |
---|
49 | multiDegPartition(x3 -y2z + x2 -y3 + z + 1); |
---|
50 | module N = gen(1) + (x+y) * gen(2), z*gen(3); |
---|
51 | intmat V[2][3] = 0; // 1, 2, 3, 4, 5, 6; // column-wise weights of components!!?? |
---|
52 | vector v1, v2; |
---|
53 | v1 = setModuleGrading(N[1], V); v1; |
---|
54 | multiDegPartition(v1); |
---|
55 | print( multiDeg(_) ); |
---|
56 | v2 = setModuleGrading(N[2], V); v2; |
---|
57 | multiDegPartition(v2); |
---|
58 | print( multiDeg(_) ); |
---|
59 | N = setModuleGrading(N, V); |
---|
60 | isHomogeneous(N); |
---|
61 | print( multiDeg(N) ); |
---|
62 | /////////////////////////////////////// |
---|
63 | V = |
---|
64 | 1, 2, 3, |
---|
65 | 4, 5, 6; |
---|
66 | v1 = setModuleGrading(N[1], V); v1; |
---|
67 | multiDegPartition(v1); |
---|
68 | print( multiDeg(_) ); |
---|
69 | v2 = setModuleGrading(N[2], V); v2; |
---|
70 | multiDegPartition(v2); |
---|
71 | print( multiDeg(_) ); |
---|
72 | N = setModuleGrading(N, V); |
---|
73 | isHomogeneous(N); |
---|
74 | print( multiDeg(N) ); |
---|
75 | /////////////////////////////////////// |
---|
76 | V = |
---|
77 | 0, 0, 0, |
---|
78 | 4, 1, 0; |
---|
79 | N = gen(1) + x * gen(2), z*gen(3); |
---|
80 | N = setModuleGrading(N, V); print(N); |
---|
81 | isHomogeneous(N); |
---|
82 | print( multiDeg(N) ); |
---|
83 | v1 = getGradedGenerator(N,1); print(v1); |
---|
84 | multiDegPartition(v1); |
---|
85 | print( multiDeg(_) ); |
---|
86 | N = setModuleGrading(N, V); print(N); |
---|
87 | isHomogeneous(N); |
---|
88 | print( multiDeg(N) ); |
---|
89 | tst_status(1);$ |
---|