Macaulay2 Engine
Loading...
Searching...
No Matches

◆ TEST() [11/19]

TEST ( NCReduction ,
TrivialPolynomialHeap  )

Definition at line 101 of file NCGroebnerTest.cpp.

102{
104 { "x", "y", "z" },
105 degreeRing(1),
106 {1,1,1},
107 {},
108 {1}
109 );
110 FreeAlgebraElement x(A), y(A), z(A), f(A), g(A), h(A);
111 A->var(*x, 0);
112 A->var(*y, 1);
113 A->var(*z, 2);
114 f = x + y;
115 g = y + z;
116 h = x + y + y + z;
117
119 H->addPolynomial(*f);
120 H->addPolynomial(*g);
121 EXPECT_TRUE(A->is_equal(* H->value(), *h));
122 EXPECT_TRUE(A->is_equal(* H->value(), *h));
123
124 H->removeLeadTerm();
125 EXPECT_FALSE(H->isZero());
126
127 H->removeLeadTerm();
128 EXPECT_FALSE(H->isZero());
129
130 H->removeLeadTerm();
131 EXPECT_TRUE(H->isZero());
132 EXPECT_TRUE(A->is_zero(* H->value()));
133}
std::unique_ptr< PolynomialHeap > makePolynomialHeap(HeapType type, const FreeAlgebra &F)
const RingQQ * globalQQ
Definition aring.cpp:24
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 > &degrees, const std::vector< int > &wtvecs, const std::vector< int > &heftVector)
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.
volatile int x
const PolynomialRing * degreeRing(const std::vector< std::string > &names)

References FreeAlgebra::create(), degreeRing(), globalQQ, FreeAlgebra::is_equal(), FreeAlgebra::is_zero(), makePolynomialHeap(), Trivial, FreeAlgebra::var(), and x.