1 /** @file inifcns_polylog.h
3 * Interface to GiNaC's initially known polylogarithmic functions. */
6 * GiNaC Copyright (C) 1999-2006 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_INIFCNS_POLYLOG_H__
24 #define __GINAC_INIFCNS_POLYLOG_H__
33 /** Generalized multiple polylogarithm. */
34 class G_function : public function
36 GINAC_DECLARE_FUNCTION(G_function)
38 /** Generalized multiple polylogarithm. */
39 G_function(const ex& x) : inherited(&G_function::tinfo_static, x) { }
40 /** Generalized multiple polylogarithm with explicit imaginary parts. */
41 G_function(const ex& x, const ex& y) : inherited(&G_function::tinfo_static, x, y) { }
42 /** Generalized multiple polylogarithm with explicit imaginary parts. */
43 G_function(const ex& x, const ex& s, const ex& y) : inherited(&G_function::tinfo_static, x, s, y) { }
45 virtual ex eval(int level = 0) const;
46 virtual ex evalf(int level = 0) const;
49 template<typename T1> inline G_function G(const T1& x1) { return G_function(x1); }
50 template<typename T1, typename T2> inline G_function G(const T1& x1, const T2& x2) { return G_function(x1, x2); }
51 template<typename T1, typename T2, typename T3> inline G_function G(const T1& x1, const T2& x2, const T3& x3) { return G_function(x1, x2, x3); }
53 /** Polylogarithm and multiple polylogarithm. */
54 class Li_function : public function
56 GINAC_DECLARE_FUNCTION_2P(Li_function)
58 virtual ex eval(int level = 0) const;
59 virtual ex evalf(int level = 0) const;
60 virtual ex pderivative(unsigned deriv_param) const;
61 virtual ex series(const relational& r, int order, unsigned options = 0) const;
63 void do_print_latex(const print_context& c, unsigned level) const;
66 template<typename T1, typename T2> inline Li_function Li(const T1& x1, const T2& x2) { return Li_function(x1, x2); }
68 /** Nielsen's generalized polylogarithm. */
69 class S_function : public function
71 GINAC_DECLARE_FUNCTION_3P(S_function)
73 virtual ex eval(int level = 0) const;
74 virtual ex evalf(int level = 0) const;
75 virtual ex pderivative(unsigned deriv_param) const;
76 virtual ex series(const relational& r, int order, unsigned options = 0) const;
78 void do_print_latex(const print_context& c, unsigned level) const;
81 template<typename T1, typename T2, typename T3> inline S_function S(const T1& x1, const T2& x2, const T3& x3) { return S_function(x1, x2, x3); }
83 /** Harmonic polylogarithm. */
84 class H_function : public function
86 GINAC_DECLARE_FUNCTION_2P(H_function)
88 virtual ex eval(int level = 0) const;
89 virtual ex evalf(int level = 0) const;
90 virtual ex pderivative(unsigned deriv_param) const;
91 virtual ex series(const relational& r, int order, unsigned options = 0) const;
94 void do_print_latex(const print_context& c, unsigned level) const;
97 template<typename T1, typename T2> inline H_function H(const T1& x1, const T2& x2) { return H_function(x1, x2); }
99 /** Multiple zeta value including Riemann's zeta-function. */
100 class zeta_function : public function
102 GINAC_DECLARE_FUNCTION(zeta_function)
104 /** Multiple zeta value including Riemann's zeta-function. */
105 zeta_function(const ex& x) : inherited(&zeta_function::tinfo_static, x) { }
106 /** Alternating Euler sum or colored MZV. */
107 zeta_function(const ex& x, const ex& s) : inherited(&zeta_function::tinfo_static, x, s) { }
109 virtual ex eval(int level = 0) const;
110 virtual ex evalf(int level = 0) const;
111 virtual ex pderivative(unsigned deriv_param) const;
113 static numeric calc(const numeric& x);
115 void do_print_latex(const print_context& c, unsigned level) const;
118 template<typename T1> inline zeta_function zeta(const T1& x1) { return zeta_function(x1); }
119 //inline zeta_function zeta(const ex& x1) { return zeta_function(x1); }
120 template<typename T1, typename T2> inline zeta_function zeta(const T1& x1, const T2& x2) { return zeta_function(x1, x2); }
122 /** Converts a given list containing parameters for H in Remiddi/Vermaseren notation into
123 * the corresponding GiNaC functions.
125 ex convert_H_to_Li(const ex& parameterlst, const ex& arg);
128 template<typename T1> inline Li_function Li2(const T1& x1) { return Li_function(2, x1); }
131 template<typename T1> inline Li_function Li3(const T1& x1) { return Li_function(3, x1); }
133 /** Derivatives of Riemann's Zeta-function. */
134 class zetaderiv_function : public function
136 GINAC_DECLARE_FUNCTION_2P(zetaderiv_function)
138 virtual ex eval(int level = 0) const;
139 virtual ex pderivative(unsigned deriv_param) const;
141 void do_print_latex(const print_context& c, unsigned level) const;
144 template<typename T1, typename T2> inline zetaderiv_function zetaderiv(const T1& x1, const T2& x2) { return zetaderiv_function(x1, x2); }
148 #endif // ndef __GINAC_INIFCNS_H__