136{
138 { "x", "y", "z"},
140 {1,1,1},
141 {},
142 {1}
143 );
150 g = y + z;
152 mh = -h;
153
154
155 F = y*z*
x*z - y*z*y*y - y*z*z*
x - z*
x*y*z + z*
x*z*y - z*y*y*y - z*z*
x*y - z*z*y*
x - z*z*z*z;
156 G = -y*z*
x*z - y*z*y*y - y*z*z*
x;
157
159 std::cout << H->getName() << std::endl;
160 H->addPolynomial(*f);
161 H->addPolynomial(*g);
164 EXPECT_TRUE(A->
is_equal(* H->value(), *h));
165 EXPECT_TRUE(A->
is_equal(* H->value(), *h));
166
167 H->removeLeadTerm();
168 EXPECT_FALSE(H->isZero());
169
170 H->removeLeadTerm();
171 EXPECT_FALSE(H->isZero());
172
173 H->removeLeadTerm();
174 EXPECT_TRUE(H->isZero());
175 EXPECT_TRUE(A->
is_zero(* H->value()));
176 H->addPolynomial(*h);
177 H->addPolynomial(*mh);
178 EXPECT_TRUE(H->isZero());
179 EXPECT_TRUE(A->
is_zero(* H->value()));
180
181 H->addPolynomial(*F);
182 H->addPolynomial(*
G);
185 std::cout << o.
str() << std::endl;
186}
std::unique_ptr< PolynomialHeap > makePolynomialHeap(HeapType type, const FreeAlgebra &F)
void var(Poly &result, int v) const
bool is_zero(const Poly &f) const
static FreeAlgebra * create(const Ring *K, const std::vector< std::string > &names, const PolynomialRing *degreeRing, const std::vector< int > °rees, const std::vector< int > &wtvecs, const std::vector< int > &heftVector)
void elem_text_out(buffer &o, const Poly &f, bool p_one, bool p_plus, bool p_parens) const
bool is_equal(const Poly &f, const Poly &g) const
Owned Poly value paired with its FreeAlgebra*, providing natural operator-overloaded arithmetic.
Free associative algebra over a coefficient ring: the non-commutative analogue of PolynomialRing.
const PolynomialRing * degreeRing(const std::vector< std::string > &names)