MCPcopy Create free account
hub / github.com/Singular/Singular / TestGBEngine

Function TestGBEngine

kernel/combinatorics/test.cc:70–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.70

Calls 15

omAlloc0Function · 0.85
rWriteFunction · 0.85
rDebugPrintFunction · 0.85
idInitFunction · 0.85
p_ISetFunction · 0.85
p_SetExpFunction · 0.85
p_SetmFunction · 0.85
p_GetExpFunction · 0.85
p_Add_qFunction · 0.85
PrintSFunction · 0.85
idShowFunction · 0.85
rChangeCurrRingFunction · 0.85

Tested by

no test coverage detected