casacore
Loading...
Searching...
No Matches
KaiserBFunction.h
Go to the documentation of this file.
1//# KaiserBFunction.h: A one dimensional Kaiser-Bessel function
2//# Copyright (C) 2002,2005
3//# Associated Universities, Inc. Washington DC, USA.
4//#
5//# This library is free software; you can redistribute it and/or modify it
6//# under the terms of the GNU Library General Public License as published by
7//# the Free Software Foundation; either version 2 of the License, or (at your
8//# option) any later version.
9//#
10//# This library is distributed in the hope that it will be useful, but WITHOUT
11//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13//# License for more details.
14//#
15//# You should have received a copy of the GNU Library General Public License
16//# along with this library; if not, write to the Free Software Foundation,
17//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18//#
19//# Correspondence concerning AIPS++ should be addressed as follows:
20//# Internet email: aips2-request@nrao.edu.
21//# Postal address: AIPS++ Project Office
22//# National Radio Astronomy Observatory
23//# 520 Edgemont Road
24//# Charlottesville, VA 22903-2475 USA
25//#
26//# $Id$
27
28#ifndef SCIMATH_KAISERBFUNCTION_H
29#define SCIMATH_KAISERBFUNCTION_H
30
31//# Includes
32#include <casacore/casa/aips.h>
33#include <casacore/scimath/Functionals/KaiserBParam.h>
34#include <casacore/scimath/Functionals/Function.h>
35
36namespace casacore { //# NAMESPACE CASACORE - BEGIN
37
38//# Forward declarations
39
40// <summary> A one dimensional Kaiser-Bessel function
41// </summary>
42
43// <use visibility=export>
44
45// <reviewed reviewer="" date="" tests="tFunctionHolder"
46// demos="">
47// </reviewed>
48
49// <prerequisite>
50// <li> <linkto class="KaiserBParam">KaiserBParam</linkto>
51// <li> <linkto class="Function">Function</linkto>
52// </prerequisite>
53
54// <etymology>
55// A Kaiser-Bessel function
56// </etymology>
57
58// <synopsis>
59// A <src>Kaiser-Bessel</src> is described by a height, a center, a width
60// (halfwidth) and a parameter.
61// The parameters are enumerated by HEIGHT, CENTER, WIDTH, KBPAR. They have
62// default values of (1, 0, 1, 2.5).
63// </synopsis>
64//
65// <example>
66// <srcblock>
67// KaiserBFunction<Double> sf;
68// sf(0); // = 1.0
69// </srcblock>
70// </example>
71
72// <templating arg=T>
73// <li> T should have standard numerical operators
74// </templating>
75
76// <thrown>
77// <li> AipsError if incorrect parameter number specified.
78// </thrown>
79//
80
81template<class T> class KaiserBFunction : public KaiserBParam<T>
82{
83public:
84 //# Constructors
85 // Constructs the KaiserBFunction, Defaults:
86 // height=1, center=0, width=1, kbpar=2.5.
87 // <note role=warning> Could not use default arguments
88 // that worked both with gcc and IRIX </note>
89 // <group>
91 explicit KaiserBFunction(const T &kbpar) :
92 KaiserBParam<T>(kbpar) {}
93 // </group>
94
95 // Copy constructor (deep copy)
96 // <group>
97 KaiserBFunction(const KaiserBFunction<T> &other) : KaiserBParam<T>(other) {}
98 template <class W>
99 KaiserBFunction(const KaiserBFunction<W> &other) : KaiserBParam<T>(other) {}
100 // </group>
101
102
103 // Copy assignment (deep copy)
105 KaiserBParam<T>::operator=(other); return *this; }
106
107 // Destructor
108 virtual ~KaiserBFunction() {}
109
110 //# Operators
111 // Evaluate the KaiserB at <src>x</src>.
112 // If a vector is used as the argument only its first element is used.
113 // <group>
114 virtual T eval(typename Function<T>::FunctionArg x) const;
115 // </group>
116
117 //# Member functions
118 // Return a copy of this object from the heap. The caller is responsible
119 // for deleting this pointer.
120 // <group>
121 virtual Function<T> *clone() const { return new KaiserBFunction<T>(*this); }
126
127 // </group>
128
129 //# Make members of parent classes known.
130protected:
131 using KaiserBParam<T>::param_p;
132public:
133 using KaiserBParam<T>::KBPAR;
134 using KaiserBParam<T>::CENTER;
135 using KaiserBParam<T>::WIDTH;
136 using KaiserBParam<T>::HEIGHT;
137};
138
139
140} //# NAMESPACE CASACORE - END
141
142#ifndef CASACORE_NO_AUTO_TEMPLATES
143#include <casacore/scimath/Functionals/KaiserBFunction.tcc>
144#endif //# CASACORE_NO_AUTO_TEMPLATES
145#endif
FunctionParam< T > param_p
The parameters and masks.
Definition Function.h:332
virtual ~KaiserBFunction()
Destructor.
KaiserBFunction()
Constructs the KaiserBFunction, Defaults: height=1, center=0, width=1, kbpar=2.5.
virtual T eval(typename Function< T >::FunctionArg x) const
Evaluate the KaiserB at x.
KaiserBFunction(const KaiserBFunction< T > &other)
Copy constructor (deep copy)
KaiserBFunction< T > & operator=(const KaiserBFunction< T > &other)
Copy assignment (deep copy)
KaiserBFunction(const KaiserBFunction< W > &other)
virtual Function< typename FunctionTraits< T >::BaseType > * cloneNonAD() const
virtual Function< T > * clone() const
Return a copy of this object from the heap.
virtual Function< typename FunctionTraits< T >::DiffType > * cloneAD() const
KaiserBFunction(const T &kbpar)
KaiserBParam< T > & operator=(const KaiserBParam< T > &other)
Copy assignment (deep copy)
this file contains all the compiler specific defines
Definition mainpage.dox:28