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

Function hasFirstAlgVar

factory/cf_ops.cc:679–692  ·  view source on GitHub ↗

check if poly f contains an algebraic variable a **/

Source from the content-addressed store, hash-verified

677
678/** check if poly f contains an algebraic variable a **/
679bool hasFirstAlgVar( const CanonicalForm & f, Variable & a )
680{
681 if( f.inBaseDomain() ) // f has NO alg. variable
682 return false;
683 if( f.level()<0 ) // f has only alg. vars, so take the first one
684 {
685 a = f.mvar();
686 return true;
687 }
688 for(CFIterator i=f; i.hasTerms(); i++)
689 if( hasFirstAlgVar( i.coeff(), a ))
690 return true; // 'a' is already set
691 return false;
692}
693
694/** left shift the main variable of F by n
695 * @return if x is the main variable of F the result is F(x^n)

Callers 15

factorizeFunction · 0.85
sqrFreeFunction · 0.85
EZGCD_PFunction · 0.85
gcd_polyFunction · 0.85
gcdFunction · 0.85
gcd_test_oneFunction · 0.85
uniResultantFunction · 0.85
resultantFpFunction · 0.85
TragerFunction · 0.85
mulFLINTQTruncFunction · 0.85
mulNTLFunction · 0.85
modNTLFunction · 0.85

Calls 5

mvarMethod · 0.80
hasTermsMethod · 0.80
inBaseDomainMethod · 0.45
levelMethod · 0.45
coeffMethod · 0.45

Tested by

no test coverage detected