Psi4
Public Member Functions | Private Member Functions | Private Attributes | List of all members
psi::BesselFunction Class Reference

Computes a modified spherical Bessel function of the first kind. More...

#include <bessel.h>

Public Member Functions

 BesselFunction ()
 Default constructor. Creates a blank object. More...
 
 BesselFunction (int lMax, int N, int order, const double accuracy)
 Specified constructor. Will call init with given arguments. More...
 
 ~BesselFunction ()
 
void init (int lMax, int N, int order, const double accuracy)
 
void calculate (const double z, int maxL, std::vector< double > &values)
 

Private Member Functions

int tabulate (const double accuracy)
 

Private Attributes

int lMax
 Maximum angular momentum. More...
 
int N
 Number of abscissae. More...
 
int order
 Order to which the Bessel series is expanded. More...
 
double ** K
 Bessel function values. More...
 
double * C
 Coefficients for derivatives of Bessel function. More...
 
std::vector< std::vector
< double > > 
dK
 

Detailed Description

Computes a modified spherical Bessel function of the first kind.

Uses pretabulation to calculate the Bessel function up to a given maximum angular momentum. Values are interpolated using local Taylor series.

Constructor & Destructor Documentation

psi::BesselFunction::BesselFunction ( )

Default constructor. Creates a blank object.

psi::BesselFunction::BesselFunction ( int  lMax,
int  N,
int  order,
const double  accuracy 
)

Specified constructor. Will call init with given arguments.

psi::BesselFunction::~BesselFunction ( )

Member Function Documentation

void psi::BesselFunction::calculate ( const double  z,
int  maxL,
std::vector< double > &  values 
)

Calculates the Bessel function values at a given point up to a given angular momentum

Parameters
z- point at which to evaluate
maxL- maximum angular momentum needed; must be <= lMax for object
values- reference to vector in which to put the values for l = 0 to maxL
void psi::BesselFunction::init ( int  lMax,
int  N,
int  order,
const double  accuracy 
)

Initialises and pretabulates the BesselFunction up to the given angular momentum.

Parameters
lMax- the maximum angular momentum needed
N- the maximum number of points to be used in pretabulation, suggested 1600
order- the order at which the expansion is cut off, suggested 200
accuracy- the tolerance below which a value is considered converged
int psi::BesselFunction::tabulate ( const double  accuracy)
private

Pretabulates the Bessel function to a given accuracy.

Parameters
accuracy- the tolerance at which a value is considered converged
Returns
zero if successful, -1 if not converged

Member Data Documentation

double* psi::BesselFunction::C
private

Coefficients for derivatives of Bessel function.

std::vector<std::vector<double> > psi::BesselFunction::dK
private
double** psi::BesselFunction::K
private

Bessel function values.

int psi::BesselFunction::lMax
private

Maximum angular momentum.

int psi::BesselFunction::N
private

Number of abscissae.

int psi::BesselFunction::order
private

Order to which the Bessel series is expanded.


The documentation for this class was generated from the following files: