check if poly f contains an algebraic variable a **/
| 677 | |
| 678 | /** check if poly f contains an algebraic variable a **/ |
| 679 | bool 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) |
no test coverage detected