189{
191 { "x", "y", "z"},
193 {1,1,1},
194 {},
195 {1}
196 );
203 g = y + z;
205 mh = -h;
206
207
208 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;
209 G = -y*z*
x*z - y*z*y*y - y*z*z*
x;
210
212 std::cout << H->getName() << std::endl;
213 H->addPolynomial(*f);
215 H->addPolynomial(*g);
217 EXPECT_TRUE(A->
is_equal(* H->value(), *h));
218 EXPECT_TRUE(A->
is_equal(* H->value(), *h));
219
220 std::cout << "about to call removeLeadTerm" << std::endl;
221
222 H->removeLeadTerm();
223 EXPECT_FALSE(H->isZero());
224
225 H->removeLeadTerm();
226 EXPECT_FALSE(H->isZero());
227
228 H->removeLeadTerm();
229 EXPECT_TRUE(H->isZero());
230 EXPECT_TRUE(A->
is_zero(* H->value()));
231 H->addPolynomial(*h);
232 H->addPolynomial(*mh);
233 EXPECT_TRUE(H->isZero());
234 EXPECT_TRUE(A->
is_zero(* H->value()));
235
236 H->addPolynomial(*F);
237 H->addPolynomial(*
G);
240 std::cout << o.
str() << std::endl;
241}
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)