/** @file inifcns_polylog.h * * Interface to GiNaC's initially known polylogarithmic functions. */ /* * GiNaC Copyright (C) 1999-2006 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __GINAC_INIFCNS_POLYLOG_H__ #define __GINAC_INIFCNS_POLYLOG_H__ #include "numeric.h" #include "function.h" #include "ex.h" #include "inifcns.h" namespace GiNaC { /** Generalized multiple polylogarithm. */ class G_function : public function { GINAC_DECLARE_FUNCTION(G_function) public: /** Generalized multiple polylogarithm. */ G_function(const ex& x) : inherited(&G_function::tinfo_static, x) { } /** Generalized multiple polylogarithm with explicit imaginary parts. */ G_function(const ex& x, const ex& y) : inherited(&G_function::tinfo_static, x, y) { } /** Generalized multiple polylogarithm with explicit imaginary parts. */ G_function(const ex& x, const ex& s, const ex& y) : inherited(&G_function::tinfo_static, x, s, y) { } public: virtual ex eval(int level = 0) const; virtual ex evalf(int level = 0) const; }; template inline G_function G(const T1& x1) { return G_function(x1); } template inline G_function G(const T1& x1, const T2& x2) { return G_function(x1, x2); } template inline G_function G(const T1& x1, const T2& x2, const T3& x3) { return G_function(x1, x2, x3); } /** Polylogarithm and multiple polylogarithm. */ class Li_function : public function { GINAC_DECLARE_FUNCTION_2P(Li_function) public: virtual ex eval(int level = 0) const; virtual ex evalf(int level = 0) const; virtual ex pderivative(unsigned deriv_param) const; virtual ex series(const relational& r, int order, unsigned options = 0) const; protected: void do_print_latex(const print_context& c, unsigned level) const; }; template inline Li_function Li(const T1& x1, const T2& x2) { return Li_function(x1, x2); } /** Nielsen's generalized polylogarithm. */ class S_function : public function { GINAC_DECLARE_FUNCTION_3P(S_function) public: virtual ex eval(int level = 0) const; virtual ex evalf(int level = 0) const; virtual ex pderivative(unsigned deriv_param) const; virtual ex series(const relational& r, int order, unsigned options = 0) const; protected: void do_print_latex(const print_context& c, unsigned level) const; }; template inline S_function S(const T1& x1, const T2& x2, const T3& x3) { return S_function(x1, x2, x3); } /** Harmonic polylogarithm. */ class H_function : public function { GINAC_DECLARE_FUNCTION_2P(H_function) public: virtual ex eval(int level = 0) const; virtual ex evalf(int level = 0) const; virtual ex pderivative(unsigned deriv_param) const; virtual ex series(const relational& r, int order, unsigned options = 0) const; static bool do_eval; protected: void do_print_latex(const print_context& c, unsigned level) const; }; template inline H_function H(const T1& x1, const T2& x2) { return H_function(x1, x2); } /** Multiple zeta value including Riemann's zeta-function. */ class zeta_function : public function { GINAC_DECLARE_FUNCTION(zeta_function) public: /** Multiple zeta value including Riemann's zeta-function. */ zeta_function(const ex& x) : inherited(&zeta_function::tinfo_static, x) { } /** Alternating Euler sum or colored MZV. */ zeta_function(const ex& x, const ex& s) : inherited(&zeta_function::tinfo_static, x, s) { } public: virtual ex eval(int level = 0) const; virtual ex evalf(int level = 0) const; virtual ex pderivative(unsigned deriv_param) const; public: static numeric calc(const numeric& x); protected: void do_print_latex(const print_context& c, unsigned level) const; }; template inline zeta_function zeta(const T1& x1) { return zeta_function(x1); } //inline zeta_function zeta(const ex& x1) { return zeta_function(x1); } template inline zeta_function zeta(const T1& x1, const T2& x2) { return zeta_function(x1, x2); } /** Converts a given list containing parameters for H in Remiddi/Vermaseren notation into * the corresponding GiNaC functions. */ ex convert_H_to_Li(const ex& parameterlst, const ex& arg); /** Dilogarithm. */ template inline Li_function Li2(const T1& x1) { return Li_function(2, x1); } /** Trilogarithm. */ template inline Li_function Li3(const T1& x1) { return Li_function(3, x1); } /** Derivatives of Riemann's Zeta-function. */ class zetaderiv_function : public function { GINAC_DECLARE_FUNCTION_2P(zetaderiv_function) public: virtual ex eval(int level = 0) const; virtual ex pderivative(unsigned deriv_param) const; protected: void do_print_latex(const print_context& c, unsigned level) const; }; template inline zetaderiv_function zetaderiv(const T1& x1, const T2& x2) { return zetaderiv_function(x1, x2); } } // namespace GiNaC #endif // ndef __GINAC_INIFCNS_H__