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

Function psr

factory/cf_algorithm.cc:91–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89CanonicalForm
90#if 0
91psr ( 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
117psr ( const CanonicalForm &rr, const CanonicalForm &vv, const Variable & x )
118{

Callers 5

gcd_poly_pFunction · 0.85
gcd_poly_0Function · 0.85
subResGCD_pFunction · 0.85
subResGCD_0Function · 0.85
subResChainFunction · 0.85

Calls 9

tmaxFunction · 0.85
degreeFunction · 0.85
powerFunction · 0.85
LCFunction · 0.85
mvarMethod · 0.80
swapvarFunction · 0.70
CanonicalFormClass · 0.70
levelMethod · 0.45
isZeroMethod · 0.45

Tested by

no test coverage detected