OSDN Git Service

Merge branch 'master' of git.sourceforge.jp:/gitroot/eos/base
[eos/hostdependX86LINUX64.git] / util / X86LINUX64 / include / gsl / gsl_sf_legendre.h
1 /* specfunc/gsl_sf_legendre.h
2  * 
3  * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004 Gerard Jungman
4  * 
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or (at
8  * your option) any later version.
9  * 
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  * 
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19
20 /* Author:  G. Jungman */
21
22 #ifndef __GSL_SF_LEGENDRE_H__
23 #define __GSL_SF_LEGENDRE_H__
24
25 #include <gsl/gsl_sf_result.h>
26
27 #undef __BEGIN_DECLS
28 #undef __END_DECLS
29 #ifdef __cplusplus
30 # define __BEGIN_DECLS extern "C" {
31 # define __END_DECLS }
32 #else
33 # define __BEGIN_DECLS /* empty */
34 # define __END_DECLS /* empty */
35 #endif
36
37 __BEGIN_DECLS
38
39
40 /* P_l(x)   l >= 0; |x| <= 1
41  *
42  * exceptions: GSL_EDOM
43  */
44 int     gsl_sf_legendre_Pl_e(const int l, const double x, gsl_sf_result * result);
45 double  gsl_sf_legendre_Pl(const int l, const double x);
46
47
48 /* P_l(x) for l=0,...,lmax; |x| <= 1
49  *
50  * exceptions: GSL_EDOM
51  */
52 int gsl_sf_legendre_Pl_array(
53   const int lmax, const double x,
54   double * result_array
55   );
56
57
58 /* P_l(x) and P_l'(x) for l=0,...,lmax; |x| <= 1
59  *
60  * exceptions: GSL_EDOM
61  */
62 int gsl_sf_legendre_Pl_deriv_array(
63   const int lmax, const double x,
64   double * result_array,
65   double * result_deriv_array
66   );
67
68
69 /* P_l(x), l=1,2,3
70  *
71  * exceptions: none
72  */
73 int gsl_sf_legendre_P1_e(double x, gsl_sf_result * result);
74 int gsl_sf_legendre_P2_e(double x, gsl_sf_result * result);
75 int gsl_sf_legendre_P3_e(double x, gsl_sf_result * result);
76 double gsl_sf_legendre_P1(const double x);
77 double gsl_sf_legendre_P2(const double x);
78 double gsl_sf_legendre_P3(const double x);
79
80
81 /* Q_0(x), x > -1, x != 1
82  *
83  * exceptions: GSL_EDOM
84  */
85 int gsl_sf_legendre_Q0_e(const double x, gsl_sf_result * result);
86 double gsl_sf_legendre_Q0(const double x);
87
88
89 /* Q_1(x), x > -1, x != 1
90  *
91  * exceptions: GSL_EDOM
92  */
93 int gsl_sf_legendre_Q1_e(const double x, gsl_sf_result * result);
94 double gsl_sf_legendre_Q1(const double x);
95
96
97 /* Q_l(x), x > -1, x != 1, l >= 0
98  *
99  * exceptions: GSL_EDOM
100  */
101 int gsl_sf_legendre_Ql_e(const int l, const double x, gsl_sf_result * result);
102 double gsl_sf_legendre_Ql(const int l, const double x);
103
104
105 /* P_l^m(x)  m >= 0; l >= m; |x| <= 1.0
106  *
107  * Note that this function grows combinatorially with l.
108  * Therefore we can easily generate an overflow for l larger
109  * than about 150.
110  *
111  * There is no trouble for small m, but when m and l are both large,
112  * then there will be trouble. Rather than allow overflows, these
113  * functions refuse to calculate when they can sense that l and m are
114  * too big.
115  *
116  * If you really want to calculate a spherical harmonic, then DO NOT
117  * use this. Instead use legendre_sphPlm() below, which  uses a similar
118  * recursion, but with the normalized functions.
119  *
120  * exceptions: GSL_EDOM, GSL_EOVRFLW
121  */
122 int     gsl_sf_legendre_Plm_e(const int l, const int m, const double x, gsl_sf_result * result);
123 double  gsl_sf_legendre_Plm(const int l, const int m, const double x);
124
125
126 /* P_l^m(x)  m >= 0; l >= m; |x| <= 1.0
127  * l=|m|,...,lmax
128  *
129  * exceptions: GSL_EDOM, GSL_EOVRFLW
130  */
131 int gsl_sf_legendre_Plm_array(
132   const int lmax, const int m, const double x,
133   double * result_array
134   );
135
136
137 /* P_l^m(x)  and d(P_l^m(x))/dx;  m >= 0; lmax >= m; |x| <= 1.0
138  * l=|m|,...,lmax
139  *
140  * exceptions: GSL_EDOM, GSL_EOVRFLW
141  */
142 int gsl_sf_legendre_Plm_deriv_array(
143   const int lmax, const int m, const double x,
144   double * result_array,
145   double * result_deriv_array
146   );
147
148
149 /* P_l^m(x), normalized properly for use in spherical harmonics
150  * m >= 0; l >= m; |x| <= 1.0
151  *
152  * There is no overflow problem, as there is for the
153  * standard normalization of P_l^m(x).
154  *
155  * Specifically, it returns:
156  *
157  *        sqrt((2l+1)/(4pi)) sqrt((l-m)!/(l+m)!) P_l^m(x)
158  *
159  * exceptions: GSL_EDOM
160  */
161 int     gsl_sf_legendre_sphPlm_e(const int l, int m, const double x, gsl_sf_result * result);
162 double  gsl_sf_legendre_sphPlm(const int l, const int m, const double x);
163
164
165 /* sphPlm(l,m,x) values
166  * m >= 0; l >= m; |x| <= 1.0
167  * l=|m|,...,lmax
168  *
169  * exceptions: GSL_EDOM
170  */
171 int gsl_sf_legendre_sphPlm_array(
172   const int lmax, int m, const double x,
173   double * result_array
174   );
175
176
177 /* sphPlm(l,m,x) and d(sphPlm(l,m,x))/dx values
178  * m >= 0; l >= m; |x| <= 1.0
179  * l=|m|,...,lmax
180  *
181  * exceptions: GSL_EDOM
182  */
183 int gsl_sf_legendre_sphPlm_deriv_array(
184   const int lmax, const int m, const double x,
185   double * result_array,
186   double * result_deriv_array
187   );
188
189
190
191 /* size of result_array[] needed for the array versions of Plm
192  * (lmax - m + 1)
193  */
194 int gsl_sf_legendre_array_size(const int lmax, const int m);
195
196 /* Irregular Spherical Conical Function
197  * P^{1/2}_{-1/2 + I lambda}(x)
198  *
199  * x > -1.0
200  * exceptions: GSL_EDOM
201  */
202 int gsl_sf_conicalP_half_e(const double lambda, const double x, gsl_sf_result * result);
203 double gsl_sf_conicalP_half(const double lambda, const double x);
204
205
206 /* Regular Spherical Conical Function
207  * P^{-1/2}_{-1/2 + I lambda}(x)
208  *
209  * x > -1.0
210  * exceptions: GSL_EDOM
211  */
212 int gsl_sf_conicalP_mhalf_e(const double lambda, const double x, gsl_sf_result * result);
213 double gsl_sf_conicalP_mhalf(const double lambda, const double x);
214
215
216 /* Conical Function
217  * P^{0}_{-1/2 + I lambda}(x)
218  *
219  * x > -1.0
220  * exceptions: GSL_EDOM
221  */
222 int gsl_sf_conicalP_0_e(const double lambda, const double x, gsl_sf_result * result);
223 double gsl_sf_conicalP_0(const double lambda, const double x);
224
225
226 /* Conical Function
227  * P^{1}_{-1/2 + I lambda}(x)
228  *
229  * x > -1.0
230  * exceptions: GSL_EDOM
231  */
232 int gsl_sf_conicalP_1_e(const double lambda, const double x, gsl_sf_result * result);
233 double gsl_sf_conicalP_1(const double lambda, const double x);
234
235
236 /* Regular Spherical Conical Function
237  * P^{-1/2-l}_{-1/2 + I lambda}(x)
238  *
239  * x > -1.0, l >= -1
240  * exceptions: GSL_EDOM
241  */
242 int gsl_sf_conicalP_sph_reg_e(const int l, const double lambda, const double x, gsl_sf_result * result);
243 double gsl_sf_conicalP_sph_reg(const int l, const double lambda, const double x);
244
245
246 /* Regular Cylindrical Conical Function
247  * P^{-m}_{-1/2 + I lambda}(x)
248  *
249  * x > -1.0, m >= -1
250  * exceptions: GSL_EDOM
251  */
252 int gsl_sf_conicalP_cyl_reg_e(const int m, const double lambda, const double x, gsl_sf_result * result);
253 double gsl_sf_conicalP_cyl_reg(const int m, const double lambda, const double x);
254
255
256 /* The following spherical functions are specializations
257  * of Legendre functions which give the regular eigenfunctions
258  * of the Laplacian on a 3-dimensional hyperbolic space.
259  * Of particular interest is the flat limit, which is
260  * Flat-Lim := {lambda->Inf, eta->0, lambda*eta fixed}.
261  */
262   
263 /* Zeroth radial eigenfunction of the Laplacian on the
264  * 3-dimensional hyperbolic space.
265  *
266  * legendre_H3d_0(lambda,eta) := sin(lambda*eta)/(lambda*sinh(eta))
267  * 
268  * Normalization:
269  * Flat-Lim legendre_H3d_0(lambda,eta) = j_0(lambda*eta)
270  *
271  * eta >= 0.0
272  * exceptions: GSL_EDOM
273  */
274 int gsl_sf_legendre_H3d_0_e(const double lambda, const double eta, gsl_sf_result * result);
275 double gsl_sf_legendre_H3d_0(const double lambda, const double eta);
276
277
278 /* First radial eigenfunction of the Laplacian on the
279  * 3-dimensional hyperbolic space.
280  *
281  * legendre_H3d_1(lambda,eta) :=
282  *    1/sqrt(lambda^2 + 1) sin(lam eta)/(lam sinh(eta))
283  *    (coth(eta) - lambda cot(lambda*eta))
284  * 
285  * Normalization:
286  * Flat-Lim legendre_H3d_1(lambda,eta) = j_1(lambda*eta)
287  *
288  * eta >= 0.0
289  * exceptions: GSL_EDOM
290  */
291 int gsl_sf_legendre_H3d_1_e(const double lambda, const double eta, gsl_sf_result * result);
292 double gsl_sf_legendre_H3d_1(const double lambda, const double eta);
293
294
295 /* l'th radial eigenfunction of the Laplacian on the
296  * 3-dimensional hyperbolic space.
297  *
298  * Normalization:
299  * Flat-Lim legendre_H3d_l(l,lambda,eta) = j_l(lambda*eta)
300  *
301  * eta >= 0.0, l >= 0
302  * exceptions: GSL_EDOM
303  */
304 int gsl_sf_legendre_H3d_e(const int l, const double lambda, const double eta, gsl_sf_result * result);
305 double gsl_sf_legendre_H3d(const int l, const double lambda, const double eta);
306
307
308 /* Array of H3d(ell),  0 <= ell <= lmax
309  */
310 int gsl_sf_legendre_H3d_array(const int lmax, const double lambda, const double eta, double * result_array);
311
312
313 __END_DECLS
314
315 #endif /* __GSL_SF_LEGENDRE_H__ */