14 assert(v != carl::Variable::NO_VARIABLE);
15 if (
mData.size() <= v.id() - 1)
return 0;
16 return mData[v.id() - 1];
19 assert(v != carl::Variable::NO_VARIABLE);
20 if (
mData.size() <= v.id() - 1)
mData.resize(v.id());
21 return mData[v.id() - 1];
30 bool operator()(carl::Variable lhs, carl::Variable rhs)
const {
42 SMTRAT_LOG_DEBUG(
"smtrat.cad.variableordering",
"Building order based on " << polys);
43 carl::carlVariables
vars;
45 std::vector<VariableMap<std::size_t>> maxdeg;
46 maxdeg.resize(polys.size());
47 for (std::size_t i = 0; i < polys.size(); ++i) {
48 carl::variables(polys[i],
vars);
49 for (
auto var: carl::variables(polys[i])) {
50 maxdeg[i][
var] = polys[i].degree(
var);
56 data.
sum_deg[
var] = std::accumulate(maxdeg.begin(), maxdeg.end(), 0ul, [
var](std::size_t i,
const auto& m) { return i + m[var]; });
59 std::vector<carl::Variable> res(std::move(
vars.as_vector()));
T & operator[](carl::Variable v)
T operator[](carl::Variable v) const
void sort(T *array, int size, LessThan lt)
std::vector< carl::Variable > triangular_ordering(const std::vector< Poly > &polys)
std::vector< carl::Variable > vars(const std::pair< QuantifierType, std::vector< carl::Variable >> &p)
#define SMTRAT_LOG_TRACE(channel, msg)
#define SMTRAT_LOG_DEBUG(channel, msg)
bool operator()(carl::Variable lhs, carl::Variable rhs) const
VariableMap< std::size_t > sum_deg
VariableMap< std::size_t > max_deg
VariableMap< std::size_t > max_tdeg