| 89 | CanonicalForm |
| 90 | #if 0 |
| 91 | psr ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ) |
| 92 | { |
| 93 | |
| 94 | ASSERT( x.level() > 0, "type error: polynomial variable expected" ); |
| 95 | ASSERT( ! g.isZero(), "math error: division by zero" ); |
| 96 | |
| 97 | // swap variables such that x's level is larger or equal |
| 98 | // than both f's and g's levels. |
| 99 | Variable X = tmax( tmax( f.mvar(), g.mvar() ), x ); |
| 100 | CanonicalForm F = swapvar( f, x, X ); |
| 101 | CanonicalForm G = swapvar( g, x, X ); |
| 102 | |
| 103 | // now, we have to calculate the pseudo remainder of F and G |
| 104 | // w.r.t. X |
| 105 | int fDegree = degree( F, X ); |
| 106 | int gDegree = degree( G, X ); |
| 107 | if ( (fDegree < 0) || (fDegree < gDegree) ) |
| 108 | return f; |
| 109 | else |
| 110 | { |
| 111 | CanonicalForm xresult = (power( LC( G, X ), fDegree-gDegree+1 ) * F) ; |
| 112 | CanonicalForm result = xresult -(xresult/G)*G; |
| 113 | return swapvar( result, x, X ); |
| 114 | } |
| 115 | } |
| 116 | #else |
| 117 | psr ( const CanonicalForm &rr, const CanonicalForm &vv, const Variable & x ) |
| 118 | { |
no test coverage detected