- AMPLITUDE = 0
- PERIOD
- X0
The functional form is A*cos(2*pi(x-x0)/P)
The parameter interface (see
FunctionParam class),
is used to provide an interface to the
Fitting classes.
There are 3 parameters that are used to describe the Sinusoid:
An enumeration for the AMPLITUDE, PERIOD and
X0 parameter index is provided.
This class is in general used implicitly by the Sinusoid1D
class only.
Copy constructor (deep copy)
Copy assignment (deep copy)
Destructor
Give name of function
Get or set the x0 of the Sinusoid, the location of a peak.
Get or set the period of the Sinusoid in full cycles.
Prerequisite
Etymology
A 1-dimensional sinusoid's parameters.
Synopsis
A Sinusoid1D is described by an amplitude, a period,
and a location of a peak.
The parameters (amplitude, period, and x0) may be changed at run time.
Example
Sinusoid1D<Double> sf(5.0, 25.0, 7);
sf(25); // = -4.911
sf.setAmplitude(1.0);
sf[Sinusoid1D<Double>::PERIOD] = 2.0;
sf.setX0(0.0);
sf(0.5); // = 1.0
Template Type Argument Requirements (T)
Thrown Exceptions
Member Description
enum
Parameter numbers
Sinusoid1DParam()
Constructs the Sinusoids, Defaults:
amplitude=1, period==1, x0=0. I.e. a cosinusoid with cos(x).
explicit Sinusoid1DParam(const T &litude)
Sinusoid1DParam(const T &litude, const T &period)
Sinusoid1DParam(const T &litude, const T &period, const T &x0)
Could not use default arguments
that worked both with gcc and IRIX
Sinusoid1DParam(const Sinusoid1DParam &other)
template <class W> Sinusoid1DParam(const Sinusoid1DParam<W> &other) : Function1D<T>(other)
Sinusoid1DParam<T> &operator=(const Sinusoid1DParam<T> &other)
virtual ~Sinusoid1DParam()
virtual const String &name() const
T amplitude() const
Get or set the amplitude of the Sinusoid
void setAmplitude(const T &litude)
T x0() const
void setX0(const T &x0)
T period() const
void setPeriod(const T &period)