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

Method tryDivcoeff

factory/int_poly.cc:1476–1573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1474}
1475
1476InternalCF*
1477InternalPoly::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();

Callers

nothing calls this directly

Calls 9

tryInvertMethod · 0.95
inExtensionFunction · 0.85
getReduceFunction · 0.85
decRefCountFunction · 0.85
copyObjectMethod · 0.80
is_immFunction · 0.70
mulcoeffMethod · 0.45
isOneMethod · 0.45
getvalMethod · 0.45

Tested by

no test coverage detected