]> www.ginac.de Git - ginac.git/blob - ginac/polynomial/pgcd.h
Implement modular multivariate GCD (based on chinese remaindering algorithm).
[ginac.git] / ginac / polynomial / pgcd.h
1 #ifndef GINAC_CHINREM_GCD_PGCD_H
2 #define GINAC_CHINREM_GCD_PGCD_H
3 #include "ex.h"
4
5 namespace GiNaC
6 {
7
8 /// Exception to be thrown when modular GCD algorithm fails
9 struct pgcd_failed
10 {
11         virtual ~pgcd_failed() { }
12 };
13
14 /**
15  * @brief Compute the GCD of two polynomials over a prime field Z_p
16  * 
17  * @param vars variables
18  * @param p designates the coefficient field Z_p
19  * @param A polynomial \in Z_p[vars]
20  * @param B second polynomial \in Z_p[vars]
21  */
22 extern ex
23 pgcd(const ex& A, const ex& B, const exvector& vars, const long p);
24
25 } // namespace GiNaC
26
27 #endif