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

Function idModulo

kernel/ideals.cc:2422–2519  ·  view source on GitHub ↗

2 * represents (h1+h2)/h2=h1/(h1 intersect h2) */ ideal idModulo (ideal h2,ideal h1)

Source from the content-addressed store, hash-verified

2420*/
2421//ideal idModulo (ideal h2,ideal h1)
2422ideal idModulo (ideal h2,ideal h1, tHomog hom, intvec ** w, matrix *T, GbVariant alg)
2423{
2424#ifdef HAVE_SHIFTBBA
2425 if (rIsLPRing(currRing))
2426 return idModuloLP(h2,h1,hom,w,T,alg);
2427#endif
2428 intvec *wtmp=NULL;
2429 if (T!=NULL) idDelete((ideal*)T);
2430
2431 int i,flength=0,slength,length;
2432
2433 if (idIs0(h2))
2434 return idFreeModule(si_max(1,h2->ncols));
2435 if (!idIs0(h1))
2436 flength = id_RankFreeModule(h1,currRing);
2437 slength = id_RankFreeModule(h2,currRing);
2438 length = si_max(flength,slength);
2439 BOOLEAN inputIsIdeal=FALSE;
2440 if (length==0)
2441 {
2442 length = 1;
2443 inputIsIdeal=TRUE;
2444 }
2445 if ((w!=NULL)&&((*w)!=NULL))
2446 {
2447 //Print("input weights:");(*w)->show(1);PrintLn();
2448 int d;
2449 int k;
2450 wtmp=new intvec(length+IDELEMS(h2));
2451 for (i=0;i<length;i++)
2452 ((*wtmp)[i])=(**w)[i];
2453 for (i=0;i<IDELEMS(h2);i++)
2454 {
2455 poly p=h2->m[i];
2456 if (p!=NULL)
2457 {
2458 d = p_Deg(p,currRing);
2459 k= pGetComp(p);
2460 if (slength>0) k--;
2461 d +=((**w)[k]);
2462 ((*wtmp)[i+length]) = d;
2463 }
2464 }
2465 //Print("weights:");wtmp->show(1);PrintLn();
2466 }
2467 ideal s_temp1;
2468 ring orig_ring=currRing;
2469 ring syz_ring=rAssure_SyzOrder(orig_ring, TRUE);
2470 rSetSyzComp(length,syz_ring);
2471 {
2472 rChangeCurrRing(syz_ring);
2473 ideal s1,s2;
2474
2475 if (syz_ring != orig_ring)
2476 {
2477 s1 = idrCopyR_NoSort(h1, orig_ring, syz_ring);
2478 s2 = idrCopyR_NoSort(h2, orig_ring, syz_ring);
2479 }

Callers

nothing calls this directly

Calls 15

rIsLPRingFunction · 0.85
idModuloLPFunction · 0.85
idIs0Function · 0.85
idFreeModuleFunction · 0.85
si_maxFunction · 0.85
p_DegFunction · 0.85
rAssure_SyzOrderFunction · 0.85
rSetSyzCompFunction · 0.85
rChangeCurrRingFunction · 0.85
idrCopyR_NoSortFunction · 0.85
idCopyFunction · 0.85
idInitFunction · 0.85

Tested by

no test coverage detected