IT++ Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bessel.cpp
Go to the documentation of this file.
1 
29 #include <itpp/base/bessel.h>
30 #include <itpp/base/bessel/bessel_internal.h>
31 
32 #ifndef _MSC_VER
33 # include <itpp/config.h>
34 #else
35 # include <itpp/config_msvc.h>
36 #endif
37 
38 
39 namespace itpp
40 {
41 
42 // Bessel function of order nu
43 double besselj(int nu, double x) { return jn(nu, x); }
44 
45 vec besselj(int nu, const vec &x)
46 {
47  vec out(x.size());
48  for (int i = 0; i < x.size(); i++)
49  out(i) = jn(nu, x(i));
50 
51  return out;
52 }
53 
54 // Bessel function of order nu. nu is real.
55 double besselj(double nu, double x) { return jv(nu, x); }
56 
57 vec besselj(double nu, const vec &x)
58 {
59  vec out(x.size());
60  for (int i = 0; i < x.size(); i++)
61  out(i) = jv(nu, x(i));
62 
63  return out;
64 }
65 
66 // Bessel function of second kind of order nu
67 double bessely(int nu, double x) { return yn(nu, x); }
68 
69 vec bessely(int nu, const vec &x)
70 {
71  vec out(x.size());
72  for (int i = 0; i < x.size(); i++)
73  out(i) = yn(nu, x(i));
74 
75  return out;
76 }
77 // Bessel function of second kind of order nu
78 double bessely(double nu, double x) { return yv(nu, x); }
79 
80 vec bessely(double nu, const vec &x)
81 {
82  vec out(x.size());
83  for (int i = 0; i < x.size(); i++)
84  out(i) = yv(nu, x(i));
85 
86  return out;
87 }
88 
89 // Modified Bessel function of order nu
90 double besseli(double nu, double x) { return iv(nu, x); }
91 
92 vec besseli(double nu, const vec &x)
93 {
94  vec out(x.size());
95  for (int i = 0; i < x.size(); i++)
96  out(i) = iv(nu, x(i));
97 
98  return out;
99 }
100 
101 // Modified Bessel function of second kind of order n
102 double besselk(int n, double x) { return kn(n, x); }
103 
104 vec besselk(int nu, const vec &x)
105 {
106  vec out(x.size());
107  for (int i = 0; i < x.size(); i++)
108  out(i) = kn(nu, x(i));
109 
110  return out;
111 }
112 
113 } // namespace itpp
SourceForge Logo

Generated on Fri Mar 21 2014 17:14:12 for IT++ by Doxygen 1.8.1.2