44 ASSERT( x.
level() > 0,
"cannot calculate subresultant sequence with respect to algebraic variables" );
78 int j = (m <= n) ? n : m-1;
86 if ( m == n && j > 0 ) {
87 S[j-1] =
LC( S[j], X ) *
psr( S[j+1], S[j], X );
90 S[j-1] =
LC( S[j], X ) *
LC( S[j], X ) * S[j+1];
92 }
else if ( m > n && j > 0 ) {
98 if ( j > r && r >= 0 )
103 S[r-1] =
psr( S[j+1], S[j], X ) *
power( -R, j - r );
114 if ( j > r && r >= 0 )
115 S[
r] = (
power(
LC( S[j], X ), j - r ) * S[
j]) /
power( R, j - r );
119 S[r-1] =
psr( S[j+1], S[j], X ) /
power( -R, j - r + 2 );
125 for ( j = 0; j <= S.
max(); j++ ) {
149 if (
degree( f, x ) == 0 )
151 if (
degree( g, x ) == 0 )
155 return LC( f, x ) * g -
LC( g, x ) *
f;
175 ASSERT( x.
level() > 0,
"cannot calculate resultant with respect to algebraic variables" );
209 if ( m+n <= 2 || m == 0 || n == 0 )
219 if ( m & 1 && n & 1 )
230 extFactor = -
LC( G, X );
232 extFactor =
LC( G, X );
234 extFactor =
power(
LC( F, X ), m-n-1 );
239 return swapvar( result, X, x ) * flipFactor;
factory's class for variables
CFArray subResChain(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CFArray subResChain ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ) ...
declarations of higher level algorithms.
CanonicalForm psr(const CanonicalForm &rr, const CanonicalForm &vv, const Variable &x)
CanonicalForm psr ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ) ...
#define ASSERT(expression, message)
CanonicalForm resultant(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CanonicalForm resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ) ...
static CanonicalForm trivialResultant(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
static CanonicalForm trivialResultant ( const CanonicalForm & f, const CanonicalForm & g...