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