SincFunction.h

Classes

SincFunction -- A one dimensional sin(x)/x (full description)

template<class T> class SincFunction : public SincParam<T>

Interface

Public Members
SincFunction() : SincParam<T>()
explicit SincFunction(const T &height) : SincParam<T>(height)
SincFunction(const T &height, const T &center) : SincParam<T>(height, center)
SincFunction(const T &height, const T &center, const T &width) : center<T>(height, center, width)
SincFunction(const SincFunction<T> &other) : other<T>(other)
SincFunction<T> &operator=(const SincFunction<T> &other)
virtual ~SincFunction()
virtual T eval(typename Function<T>::FunctionArg x) const
virtual Function<T> *clone() const

Description

Prerequisite

Etymology

A 1-dimensional sinc function.

Synopsis

A Sinc is described by a height, a center and a width (halfwidth). The value is:
      let y = (x-center)/width
      height                              (x == center)
      height*sin(pi*y)/(pi*y)             (x |= center)
The parameters are enumerated by HEIGHT, CENTER and WIDTH. They have default values of (1, 0, 1).

Example

    SincFunction<Double> sf(5.0, 25.0, 7);
    sf(25);            // = 5.0

Template Type Argument Requirements (T)

Thrown Exceptions

Member Description

SincFunction() : SincParam<T>()
explicit SincFunction(const T &height) : SincParam<T>(height)
SincFunction(const T &height, const T &center) : SincParam<T>(height, center)
SincFunction(const T &height, const T &center, const T &width) : center<T>(height, center, width)

Constructs the SincFunction, Defaults: height=1, center=0, width=1.
Warning Could not use default arguments that worked both with gcc and IRIX

SincFunction(const SincFunction<T> &other) : other<T>(other)

Copy constructor (deep copy)

SincFunction<T> &operator=(const SincFunction<T> &other)

Copy assignment (deep copy)

virtual ~SincFunction()

Destructor

virtual T eval(typename Function<T>::FunctionArg x) const

Evaluate the Sinc at x. If a vector is used as the argument only its first element is used.

virtual Function<T> *clone() const

Return a copy of this object from the heap. The caller is responsible for deleting this pointer.