| 66 | #include "kernel/polys.h" |
| 67 | |
| 68 | void TestGBEngine() |
| 69 | { |
| 70 | |
| 71 | // R = MPolynomialRing_polydict(QQ,5,'w,x,y,z,C', order='degrevlex') |
| 72 | // J = (w*w - x*z, w*x - y*z, x*x - w*y, x*y - z*z, y*y - w*z) |
| 73 | |
| 74 | const short w = 1; |
| 75 | const short x = 2; |
| 76 | const short y = 3; |
| 77 | const short z = 4; |
| 78 | |
| 79 | const short N = (z - w + 1); |
| 80 | |
| 81 | char **n=(char**)omalloc(N*sizeof(char*)); |
| 82 | |
| 83 | |
| 84 | n[w-1]=omStrDup("w"); |
| 85 | n[x-1]=omStrDup("x"); |
| 86 | n[y-1]=omStrDup("y"); |
| 87 | n[z-1]=omStrDup("z"); |
| 88 | |
| 89 | |
| 90 | const int D = 3; |
| 91 | rRingOrder_t *order = (rRingOrder_t *) omAlloc0(D* sizeof(rRingOrder_t)); |
| 92 | int *block0 = (int *)omAlloc0(D * sizeof(int)); |
| 93 | int *block1 = (int *)omAlloc0(D * sizeof(int)); |
| 94 | |
| 95 | order[0] = ringorder_dp; |
| 96 | block0[0] = 1; |
| 97 | block1[0] = N; |
| 98 | |
| 99 | order[1] = ringorder_C; |
| 100 | block0[1] = 1; |
| 101 | block1[1] = N; |
| 102 | |
| 103 | ring R = rDefault(0, N, n, D, order, block0, block1); |
| 104 | |
| 105 | // ring R = rDefault(0, N, n); |
| 106 | |
| 107 | rWrite(R); PrintLn(); |
| 108 | |
| 109 | #ifdef RDEBUG |
| 110 | rDebugPrint(R); |
| 111 | #endif |
| 112 | |
| 113 | ideal I = idInit(5, 1); |
| 114 | |
| 115 | int gen = 0; |
| 116 | |
| 117 | { |
| 118 | // -xz |
| 119 | poly p = p_ISet(-1,R); |
| 120 | |
| 121 | p_SetExp(p, x, 1, R); |
| 122 | p_SetExp(p, z, 1, R); |
| 123 | p_Setm(p, R); |
| 124 | |
| 125 | assume( p_GetExp(p, x, R) == 1 ); |
no test coverage detected