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

Function build_ring

Singular/dyn_modules/Order/singular.cc:233–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231
232
233static BOOLEAN build_ring(leftv result, leftv arg)
234{
235 nforder *o;
236 if (arg->Typ() == LIST_CMD) {
237 lists L = (lists)arg->Data();
238 int n = lSize(L)+1;
239 bigintmat **multtable = (bigintmat**)omAlloc(n*sizeof(bigintmat*));
240 for(int i=0; i<n; i++) {
241 multtable[i] = (bigintmat*)(L->m[i].Data());
242 }
243 o = new nforder(n, multtable, nInitChar(n_Z, 0));
244 omFree(multtable);
245 } else {
246 assume(arg->Typ() == INT_CMD);
247 int dimension = (int)(long)arg->Data();
248
249 bigintmat **multtable = (bigintmat**)omAlloc(dimension*sizeof(bigintmat*));
250 arg = arg->next;
251 for (int i=0; i<dimension; i++) {
252 multtable[i] = new bigintmat((bigintmat*)arg->Data());
253 arg = arg->next;
254 }
255 o = new nforder(dimension, multtable, nInitChar(n_Z, 0));
256 for (int i=0; i<dimension; i++) {
257 delete multtable[i];
258 }
259 omFree(multtable);
260 }
261 result->rtyp=CRING_CMD; // set the result type
262 result->data=(char*)nInitChar(nforder_type, o);// set the result data
263
264 return FALSE;
265}
266
267static BOOLEAN ideal_from_mat(leftv result, leftv arg)
268{

Callers

nothing calls this directly

Calls 4

lSizeFunction · 0.85
nInitCharFunction · 0.85
TypMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected