37 vector<mpz_class> makeVector(mpz_class a, mpz_class b, mpz_class c, mpz_class d) {
38 vector<mpz_class> vec(4);
50 TermGrader grader(makeVector(0, 100, 10000, mpz_class(
"300000000000000007")), translator);
53 (grader, splitStrategy.get(),
false,
58 ASSERT_EQ(strategy.getMaximalValue(), mpz_class(
"300000000000020107"));
63 TermGrader grader(makeVector(1, -1, 0, 0), translator);
66 (grader, splitStrategy.get(),
true,
87 Term(
"10 0 0 0"),
Term(
"10 0 0 0")));
100 #define INNER_SIMP_TEST(strat, div, dom, degree, expectPivot) \ 102 Term gotPivot(Term(expectPivot).getVarCount()); \ 103 bool expectSimplify = !Term(expectPivot).isIdentity(); \ 104 ASSERT_EQ(strat.getInnerSimplify \ 105 (Term(div), Term(dom), degree, gotPivot), \ 107 if (expectSimplify) { \ 108 ASSERT_EQ(gotPivot, Term(expectPivot)); \ 112 #define OUTER_SIMP_TEST(strat, div, dom, degree, expectPivot) \ 114 Term gotPivot(Term(expectPivot).getVarCount()); \ 115 bool expectSimplify = !Term(expectPivot).isIdentity(); \ 116 ASSERT_EQ(strat.getOuterSimplify \ 117 (Term(div), Term(dom), degree, gotPivot), \ 119 if (expectSimplify) { \ 120 ASSERT_EQ(gotPivot, Term(expectPivot)); \ 126 TermGrader grader(makeVector(100, 10, 1, 0), translator);
130 (grader, splitStrategy.get(),
true,
133 (grader, splitStrategy.get(),
false,
137 all.consume(
Term(
"1 2 3 4"));
138 ASSERT_EQ(all.getMaximalValue(), mpz_class(
"123"));
140 one.beginConsuming();
141 one.consume(
Term(
"1 2 3 4"));
142 ASSERT_EQ(one.getMaximalValue(), mpz_class(
"123"));
170 TermGrader grader(makeVector(-100, -10, -1, 0), translator);
174 (grader, splitStrategy.get(),
true,
177 (grader, splitStrategy.get(),
false,
181 all.consume(
Term(
"1 2 3 4"));
182 ASSERT_EQ(all.getMaximalValue(), mpz_class(
"-123"));
184 one.beginConsuming();
185 one.consume(
Term(
"1 2 3 4"));
186 ASSERT_EQ(one.getMaximalValue(), mpz_class(
"-123"));
OptimizeStrategy optimizes a function on the maximal standard monomials of a monomial ideal using bra...
Represents a monomial ideal with int exponents.
#define TEST_SUITE(SUITE)
virtual void beginConsuming()
Tell the consumer to begin consuming an ideal.
static BigIdeal xx_yy_zz_t_xz_yz()
Returns .
TEST(OptimizeStrategy, Simplify)
A TermGrader assigns a value, the degree, to each monomial.
#define OUTER_SIMP_TEST(strat, div, dom, degree, expectPivot)
#define ASSERT_TRUE(VALUE)
static auto_ptr< SplitStrategy > createStrategy(const string &prefix)
Returns the strategy whose name has the given prefix.
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
This class describes the interface of a strategy object for the Slice Algorithm.
#define INNER_SIMP_TEST(strat, div, dom, degree, expectPivot)
Eliminate non-improving slices and simplify slices by trying to generate non-improving slices that ar...
#define TEST_SUITE2(PARENT, SUITE)
#define ASSERT_FALSE(VALUE)
virtual void run(const Ideal &ideal)
Run the Slice algorithm.
Term represents a product of variables which does not include a coefficient.