|
realroot_doc 0.1.1
|
#include <subresultant.hpp>
Definition at line 7 of file subresultant.hpp.
| static Polynomial pquo | ( | const Polynomial & | a, |
| const Polynomial & | b | ||
| ) | [inline, static] |
Definition at line 40 of file subresultant.hpp.
References Polynomial, and euclidean::pseudo_div().
{
Polynomial r=a, q;
pseudo_div(q, r, b);
return q;
}
| static Polynomial prem | ( | const Polynomial & | a, |
| const Polynomial & | b | ||
| ) | [inline, static] |
Definition at line 32 of file subresultant.hpp.
References Polynomial, and euclidean::pseudo_div().
{
Polynomial r=a,q;
pseudo_div(q, r, b);
return r;
}
| static void pseudo_div | ( | R & | q, |
| R & | a, | ||
| const R & | b | ||
| ) | [inline, static] |
Definition at line 11 of file subresultant.hpp.
References mmx::degree(), mmx::pow(), and mmx::shift().
Referenced by euclidean::pquo(), and euclidean::prem().
{
typedef typename R::iterator iterator;
R t;//(degree(b)+1, AsSize());
typename R::value_type lb=b[degree(b)];
q=R(0);
int c=0, da = degree(a), db = degree(b), dab =da-db+1;
while (da>=db) {
R m(a[da],da-db);
shift(t,b,da-db); t*=a[da]; // t=b*m;
c++;
a*=lb;
t[da]=a[da];
a-=t;
q+=m;
da=degree(a);
}
a *= pow(lb, dab-c);
}