1 /** @file collect_vargs.h
3 * Interface to utility functions. */
6 * GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #ifndef GINAC_COLLECT_VARGS_H
24 #define GINAC_COLLECT_VARGS_H
28 #include <cln/integer.h>
29 #include <utility> // for std::pair
34 typedef std::vector<int> exp_vector_t;
35 typedef std::vector<std::pair<exp_vector_t, ex> > ex_collect_t;
38 collect_vargs(ex_collect_t& ec, const ex& e, const exvector& x);
40 ex_collect_to_ex(const ex_collect_t& ec, const exvector& x);
43 * Leading coefficient of a multivariate polynomial e, considering it
44 * as a multivariate polynomial in x_0, \ldots x_{n-1} with coefficients
45 * being univariate polynomials in R[x_n] (where R is some ring)
47 extern ex lcoeff_wrt(ex e, const exvector& x);
50 * Leading coefficient c \in R (where R = Z or Z_p) of a multivariate
51 * polynomial e \in R[x_0, \ldots, x_n]
53 extern cln::cl_I integer_lcoeff(const ex& e, const exvector& vars);
57 #endif // ndef GINAC_COLLECT_VARGS_H