1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
add to FrobeniusStrategy:
virtual bool consideringCall(const ExternalTerm& b,
bool sameExponentAsNext,
const TermTree& tree) {
unsigned int position = tree.getPosition();
return
_bounds[position] + _degreeMultiples[position][b[position]]
> _maximumDegreeSeen;
}
bool canSkipDueToUpperBound(const TermTree& tree, const Degree& degree) {
unsigned int position = tree.getPosition();
// Computing the bounds takes more time tham it saves in this
// case.
if (position > _dimension - 3)
return false;
ExternalTerm lcm(_dimension);
tree.lcm(lcm);
Degree upperBound = degree;
for (unsigned int i = position; i < _dimension; ++i) {
ASSERT(lcm[i] > 0);
upperBound += _degreeMultiples[i][lcm[i] - 1];
}
_bounds[position] = upperBound - _degreeMultiples[position][lcm[position] - 1];
return upperBound <= _maximumDegreeSeen;
}
vector<Degree> _bounds;
|