]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/flow/AliFMDFlowBessel.h
coverity 15108 fixed
[u/mrichter/AliRoot.git] / FMD / flow / AliFMDFlowBessel.h
CommitLineData
39eefe19 1// -*- mode: C++ -*-
97e94238 2/* Copyright (C) 2007 Christian Holm Christensen <cholm@nbi.dk>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation; either version 2.1 of
7 * the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17 * USA
18 */
39eefe19 19/** @file
20 @brief Declaration of Bessel functions */
97e94238 21#ifndef ALIFMDFLOWBESSEL_H
22#define ALIFMDFLOWBESSEL_H
39eefe19 23#include <cctype>
24#include <Rtypes.h>
25
26/** @defgroup z_bessel Bessel utility functions.
27 @brief This group contains a number of functions to calculate
28 the modified Bessel function of the first kind @f$
29 I_{\nu}(x)@f$ for integer and half-integer values of @f$
30 \nu@f$, of any real number @f$ x@f$.
31
32 The main entry of these functions is the function Inu, which
33 in turn call I01, Iwhole, or Ihalf. Inu always returns a list
34 of the function values for the specified values of @f$ \nu@f$.
35
36 The convinience functions I and DiffI returns a single value
37 of @f$ I_{\nu}(x)@f$ or @f$ dI_{\nu}(x)/dx@f$ for a specified
38 value of @f$ \nu@f$.
85a60ebd 39
40 @ingroup FMD_flow
41
42 @example TestBessel.cxx */
39eefe19 43
44/** Namespace for Bessel functions
45 @ingroup z_bessel */
46namespace AliFMDFlowBessel
47{
48 /** @{
49 @ingroup z_bessel */
50 /** Compute the modified Bessel functions
51 @f[
52 I_0(x) = \sum_{k=1}^\infty\frac{\left(\frac{x^2}{4}\right)^k}{(k!)^2}
53 @f]
54 and @f$ I_1(x)@f$, and their first derivatives
55 @param x Argument @f$ x@f$
56 @param bi0 On return, @f$ I_0(x)@f$
57 @param di0 On return, @f$ I_0'(x)@f$
58 @param bi1 On return, @f$ I_1(x)@f$
59 @param di1 On return, @f$ I_1'(x)@f$
60 */
61 void I01(Double_t x,
62 Double_t& bi0, Double_t& di0, Double_t& bi1, Double_t& di1);
63
64 /** Compute the modified Bessel functions @f$ I_{n/2}(x)@f$ and their
65 derivatives.
66 @param x Argument.
67 @param n Order
68 @param bi On output, @f$ I_{1/2}(x), \ldots, I_{n/2}(x)@f$ for
69 @f$ n > 0@f$ and @f$ I_{-n/2}(x), \ldots, I_{-1/2}(x)@f$ for
70 @f$ n < 0@f$
71 @param di On output, @f$ I_{1/2}'(x), \ldots, I_{n/2}'(x)@f$ for
72 @f$ n > 0@f$ and @f$ I_{-n/2}'(x), \ldots, I_{-1/2}'(x)@f$ for
73 @f$ n < 0@f$
74 @return number of valid entries in @a bi and @a di */
75 UInt_t Ihalf(Int_t n, Double_t x, Double_t* bi, Double_t* di);
76 /** Compute the modified Bessel functions @f$ I_n(x)@f$ and their
77 derivatives. Note, that @f$ I_{-n}(x) = I_n(x)@f$ and
78 @f$ dI_{-n}(x)/dx = dI_{n}(x)/dx@f$ so this function can be used
79 to evaluate @f$ I_n \forall n \in \mathcal{Z}@f$
80 @param x Argument.
81 @param n Order
82 @param bi On output, @f$ I_0(x), \ldots, I_{mn}(x)@f$
83 @param di On output, @f$ I_0'(x), \ldots, I_{mn}'(x)@f$
84 @return number of valid entries in @a bi and @a di */
85 UInt_t Iwhole(UInt_t n, Double_t x, Double_t* bi, Double_t* di);
86
87 /** Compute the modified Bessel functions @f$ I_{\nu}(x)@f$ and
88 their derivatives for @f$ \nu = n_1, n_1+1, \ldots, n_2@f$ for
89 and integer @f$ n_1, n_2@f$ or any half-integer @f$ n_1,
90 n_2@f$.
91 @param x Argument.
92 @param n1 Lower order
93 @param n2 Upper order
94 @param bi On output, @f$ I_{n_1}(x), \ldots, I_{n_2}(x)@f$
95 @param di On output, @f$ I_{n_1}'(x), \ldots, I_{n_2}'(x)@f$
96 @return number of valid entries in @a bi and @a di */
97 UInt_t Inu(Double_t n1, Double_t n2, Double_t x, Double_t* bi, Double_t* di);
98
99 /** Compute the modified Bessel function of the first kind
100 @f[
101 I_n(x) = \left(\frac{x}{2}\right)^n
102 \sum_{k=0}^\infty\frac{\left(\frac{x^2}{4}\right)^k}
103 {k!\Gamma(n+k+1)}
104 @f]
105 for arbirary integer order @f$ n@f$
106 @param n Order
107 @param x Argument
108 @return @f$ I_n(x)@f$ */
109 Double_t I(Double_t n, Double_t x);
110
111 /** Compute the derivative of the modified Bessel function of the
112 first kind
113 @f[
114 \frac{dI_n(x)}{dx} = I_{n-1}(x) - \frac{n}{x} I_{n}(x)
115 @f]
116 for arbirary integer order @f$ n@f$
117 @param n Order
118 @param x Argument
119 @return @f$ \frac{dI_n(x)}{dx}@f$ */
120 Double_t DiffI(Double_t n, Double_t x);
121 /** @} */
122}
123
124#endif
125//
126// EOF
127//
128
129