3 * Interface to GiNaC's initially known functions. */
6 * GiNaC Copyright (C) 1999-2004 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef __GINAC_INIFCNS_H__
24 #define __GINAC_INIFCNS_H__
31 /** Complex conjugate. */
32 DECLARE_FUNCTION_1P(conjugate)
34 /** Absolute value. */
35 DECLARE_FUNCTION_1P(abs)
38 DECLARE_FUNCTION_1P(csgn)
40 /** Eta function: log(a*b) == log(a) + log(b) + eta(a, b). */
41 DECLARE_FUNCTION_2P(eta)
44 DECLARE_FUNCTION_1P(sin)
47 DECLARE_FUNCTION_1P(cos)
50 DECLARE_FUNCTION_1P(tan)
52 /** Exponential function. */
53 DECLARE_FUNCTION_1P(exp)
55 /** Natural logarithm. */
56 DECLARE_FUNCTION_1P(log)
58 /** Inverse sine (arc sine). */
59 DECLARE_FUNCTION_1P(asin)
61 /** Inverse cosine (arc cosine). */
62 DECLARE_FUNCTION_1P(acos)
64 /** Inverse tangent (arc tangent). */
65 DECLARE_FUNCTION_1P(atan)
67 /** Inverse tangent with two arguments. */
68 DECLARE_FUNCTION_2P(atan2)
70 /** Hyperbolic Sine. */
71 DECLARE_FUNCTION_1P(sinh)
73 /** Hyperbolic Cosine. */
74 DECLARE_FUNCTION_1P(cosh)
76 /** Hyperbolic Tangent. */
77 DECLARE_FUNCTION_1P(tanh)
79 /** Inverse hyperbolic Sine (area hyperbolic sine). */
80 DECLARE_FUNCTION_1P(asinh)
82 /** Inverse hyperbolic Cosine (area hyperbolic cosine). */
83 DECLARE_FUNCTION_1P(acosh)
85 /** Inverse hyperbolic Tangent (area hyperbolic tangent). */
86 DECLARE_FUNCTION_1P(atanh)
89 DECLARE_FUNCTION_1P(Li2)
92 DECLARE_FUNCTION_1P(Li3)
94 /** Derivatives of Riemann's Zeta-function. */
95 DECLARE_FUNCTION_2P(zetaderiv)
97 // overloading at work: we cannot use the macros here
98 /** Multiple zeta value including Riemann's zeta-function. */
99 class zeta1_SERIAL { public: static unsigned serial; };
100 template<typename T1>
101 inline function zeta(const T1& p1) {
102 return function(zeta1_SERIAL::serial, ex(p1));
104 /** Alternating Euler sum or colored MZV. */
105 class zeta2_SERIAL { public: static unsigned serial; };
106 template<typename T1, typename T2>
107 inline function zeta(const T1& p1, const T2& p2) {
108 return function(zeta2_SERIAL::serial, ex(p1), ex(p2));
111 template<> inline bool is_the_function<class zeta_SERIAL>(const ex& x)
113 return is_the_function<zeta1_SERIAL>(x) || is_the_function<zeta2_SERIAL>(x);
116 /** Polylogarithm and multiple polylogarithm. */
117 DECLARE_FUNCTION_2P(Li)
119 /** Nielsen's generalized polylogarithm. */
120 DECLARE_FUNCTION_3P(S)
122 /** Harmonic polylogarithm. */
123 DECLARE_FUNCTION_2P(H)
125 /** Gamma-function. */
126 DECLARE_FUNCTION_1P(lgamma)
127 DECLARE_FUNCTION_1P(tgamma)
129 /** Beta-function. */
130 DECLARE_FUNCTION_2P(beta)
132 // overloading at work: we cannot use the macros here
133 /** Psi-function (aka digamma-function). */
134 class psi1_SERIAL { public: static unsigned serial; };
135 template<typename T1>
136 inline function psi(const T1 & p1) {
137 return function(psi1_SERIAL::serial, ex(p1));
139 /** Derivatives of Psi-function (aka polygamma-functions). */
140 class psi2_SERIAL { public: static unsigned serial; };
141 template<typename T1, typename T2>
142 inline function psi(const T1 & p1, const T2 & p2) {
143 return function(psi2_SERIAL::serial, ex(p1), ex(p2));
146 template<> inline bool is_the_function<class psi_SERIAL>(const ex & x)
148 return is_the_function<psi1_SERIAL>(x) || is_the_function<psi2_SERIAL>(x);
151 /** Factorial function. */
152 DECLARE_FUNCTION_1P(factorial)
154 /** Binomial function. */
155 DECLARE_FUNCTION_2P(binomial)
157 /** Order term function (for truncated power series). */
158 DECLARE_FUNCTION_1P(Order)
160 ex lsolve(const ex &eqns, const ex &symbols, unsigned options = solve_algo::automatic);
162 /** Check whether a function is the Order (O(n)) function. */
163 inline bool is_order_function(const ex & e)
165 return is_ex_the_function(e, Order);
168 /** Converts a given list containing parameters for H in Remiddi/Vermaseren notation into
169 * the corresponding GiNaC functions.
171 ex convert_H_to_Li(const ex& parameterlst, const ex& arg);
175 #endif // ndef __GINAC_INIFCNS_H__