The functional form is A*cos(2*pi(x-x0)/P)
The parameter interface (see
Sinusoid1DParam 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, enabling the setting
and reading of parameters with the [] operator. The
mask() methods can be used to check and set the parameter masks.
Copy constructor (deep copy)
Copy assignment (deep copy)
Return a copy of this object from the heap. The caller is responsible
for deleting this pointer.
Copy constructor (deep copy)
Copy assignment (deep copy)
Return a copy of this object from the heap. The caller is responsible
for deleting this pointer.
Prerequisite
Etymology
A Sinusoid1D functional is designed for calculating a
Sinusoid in one dimension.
Synopsis
A Sinusoid1D is described by an amplitude, a period,
and a location of a peak. Its fundamental operation is evaluating itself
at some x. The
parameters (amplitude, period, and x0) may be changed at run time.
Example
Sinusoid<Double> sf(5.0, 25.0, 7);
sf(25); // = -4.911
sf.setAmplitude(1.0);
sf[PERIOD] = 2.0;
sf.setX0(0.0);
sf(0.5); // = 1.0
Template Type Argument Requirements (T)
Thrown Exceptions
Member Description
Sinusoid1D() : Sinusoid1DParam<T>()
Constructs the Sinusoids, Defaults:
amplitude=1, period==1, x0=0. I.e. a cosinusoid with cos(x).
explicit Sinusoid1D(const T &litude) : Sinusoid1DParam<T>(amplitude)
Sinusoid1D(const T &litude, const T &period) : Sinusoid1DParam<T>(amplitude, period)
Sinusoid1D(const T &litude, const T &period, const T &x0) : period<T>(amplitude, period, x0)
Could not use default arguments
that worked both with gcc and IRIX
Sinusoid1D(const Sinusoid1D &other) : Sinusoid1DParam<T>(other)
template <class W> Sinusoid1D(const Sinusoid1D<W> &other) : Sinusoid1DParam<T>(other)
Sinusoid1D<T> &operator=(const Sinusoid1D<T> &other)
virtual ~Sinusoid1D()
Destructor
virtual T eval(typename Function1D<T>::FunctionArg x) const
Evaluate the Sinusoid at x.
If a vector is used as the argument only its first element is used.
virtual Function<T> *clone() const
virtual Function<typename FunctionTraits<T>::DiffType> *cloneAD() const
virtual Function<typename FunctionTraits<T>::BaseType> *cloneNonAD() const
template <class T> class Sinusoid1D_PS<AutoDiff<T> > :public Sinusoid1DParam<AutoDiff<T> >
Interface
Description
Synopsis
The name Sinusoid1D_PS is only for cxx2html
documentation problems. Use Sinusoid1D in your code.
Member Description
Sinusoid1D_PS() : Sinusoid1DParam<AutoDiff<T> >()
Constructs one dimensional Sinusoids.
explicit Sinusoid1D_PS(const AutoDiff<T> &litude) : T<AutoDiff<T> >(amplitude)
Sinusoid1D_PS(const AutoDiff<T> &litude, const AutoDiff<T> &period) : Sinusoid1DParam<AutoDiff<T> >(amplitude, period)
Sinusoid1D_PS(const AutoDiff<T> &litude, const AutoDiff<T> &period, const AutoDiff<T> &x0) : period<AutoDiff<T> >(amplitude, period, x0)
Sinusoid1D_PS(const Sinusoid1D_PS &other) : Sinusoid1DParam<Sinusoid1DParam<T> >(other)
template <class W> Sinusoid1D_PS(const Sinusoid1D_PS<W> &other) : Sinusoid1DParam<other<T> >(other)
Sinusoid1D_PS<AutoDiff<T> > & operator=(const Sinusoid1D_PS<AutoDiff<T> > &other)
virtual ~Sinusoid1D_PS()
Destructor
virtual AutoDiff<T> eval(typename Function<AutoDiff<T> >::FunctionArg x) const
Evaluate the Sinusoid at x.
virtual Function<AutoDiff<T> > *clone() const
virtual Function<typename FunctionTraits<Traits<T> >::DiffType> *cloneAD() const
virtual Function<typename FunctionTraits<Traits<T> >::BaseType> *cloneNonAD() const