source: git/Tst/Manual/isHomogeneous.tst @ 0d6b7fc

spielwiese Release-4-3-2p2
Last change on this file since 0d6b7fc was 894057, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
ADD: Tests from online manual (res+stat on mamawutz): short ones Tst/Manual/s.lst
  • Property mode set to 100644
File size: 2.0 KB
Line 
1LIB "tst.lib"; tst_init();
2LIB "multigrading.lib";
3ring r = 0,(x,y,z),dp;
4//Grading and Torsion matrices:
5intmat M[3][3] =
61,0,0,
70,1,0,
80,0,1;
9intmat T[3][1] =
101,2,3;
11setBaseMultigrading(M,T);
12attrib(r);
13poly f = x-yz;
14multiDegPartition(f);
15print(multiDeg(_));
16isHomogeneous(f);   // f: is not homogeneous
17poly g = 1-xy2z3;
18isHomogeneous(g); // g: is homogeneous
19multiDegPartition(g);
20kill T;
21/////////////////////////////////////////////////////////
22// new Torsion matrix:
23intmat T[3][4] =
243,3,3,3,
252,1,3,0,
261,2,0,3;
27setBaseMultigrading(M,T);
28f;
29isHomogeneous(f);
30multiDegPartition(f);
31// ---------------------
32g;
33isHomogeneous(g);
34multiDegPartition(g);
35kill r, T, M;
36ring R = 0, (x,y,z), dp;
37intmat A[2][3] =
380,0,1,
393,2,1;
40intmat T[2][1] =
41-1,
424;
43setBaseMultigrading(A, T);
44isHomogeneous(ideal(x2 - y3 -xy +z, x*y-z, x^3 - y^2*z + x^2 -y^3)); // 1
45isHomogeneous(ideal(x2 - y3 -xy +z, x*y-z, x^3 - y^2*z + x^2 -y^3), "checkGens");
46isHomogeneous(ideal(x+y, x2 - y2)); // 0
47// Degree partition:
48multiDegPartition(x2 - y3 -xy +z);
49multiDegPartition(x3 -y2z + x2 -y3 + z + 1);
50module N = gen(1) + (x+y) * gen(2), z*gen(3);
51intmat V[2][3] = 0; // 1, 2, 3,  4, 5, 6; //  column-wise weights of components!!??
52vector v1, v2;
53v1 = setModuleGrading(N[1], V); v1;
54multiDegPartition(v1);
55print( multiDeg(_) );
56v2 = setModuleGrading(N[2], V); v2;
57multiDegPartition(v2);
58print( multiDeg(_) );
59N = setModuleGrading(N, V);
60isHomogeneous(N);
61print( multiDeg(N) );
62///////////////////////////////////////
63V =
641, 2, 3,
654, 5, 6;
66v1 = setModuleGrading(N[1], V); v1;
67multiDegPartition(v1);
68print( multiDeg(_) );
69v2 = setModuleGrading(N[2], V); v2;
70multiDegPartition(v2);
71print( multiDeg(_) );
72N = setModuleGrading(N, V);
73isHomogeneous(N);
74print( multiDeg(N) );
75///////////////////////////////////////
76V =
770, 0, 0,
784, 1, 0;
79N = gen(1) + x * gen(2), z*gen(3);
80N = setModuleGrading(N, V); print(N);
81isHomogeneous(N);
82print( multiDeg(N) );
83v1 = getGradedGenerator(N,1); print(v1);
84multiDegPartition(v1);
85print( multiDeg(_) );
86N = setModuleGrading(N, V); print(N);
87isHomogeneous(N);
88print( multiDeg(N) );
89tst_status(1);$
Note: See TracBrowser for help on using the repository browser.