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

Function TestGBEngine

kernel/spectrum/test.cc:64–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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