IT++ Logo
bessel.cpp
Go to the documentation of this file.
00001 
00029 #include <itpp/base/bessel.h>
00030 #include <itpp/base/bessel/bessel_internal.h>
00031 
00032 #ifndef _MSC_VER
00033 #  include <itpp/config.h>
00034 #else
00035 #  include <itpp/config_msvc.h>
00036 #endif
00037 
00038 
00039 namespace itpp
00040 {
00041 
00042 // Bessel function of order nu
00043 double besselj(int nu, double x) { return jn(nu, x); }
00044 
00045 vec besselj(int nu, const vec &x)
00046 {
00047   vec out(x.size());
00048   for (int i = 0; i < x.size(); i++)
00049     out(i) = jn(nu, x(i));
00050 
00051   return out;
00052 }
00053 
00054 // Bessel function of order nu. nu is real.
00055 double besselj(double nu, double x) { return jv(nu, x); }
00056 
00057 vec besselj(double nu, const vec &x)
00058 {
00059   vec out(x.size());
00060   for (int i = 0; i < x.size(); i++)
00061     out(i) = jv(nu, x(i));
00062 
00063   return out;
00064 }
00065 
00066 // Bessel function of second kind of order nu
00067 double bessely(int nu, double x) { return yn(nu, x); }
00068 
00069 vec bessely(int nu, const vec &x)
00070 {
00071   vec out(x.size());
00072   for (int i = 0; i < x.size(); i++)
00073     out(i) = yn(nu, x(i));
00074 
00075   return out;
00076 }
00077 // Bessel function of second kind of order nu
00078 double bessely(double nu, double x) { return yv(nu, x); }
00079 
00080 vec bessely(double nu, const vec &x)
00081 {
00082   vec out(x.size());
00083   for (int i = 0; i < x.size(); i++)
00084     out(i) = yv(nu, x(i));
00085 
00086   return out;
00087 }
00088 
00089 // Modified Bessel function of order nu
00090 double besseli(double nu, double x) { return iv(nu, x); }
00091 
00092 vec besseli(double nu, const vec &x)
00093 {
00094   vec out(x.size());
00095   for (int i = 0; i < x.size(); i++)
00096     out(i) = iv(nu, x(i));
00097 
00098   return out;
00099 }
00100 
00101 // Modified Bessel function of second kind of order n
00102 double besselk(int n, double x) { return kn(n, x); }
00103 
00104 vec besselk(int nu, const vec &x)
00105 {
00106   vec out(x.size());
00107   for (int i = 0; i < x.size(); i++)
00108     out(i) = kn(nu, x(i));
00109 
00110   return out;
00111 }
00112 
00113 } // namespace itpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
SourceForge Logo

Generated on Wed Jul 27 2011 16:27:04 for IT++ by Doxygen 1.7.4