]> www.ginac.de Git - ginac.git/blob - ginac/inifcns.h
d7642ba2055f4fd85bd5839e8b94151eb97896e9
[ginac.git] / ginac / inifcns.h
1 /** @file inifcns.h
2  *
3  *  Interface to GiNaC's initially known functions. */
4
5 /*
6  *  GiNaC Copyright (C) 1999 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #ifndef __GINAC_INIFCNS_H__
24 #define __GINAC_INIFCNS_H__
25
26 #include <ginac/function.h>
27 #include <ginac/ex.h>
28
29 #ifndef NO_GINAC_NAMESPACE
30 namespace GiNaC {
31 #endif // ndef NO_GINAC_NAMESPACE
32
33 /** Sine. */
34 DECLARE_FUNCTION_1P(sin)
35
36 /** Cosine. */
37 DECLARE_FUNCTION_1P(cos)
38
39 /** Tangent. */
40 DECLARE_FUNCTION_1P(tan)
41
42 /** Exponential function. */
43 DECLARE_FUNCTION_1P(exp)
44
45 /** Natural logarithm. */
46 DECLARE_FUNCTION_1P(log)
47
48 /** Inverse sine (arc sine). */
49 DECLARE_FUNCTION_1P(asin)
50
51 /** Inverse cosine (arc cosine). */
52 DECLARE_FUNCTION_1P(acos)
53
54 /** Inverse tangent (arc tangent). */
55 DECLARE_FUNCTION_1P(atan)
56
57 /** Inverse tangent with two arguments. */
58 DECLARE_FUNCTION_2P(atan2)
59
60 /** Hyperbolic Sine. */
61 DECLARE_FUNCTION_1P(sinh)
62
63 /** Hyperbolic Cosine. */
64 DECLARE_FUNCTION_1P(cosh)
65
66 /** Hyperbolic Tangent. */
67 DECLARE_FUNCTION_1P(tanh)
68
69 /** Inverse hyperbolic Sine (area hyperbolic sine). */
70 DECLARE_FUNCTION_1P(asinh)
71
72 /** Inverse hyperbolic Cosine (area hyperbolic cosine). */
73 DECLARE_FUNCTION_1P(acosh)
74
75 /** Inverse hyperbolic Tangent (area hyperbolic tangent). */
76 DECLARE_FUNCTION_1P(atanh)
77
78 /** Dilogarithm. */
79 DECLARE_FUNCTION_1P(Li2)
80
81 /** Trilogarithm. */
82 DECLARE_FUNCTION_1P(Li3)
83
84 // overloading at work: we cannot use the macros
85 /** Riemann's Zeta-function. */
86 extern const unsigned function_index_zeta1;
87 inline function zeta(ex const & p1) {
88     return function(function_index_zeta1, p1);
89 }
90 /** Derivatives of Riemann's Zeta-function. */
91 extern const unsigned function_index_zeta2;
92 inline function zeta(ex const & p1, ex const & p2) {
93     return function(function_index_zeta2, p1, p2);
94 }
95
96 /** Gamma-function. */
97 DECLARE_FUNCTION_1P(gamma)
98
99 /** Beta-function. */
100 DECLARE_FUNCTION_2P(beta)
101
102 // overloading at work: we cannot use the macros
103 /** Psi-function (aka polygamma-function). */
104 extern const unsigned function_index_psi1;
105 inline function psi(ex const & p1) {
106     return function(function_index_psi1, p1);
107 }
108 /** Derivatives of Psi-function (aka polygamma-functions). */
109 extern const unsigned function_index_psi2;
110 inline function psi(ex const & p1, ex const & p2) {
111     return function(function_index_psi2, p1, p2);
112 }
113     
114 /** Factorial function. */
115 DECLARE_FUNCTION_1P(factorial)
116
117 /** Binomial function. */
118 DECLARE_FUNCTION_2P(binomial)
119
120 /** Order term function (for truncated power series). */
121 DECLARE_FUNCTION_1P(Order)
122
123 ex lsolve(ex const &eqns, ex const &symbols);
124
125 ex ncpower(ex const &basis, unsigned exponent);
126
127 inline bool is_order_function(ex const & e)
128 {
129     return is_ex_the_function(e, Order);
130 }
131
132 #ifndef NO_GINAC_NAMESPACE
133 } // namespace GiNaC
134 #endif // ndef NO_GINAC_NAMESPACE
135
136 #endif // ndef __GINAC_INIFCNS_H__