28#ifndef ENDFIELDMODEL_ENGE_H_
29#define ENDFIELDMODEL_ENGE_H_
57 Enge(
const std::vector<double>
a,
double x0,
double lambda);
69 void rescale(
double scaleFactor);
72 inline double function(
double x,
int n)
const;
81 std::ostream&
print(std::ostream& out)
const;
108 double getEnge(
double x,
int n)
const;
118 double hN(
double x,
int n)
const;
125 double gN(
double x,
int n)
const;
135 inline static std::vector< std::vector<int> >
getQIndex(
int n);
138 inline static std::vector< std::vector<int> >
getHIndex(
int n);
142 std::vector<double>
_a;
146 static std::vector< std::vector< std::vector<int> > >
_q;
148 static std::vector< std::vector< std::vector<int> > >
_h;
Enge class is a symmetric Enge function for analytical field models.
std::vector< double > getCoefficients() const
Returns the enge polynomial coefficients (a_i)
Enge & operator=(const Enge &enge)
void rescale(double scaleFactor)
Rescale so Enge(x) -> Enge(scaleFactor*x)
void setMaximumDerivative(size_t n)
Calls setEngeDiffIndices to set the maximum derivative.
Enge()
Default constructor.
Enge * clone() const
Inheritable copy constructor - no mallocs, so does nothing.
double getEndLength() const
Nominal end length is lambda.
~Enge()
Destructor - no mallocs, so does nothing.
double getDoubleEnge(double x, int n) const
Returns and its derivatives.
void setLambda(double lambda)
Sets the value of lambda.
double getX0() const
Returns the value of x0.
static std::vector< std::vector< std::vector< int > > > _h
Indexes the derivatives of g in terms of h.
static std::vector< std::vector< std::vector< int > > > _q
Indexes the derivatives of enge in terms of g.
double gN(double x, int n) const
Returns or its derivative.
static void setEngeDiffIndices(size_t n)
Recursively calculate the indices for Enge and H.
void setCoefficients(std::vector< double > a)
Sets the enge polynomial coefficients (a_i)
void setX0(double x0)
Sets the value of x0.
static std::vector< std::vector< int > > getQIndex(int n)
Return the indices for calculating the nth derivative of Enge ito g(x)
static std::vector< std::vector< int > > getHIndex(int n)
Return the indices for calculating the nth derivative of g(x) ito h(x)
double hN(double x, int n) const
Returns or its derivative.
double getLambda() const
Returns the value of lambda.
double function(double x, int n) const
Return the value of enge(x+x0) + enge(-x-x0) at some point x.
double getEnge(double x, int n) const
Returns the value of the Enge function or its derivative.
std::ostream & print(std::ostream &out) const
Print human-readable version of enge.
double getCentreLength() const
Nominal centre length is x0/2.