* Utility functions. */
/*
- * GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2014 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
};
template<typename T, typename CoeffCMP>
-static struct compare_terms<T, CoeffCMP>
+static compare_terms<T, CoeffCMP>
make_compare_terms(const T& dummy, const CoeffCMP& coeff_cmp)
{
return compare_terms<T, CoeffCMP>(coeff_cmp);
return ec.rbegin()->second;
}
+exp_vector_t degree_vector(ex e, const exvector& vars)
+{
+ e = e.expand();
+ exp_vector_t dvec(vars.size());
+ for (std::size_t i = vars.size(); i-- != 0; ) {
+ const int deg_i = e.degree(vars[i]);
+ e = e.coeff(vars[i], deg_i);
+ dvec[i] = deg_i;
+ }
+ return dvec;
+}
+
cln::cl_I integer_lcoeff(const ex& e, const exvector& vars)
{
ex_collect_t ec;