]> www.ginac.de Git - ginac.git/blob - ginac/polynomial/gcd_uvar.cpp
Rewritten heuristic and PRS GCD for univariate polynomials, added benchmark.
[ginac.git] / ginac / polynomial / gcd_uvar.cpp
1 #include "upoly.hpp"
2 #include "sr_gcd_uvar.h"
3 #include "heur_gcd_uvar.h"
4 #include <stdexcept>
5
6 namespace GiNaC
7 {
8
9 upoly sr_gcd(const upoly& a, const upoly& b)
10 {
11         upoly g;
12         bool found = sr_gcd_priv(g, a, b);
13         if (found)
14                 return g;
15
16         throw std::runtime_error("failed to compute gcd");
17 }
18
19 bool heur_gcd_z(upoly& g, const upoly& a, const upoly& b)
20 {
21         return heur_gcd_z_priv(g, a, b);
22 }
23
24 upoly pseudoremainder(const upoly& a, const upoly& b)
25 {
26         upoly r;
27         pseudoremainder(r, a, b);
28         return r;
29
30 }
31
32 }
33