288{
290 { "x", "y", "z" },
292 {1,2,3},
293 {},
294 {1}
295 );
301 g = y + z;
302 EXPECT_TRUE(
x + y == y +
x);
303 EXPECT_FALSE(f == g);
304 EXPECT_TRUE(
x * (y + z) ==
x * y +
x * z);
305 EXPECT_TRUE((f * g) * f == f * (g * f));
306 EXPECT_TRUE((f^2) == (f * f));
307
309 EXPECT_TRUE(h == y * z * y *
x * y);
310
313 EXPECT_TRUE(f == (
x - y));
314
318 std::vector<int> gdata {};
320
321 EXPECT_TRUE(f == g);
323 EXPECT_TRUE((h^0) == f);
324
331 EXPECT_TRUE(h == f*g);
334 EXPECT_TRUE(h == f*g);
335
344 EXPECT_TRUE(f == (
x + y + z));
345
348
353 EXPECT_TRUE(g == z*z*f);
356 EXPECT_TRUE(g == f*y*
x*y*
x);
359 EXPECT_TRUE(g == z*z*f*y*
x*y*
x);
360
361
368 EXPECT_TRUE(h ==
x + y);
369}
std::vector< int > monom2
std::vector< int > monom3
const Ring * coefficientRing() const
void negate(Poly &result, const Poly &f) const
bool is_unit(const Poly &f) const
void subtract(Poly &result, const Poly &f, const Poly &g) const
void mult_by_term_right(Poly &result, const Poly &f, const ring_elem c, const Monom m) const
void add_to_end(Poly &f, const Poly &g) const
void from_long(Poly &result, long n) const
void mult_by_term_left(Poly &result, const Poly &f, const ring_elem c, const Monom m) const
void mult_by_coeff(Poly &result, const Poly &f, const ring_elem c) const
void var(Poly &result, int v) const
void lead_term_as_poly(Poly &result, const Poly &f) 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 makeMonic(Poly &result, Poly &f) const
void mult_by_term_left_and_right(Poly &result, const Poly &f, const ring_elem c, const Monom leftM, const Monom rightM) const
void from_word(Poly &result, const Word &word) const
void setZero(Poly &f) 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.
virtual ring_elem from_long(long n) const =0
Non-owning view of a non-commutative word: [begin, end) of int variable indices.
const PolynomialRing * degreeRing(const std::vector< std::string > &names)