Commit f5d140bf authored by Joseph Boudreau's avatar Joseph Boudreau
Browse files

removed some extraneous pieces from the spherical bessel/neumann functions

parent ee3830ed
......@@ -40,18 +40,12 @@ namespace Genfun {
private:
// It is illegal to assign an adjustable constant
// It is illegal to assign a spherical bessel
const SphericalBessel & operator=(const SphericalBessel &right);
// Here is the decay constant
// Here is the index
unsigned int _l;
// Here is the "work function"
const AbsFunction *_function;
// This function is needed in all constructors:
void create();
};
} // namespace Genfun
#include "CLHEP/GenericFunctions/SphericalBessel.icc"
......
......@@ -20,19 +20,16 @@ inline
SphericalBessel::SphericalBessel(unsigned int l):
_l(l)
{
create();
}
inline
SphericalBessel::~SphericalBessel() {
delete _function;
}
inline
SphericalBessel::SphericalBessel(const SphericalBessel & right):
_l(right._l)
{
create();
}
inline
......@@ -48,7 +45,6 @@ double SphericalBessel::operator() (double x) const {
raise(SIGFPE);
}
return result.val;
//return (*_function)(x);
}
inline
......@@ -56,22 +52,4 @@ unsigned int SphericalBessel::l() const {
return _l;
}
inline
void SphericalBessel::create() {
Sin sine;
Cos cosine;
Variable x;
if (_l==0) {
_function = (sine/x).clone();
}
else if (_l==1) {
_function = (sine/x/x - cosine/x).clone();
}
else {
SphericalBessel j_minus(_l-1);
SphericalBessel j_minus_minus(_l-2);
_function = ((2*_l-1)*j_minus/x - j_minus_minus).clone();;
}
}
} // end namespace Genfun
......@@ -40,18 +40,12 @@ namespace Genfun {
private:
// It is illegal to assign an adjustable constant
// It is illegal to assign a spherical neumann
const SphericalNeumann & operator=(const SphericalNeumann &right);
// Here is the decay constant
// Here is the index
unsigned int _l;
// Here is the "work function"
const AbsFunction *_function;
// This function is needed in all constructors:
void create();
};
} // namespace Genfun
#include "CLHEP/GenericFunctions/SphericalNeumann.icc"
......
......@@ -20,19 +20,16 @@ inline
SphericalNeumann::SphericalNeumann(unsigned int l):
_l(l)
{
create();
}
inline
SphericalNeumann::~SphericalNeumann() {
delete _function;
}
inline
SphericalNeumann::SphericalNeumann(const SphericalNeumann & right):
_l(right._l)
{
create();
}
inline
......@@ -48,7 +45,6 @@ double SphericalNeumann::operator() (double x) const {
raise(SIGFPE);
}
return result.val;
//return (*_function)(x);
}
inline
......@@ -56,22 +52,4 @@ unsigned int SphericalNeumann::l() const {
return _l;
}
inline
void SphericalNeumann::create() {
Sin sine;
Cos cosine;
Variable x;
if (_l==0) {
_function = (-cosine/x).clone();
}
else if (_l==1) {
_function = (-cosine/x/x - sine/x).clone();
}
else {
SphericalNeumann j_minus(_l-1);
SphericalNeumann j_minus_minus(_l-2);
_function = ((2*_l-1)*j_minus/x - j_minus_minus).clone();;
}
}
} // end of namespace Genfun
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment