2 *computes the quotient of h1,h2 */
| 1504 | *computes the quotient of h1,h2 |
| 1505 | */ |
| 1506 | ideal idQuot (ideal h1, ideal h2, BOOLEAN h1IsStb, BOOLEAN resultIsIdeal) |
| 1507 | { |
| 1508 | // first check for special case h1:(0) |
| 1509 | if (idIs0(h2)) |
| 1510 | { |
| 1511 | ideal res; |
| 1512 | if (resultIsIdeal) |
| 1513 | { |
| 1514 | res = idInit(1,1); |
| 1515 | res->m[0] = pOne(); |
| 1516 | } |
| 1517 | else |
| 1518 | res = idFreeModule(h1->rank); |
| 1519 | return res; |
| 1520 | } |
| 1521 | int i, kmax; |
| 1522 | BOOLEAN addOnlyOne=TRUE; |
| 1523 | tHomog hom=isNotHomog; |
| 1524 | intvec * weights1; |
| 1525 | |
| 1526 | ideal s_h4 = idInitializeQuot (h1,h2,h1IsStb,&addOnlyOne,&kmax); |
| 1527 | |
| 1528 | hom = (tHomog)idHomModule(s_h4,currRing->qideal,&weights1); |
| 1529 | |
| 1530 | ring orig_ring=currRing; |
| 1531 | ring syz_ring=rAssure_SyzOrder(orig_ring,TRUE); |
| 1532 | rSetSyzComp(kmax-1,syz_ring); |
| 1533 | rChangeCurrRing(syz_ring); |
| 1534 | if (orig_ring!=syz_ring) |
| 1535 | // s_h4 = idrMoveR_NoSort(s_h4,orig_ring, syz_ring); |
| 1536 | s_h4 = idrMoveR(s_h4,orig_ring, syz_ring); |
| 1537 | idTest(s_h4); |
| 1538 | |
| 1539 | #if 0 |
| 1540 | matrix m=idModule2Matrix(idCopy(s_h4)); |
| 1541 | PrintS("start:\n"); |
| 1542 | ipPrint_MA0(m,"Q"); |
| 1543 | idDelete((ideal *)&m); |
| 1544 | PrintS("last elem:");wrp(s_h4->m[IDELEMS(s_h4)-1]);PrintLn(); |
| 1545 | #endif |
| 1546 | |
| 1547 | ideal s_h3; |
| 1548 | BITSET old_test1; |
| 1549 | SI_SAVE_OPT1(old_test1); |
| 1550 | if (TEST_OPT_RETURN_SB) si_opt_1 |= Sy_bit(OPT_REDTAIL_SYZ); |
| 1551 | if (addOnlyOne) |
| 1552 | { |
| 1553 | if(!rField_is_Ring(currRing)) si_opt_1 |= Sy_bit(OPT_SB_1); |
| 1554 | s_h3 = kStd(s_h4,currRing->qideal,hom,&weights1,NULL,0/*kmax-1*/,IDELEMS(s_h4)-1); |
| 1555 | } |
| 1556 | else |
| 1557 | { |
| 1558 | s_h3 = kStd(s_h4,currRing->qideal,hom,&weights1,NULL,kmax-1); |
| 1559 | } |
| 1560 | SI_RESTORE_OPT1(old_test1); |
| 1561 | |
| 1562 | #if 0 |
| 1563 | // only together with the above debug stuff |
no test coverage detected