28#ifndef ENDFIELDMODEL_TANH_H_
29#define ENDFIELDMODEL_TANH_H_
56 Tanh(
double x0,
double lambda,
int max_index);
71 void rescale(
double scaleFactor);
85 double getTanh(
double x,
int n)
const;
116 std::ostream&
print(std::ostream& out)
const;
124 static std::vector< std::vector< std::vector<int> > >
_tdi;
Calculate the Tanh function (e.g.
virtual void setMaximumDerivative(size_t n)
Set the maximum derivative prior to tracking.
double getCentreLength() const
Nominal flat top length is twice x0 (one x0 in each direction)
static void setTanhDiffIndices(size_t n)
Set the value of tanh differential indices to nth order differentials.
double function(double x, int n) const
Double Tanh is given by .
double getNegTanh(double x, int n) const
Returns the value of tanh((x-x0)/lambda) or its derivative.
void setX0(double x0)
Set x0 (flat top length)
double getX0() const
Return x0 (flat top length)
void setLambda(double lambda)
Set lambda (end length)
std::ostream & print(std::ostream &out) const
Prints a human readable string to out.
static std::vector< std::vector< int > > getTanhDiffIndices(size_t n)
Get all the tanh differential indices .
double getLambda() const
Return lambda (end length)
void rescale(double scaleFactor)
Rescale the end field by a factor x0.
~Tanh()
Destructor (no mallocs so does nothing)
Tanh * clone() const
Inherited copy constructor.
static std::vector< std::vector< std::vector< int > > > _tdi
_tdi indexes powers of tanh in d^n tanh/dx^n as sum of powers of tanh
double getEndLength() const
Return nominal fringe field length.
Tanh()
Default constructor (initialises x0 and lambda to 0)
double getTanh(double x, int n) const
Returns the value of tanh((x+x0)/lambda) or its derivative.
Tanh(const Tanh &rhs)
Copy constructor.