IT++ Logo

bessel.cpp

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

Generated on Thu Apr 23 20:06:39 2009 for IT++ by Doxygen 1.5.8