OptimizeStrategyTest.cpp File Reference
`#include "stdinc.h"`
`#include "OptimizeStrategy.h"`
`#include "tests.h"`
`#include "IdealFactory.h"`
`#include "Ideal.h"`
`#include "TermTranslator.h"`
`#include "TermGrader.h"`
`#include "SplitStrategy.h"`
`#include "Slice.h"`
`#include <vector>`

Go to the source code of this file.

## Macros

#define | INNER_SIMP_TEST(strat, div, dom, degree, expectPivot)
#define | OUTER_SIMP_TEST(strat, div, dom, degree, expectPivot)

## Functions

| TEST (OptimizeStrategy, Simplify)
| TEST (OptimizeStrategy, ChangedInWayRelevantToBound)
| TEST (OptimizeStrategy, SimplifyPositiveGrading)
| TEST (OptimizeStrategy, SimplifyNegativeGrading)

## Macro Definition Documentation

## INNER_SIMP_TEST

#define INNER_SIMP_TEST | ( |  | strat,
|  |  | div,
|  |  | dom,
|  |  | degree,
|  |  | expectPivot )

Value:
{ \
Term gotPivot(Term(expectPivot).getVarCount()); \
bool expectSimplify = !Term(expectPivot).isIdentity(); \
ASSERT_EQ(strat.getInnerSimplify \
(Term(div), Term(dom), degree, gotPivot), \
expectSimplify); \
if (expectSimplify) { \
ASSERT_EQ(gotPivot, Term(expectPivot)); \
} \
}
Term
Term represents a product of variables which does not include a coefficient.
Definition Term.h:49
Term::isIdentity
static bool isIdentity(const Exponent *a, size_t varCount)
Returns whether a is 1, i.e. whether all entries of a are 0.
Definition Term.h:316

Definition at line 100 of file OptimizeStrategyTest.cpp.

## OUTER_SIMP_TEST

#define OUTER_SIMP_TEST | ( |  | strat,
|  |  | div,
|  |  | dom,
|  |  | degree,
|  |  | expectPivot )

Value:
{ \
Term gotPivot(Term(expectPivot).getVarCount()); \
bool expectSimplify = !Term(expectPivot).isIdentity(); \
ASSERT_EQ(strat.getOuterSimplify \
(Term(div), Term(dom), degree, gotPivot), \
expectSimplify); \
if (expectSimplify) { \
ASSERT_EQ(gotPivot, Term(expectPivot)); \
} \
}

Definition at line 112 of file OptimizeStrategyTest.cpp.

## Function Documentation

## TEST() [1/4]

TEST | ( | OptimizeStrategy | ,
|  | ChangedInWayRelevantToBound | )

Definition at line 61 of file OptimizeStrategyTest.cpp.

## TEST() [2/4]

TEST | ( | OptimizeStrategy | ,
|  | Simplify | )

Definition at line 47 of file OptimizeStrategyTest.cpp.

## TEST() [3/4]

TEST | ( | OptimizeStrategy | ,
|  | SimplifyNegativeGrading | )

Definition at line 168 of file OptimizeStrategyTest.cpp.

## TEST() [4/4]

TEST | ( | OptimizeStrategy | ,
|  | SimplifyPositiveGrading | )

Definition at line 124 of file OptimizeStrategyTest.cpp.