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

Function rComposeOrder

Singular/ipshell.cc:2480–2778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2478}
2479
2480static inline BOOLEAN rComposeOrder(const lists L, const BOOLEAN check_comp, ring R)
2481{
2482 assume(R!=NULL);
2483 long bitmask=0L;
2484 if (L->m[2].Typ()==LIST_CMD)
2485 {
2486 lists v=(lists)L->m[2].Data();
2487 int n= v->nr+2;
2488 int j_in_R,j_in_L;
2489 // do we have an entry "L",... ?: set bitmask
2490 for (int j=0; j < n-1; j++)
2491 {
2492 if (v->m[j].Typ()==LIST_CMD)
2493 {
2494 lists vv=(lists)v->m[j].Data();
2495 if ((vv->nr==1)
2496 &&(vv->m[0].Typ()==STRING_CMD)
2497 &&(strcmp((char*)vv->m[0].Data(),"L")==0))
2498 {
2499 number nn=(number)vv->m[1].Data();
2500 if (vv->m[1].Typ()==BIGINT_CMD)
2501 bitmask=n_Int(nn,coeffs_BIGINT);
2502 else if (vv->m[1].Typ()==INT_CMD)
2503 bitmask=(long)nn;
2504 else
2505 {
2506 Werror("illegal argument for pseudo ordering L: %d",vv->m[1].Typ());
2507 return TRUE;
2508 }
2509 break;
2510 }
2511 }
2512 }
2513 if (bitmask!=0) n--;
2514
2515 // initialize fields of R
2516 R->order=(rRingOrder_t *)omAlloc0((n+1)*sizeof(rRingOrder_t));
2517 R->block0=(int *)omAlloc0((n+1)*sizeof(int));
2518 R->block1=(int *)omAlloc0((n+1)*sizeof(int));
2519 R->wvhdl=(int**)omAlloc0((n+1)*sizeof(int_ptr));
2520 // init order, so that rBlocks works correctly
2521 for (j_in_R= n-2; j_in_R>=0; j_in_R--)
2522 R->order[j_in_R] = ringorder_unspec;
2523 // orderings
2524 for(j_in_R=0,j_in_L=0;j_in_R<n-1;j_in_R++,j_in_L++)
2525 {
2526 // todo: a(..), M
2527 if (v->m[j_in_L].Typ()!=LIST_CMD)
2528 {
2529 WerrorS("ordering must be list of lists");
2530 return TRUE;
2531 }
2532 lists vv=(lists)v->m[j_in_L].Data();
2533 if ((vv->nr==1)
2534 && (vv->m[0].Typ()==STRING_CMD))
2535 {
2536 if (strcmp((char*)vv->m[0].Data(),"L")==0)
2537 {

Callers 1

rComposeFunction · 0.85

Calls 15

n_IntFunction · 0.85
WerrorFunction · 0.85
omAlloc0Function · 0.85
WerrorSFunction · 0.85
PrintSFunction · 0.85
lStringFunction · 0.85
rOrderNameFunction · 0.85
si_maxFunction · 0.85
ivCopyFunction · 0.85
rSimpleOrdStrFunction · 0.85
WarnFunction · 0.85
rSetSyzCompFunction · 0.85

Tested by

no test coverage detected