-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.cpp
28 lines (21 loc) · 900 Bytes
/
Main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "PolynomialDivision.cpp"
int main()
{
// Define ordering on monomials
const char* ordering = "lex";
const int n = 3;
// Define Grobner basis
std::vector<Polynomial<n>> G = { Polynomial<n>("x + y + z - 3", ordering), Polynomial<n>("x^2 + y^2 + z^2 - 5", ordering), Polynomial<n>("x^3 + y^3 + z^3 - 7", ordering) };
ConvertToGrobnerBasis(G);
std::cout << "Grobner Basis:" << std::endl;
for (unsigned int i = 0; i < G.size(); ++i)
G[i].printP();
std::cout << std::endl;
Polynomial<n> f = Polynomial<n>("x^4 + y^4 + z^4 - 9", ordering);
MultivariatePolynomialDivision(f, G, false).printP();
std::cout << std::endl;
Polynomial<n> g1 = Polynomial<n>("x^5 + y^5 + z^5", ordering);
MultivariatePolynomialDivision(g1, G, false).printP();
Polynomial<n> g2 = Polynomial<n>("x^6 + y^6 + z^6", ordering);
MultivariatePolynomialDivision(g2, G, false).printP();
}