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

Generated on Sat Jul 6 2013 10:54:19 for IT++ by Doxygen 1.8.2