Changeset f18d7db in git
 Timestamp:
 Jul 5, 2011, 11:35:27 AM (12 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
 Children:
 faf58fa448fff6919168c75277259dc4202064b0
 Parents:
 fc15cc799d1c7198bd1e43daa447a104f50c43c0
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

kernel/gring.cc
rfc15cc7 rf18d7db 1414 1414 /* pSetComp(m,r)=0? */ 1415 1415 poly N = nc_mm_Mult_p(m, p_Head(p1,r), r); 1416 number C = n_Copy( p_GetCoeff(N, r),r);1417 number cF = n_Copy( p_GetCoeff(p2, r),r);1416 number C = p_GetCoeff(N, r); 1417 number cF = p_GetCoeff(p2, r); 1418 1418 /* GCD stuff */ 1419 1419 number cG = nGcd(C, cF, r); 1420 if ( !nEqual(cG, n_Init(1,r) ) ) 1421 { 1422 cF = nDiv(cF, cG); 1423 C = nDiv(C, cG); 1424 } 1420 if ( !n_IsOne(cG,r) ) 1421 { 1422 cF = nDiv(cF, cG); nNormalize(cF); 1423 C = nDiv(C, cG); nNormalize(C); 1424 } 1425 else 1426 { 1427 cF = n_Copy(cF, r); 1428 C = n_Copy(C, r); 1429 } 1430 n_Delete(&cG,r); 1425 1431 p2 = p_Mult_nn(p2, C, r); 1426 1432 poly out = nc_mm_Mult_pp(m, pNext(p1), r); … … 1428 1434 p_Test(p2,r); 1429 1435 p_Test(N,r); 1430 number MinusOne = n_Init(1,r); 1431 if (!n_Equal(cF,MinusOne,r)) 1436 if (!n_IsMOne(cF,r)) 1432 1437 { 1433 1438 cF = n_Neg(cF,r); … … 1441 1446 n_Delete(&cF,r); 1442 1447 n_Delete(&C,r); 1443 n_Delete(&MinusOne,r);1444 1448 return(out); 1445 1449 … … 1471 1475 poly N = nc_mm_Mult_p(m, p_Head(p1,r), r); 1472 1476 1473 number C = n_Copy( p_GetCoeff(N, r),r);1474 number cF = n_Copy( p_GetCoeff(p2, r), r);1477 number C = p_GetCoeff(N, r); 1478 number cF = p_GetCoeff(p2, r); 1475 1479 1476 1480 /* GCD stuff */ … … 1479 1483 if (!n_IsOne(cG, r)) 1480 1484 { 1481 number n_tmp; 1482 n_tmp = n_Div(cF, cG, r); n_Delete(&cF,r); cF=n_tmp; 1483 n_tmp = n_Div(C, cG, r); n_Delete(&C,r); C=n_tmp; 1484 } 1485 cF = n_Div(cF, cG, r); n_Normalize(cF,r); 1486 C = n_Div(C, cG, r); n_Normalize(C,r); 1487 } 1488 else 1489 { 1490 cF = n_Copy(cF, r); 1491 C = n_Copy(C, r); 1492 } 1493 n_Delete(&cG,r); 1485 1494 1486 1495 p2 = p_Mult_nn(p2, C, r); // p2 !!! … … 1552 1561 /* zero exponents ! */ 1553 1562 poly M1 = nc_mm_Mult_p(m1,p_Head(p1,r),r); 1554 number C1 = n_Copy(p_GetCoeff(M1,r),r);1563 number C1 = p_GetCoeff(M1,r); 1555 1564 poly M2 = nc_mm_Mult_p(m2,p_Head(p2,r),r); 1556 number C2 = n_Copy(p_GetCoeff(M2,r),r);1565 number C2 = p_GetCoeff(M2,r); 1557 1566 /* GCD stuff */ 1558 1567 number C = nGcd(C1,C2,r); 1559 if (!nEqual(C,n_Init(1,r))) 1560 { 1561 C1=nDiv(C1,C); 1562 C2=nDiv(C2,C); 1563 } 1568 if (!nIsOne(C)) 1569 { 1570 C1=nDiv(C1,C);nNormalize(C1); 1571 C2=nDiv(C2,C);nNormalize(C1); 1572 } 1573 else 1574 { 1575 C1=nCopy(C1); 1576 C2=nCopy(C2); 1577 } 1578 nDelete(&C); 1564 1579 M1=p_Mult_nn(M1,C2,r); 1565 1580 p_SetCoeff(m1,C2,r); 1566 number MinusOne=n_Init(1,r); 1567 if (n_Equal(C1,MinusOne,r)) 1581 if (n_IsMOne(C1,r)) 1568 1582 { 1569 1583 M2=p_Add_q(M1,M2,r); … … 1589 1603 // n_Delete(&C1,r); 1590 1604 // n_Delete(&C2,r); 1591 n_Delete(&MinusOne,r);1592 1605 #ifdef PDEBUG 1593 1606 p_Test(M2,r); … … 1749 1762 { 1750 1763 C1=n_Div(C1, C, r); // C1 = C1 / C 1764 n_Normalize(C1,r); 1751 1765 C2=n_Div(C2, C, r); // C2 = C2 / C 1766 n_Normalize(C2,r); 1752 1767 } 1753 1768 else
Note: See TracChangeset
for help on using the changeset viewer.