]> www.ginac.de Git - ginac.git/blob - ginac/polynomial/collect_vargs.h
Copyright goes 2010.
[ginac.git] / ginac / polynomial / collect_vargs.h
1 /** @file collect_vargs.h
2  *
3  *  Interface to utility functions. */
4
5 /*
6  *  GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany
7  *
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.
12  *
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.
17  *
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
21  */
22
23 #ifndef GINAC_COLLECT_VARGS_H
24 #define GINAC_COLLECT_VARGS_H
25
26 #include "ex.h"
27
28 #include <cln/integer.h>
29 #include <utility> // for std::pair
30 #include <vector>
31
32 namespace GiNaC {
33
34 typedef std::vector<int> exp_vector_t;
35 typedef std::vector<std::pair<exp_vector_t, ex> > ex_collect_t;
36
37 extern void
38 collect_vargs(ex_collect_t& ec, const ex& e, const exvector& x);
39 extern ex
40 ex_collect_to_ex(const ex_collect_t& ec, const exvector& x);
41
42 /**
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)
46  */
47 extern ex lcoeff_wrt(ex e, const exvector& x);
48
49 /**
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]
52  */
53 extern cln::cl_I integer_lcoeff(const ex& e, const exvector& vars);
54
55 } // namespace GiNaC
56
57 #endif // ndef GINAC_COLLECT_VARGS_H