| 1474 | } |
| 1475 | |
| 1476 | InternalCF* |
| 1477 | InternalPoly::tryDivcoeff( InternalCF* cc, bool invert, const CanonicalForm& M, bool& fail ) |
| 1478 | { |
| 1479 | CanonicalForm c( is_imm(cc) ? cc : cc->copyObject() ); |
| 1480 | if ( inExtension() && !getReduce( var ) && invert ) |
| 1481 | { |
| 1482 | InternalCF * dummy; |
| 1483 | dummy = this->tryInvert(M, fail); |
| 1484 | if (fail) |
| 1485 | { |
| 1486 | if (getRefCount() <= 1) |
| 1487 | delete this; |
| 1488 | else |
| 1489 | decRefCount(); |
| 1490 | return dummy; |
| 1491 | } |
| 1492 | dummy = dummy->mulcoeff( cc ); |
| 1493 | if ( getRefCount() <= 1 ) |
| 1494 | { |
| 1495 | delete this; |
| 1496 | return dummy; |
| 1497 | } |
| 1498 | else |
| 1499 | { |
| 1500 | decRefCount(); |
| 1501 | return dummy; |
| 1502 | } |
| 1503 | } |
| 1504 | if ( invert ) |
| 1505 | { |
| 1506 | if ( getRefCount() <= 1 ) |
| 1507 | { |
| 1508 | delete this; |
| 1509 | return CFFactory::basic( 0 ); |
| 1510 | } |
| 1511 | else |
| 1512 | { |
| 1513 | decRefCount(); |
| 1514 | return CFFactory::basic( 0 ); |
| 1515 | } |
| 1516 | } |
| 1517 | if ( c.isOne() ) |
| 1518 | return this; |
| 1519 | else |
| 1520 | { |
| 1521 | if ( getRefCount() <= 1 ) |
| 1522 | { |
| 1523 | firstTerm = tryDivTermList( firstTerm, c, lastTerm, M, fail ); |
| 1524 | if (fail) |
| 1525 | { |
| 1526 | delete this; |
| 1527 | return CFFactory::basic (0); |
| 1528 | } |
| 1529 | if ( firstTerm && firstTerm->exp != 0 ) |
| 1530 | return this; |
| 1531 | else if ( firstTerm ) |
| 1532 | { |
| 1533 | InternalCF * res = firstTerm->coeff.getval(); |
nothing calls this directly
no test coverage detected