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: casa-feedback@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#ifndef SCIMATH_KAISERBFUNCTION_H
27#define SCIMATH_KAISERBFUNCTION_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/scimath/Functionals/KaiserBParam.h>
32#include <casacore/scimath/Functionals/Function.h>
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36//# Forward declarations
37
38// <summary> A one dimensional Kaiser-Bessel function
39// </summary>
40
41// <use visibility=export>
42
43// <reviewed reviewer="" date="" tests="tFunctionHolder"
44// demos="">
45// </reviewed>
46
47// <prerequisite>
48// <li> <linkto class="KaiserBParam">KaiserBParam</linkto>
49// <li> <linkto class="Function">Function</linkto>
50// </prerequisite>
51
52// <etymology>
53// A Kaiser-Bessel function
54// </etymology>
55
56// <synopsis>
57// A <src>Kaiser-Bessel</src> is described by a height, a center, a width
58// (halfwidth) and a parameter.
59// The parameters are enumerated by HEIGHT, CENTER, WIDTH, KBPAR. They have
60// default values of (1, 0, 1, 2.5).
61// </synopsis>
62//
63// <example>
64// <srcblock>
65// KaiserBFunction<Double> sf;
66// sf(0); // = 1.0
67// </srcblock>
68// </example>
69
70// <templating arg=T>
71// <li> T should have standard numerical operators
72// </templating>
73
74// <thrown>
75// <li> AipsError if incorrect parameter number specified.
76// </thrown>
77//
78
79template<class T> class KaiserBFunction : public KaiserBParam<T>
80{
81public:
82 //# Constructors
83 // Constructs the KaiserBFunction, Defaults:
84 // height=1, center=0, width=1, kbpar=2.5.
85 // <note role=warning> Could not use default arguments
86 // that worked both with gcc and IRIX </note>
87 // <group>
89 explicit KaiserBFunction(const T &kbpar) :
90 KaiserBParam<T>(kbpar) {}
91 // </group>
92
93 // Copy constructor (deep copy)
94 // <group>
95 KaiserBFunction(const KaiserBFunction<T> &other) : KaiserBParam<T>(other) {}
96 template <class W>
97 KaiserBFunction(const KaiserBFunction<W> &other) : KaiserBParam<T>(other) {}
98 // </group>
99
100
101 // Copy assignment (deep copy)
103 KaiserBParam<T>::operator=(other); return *this; }
104
105 // Destructor
106 virtual ~KaiserBFunction() {}
107
108 //# Operators
109 // Evaluate the KaiserB at <src>x</src>.
110 // If a vector is used as the argument only its first element is used.
111 // <group>
112 virtual T eval(typename Function<T>::FunctionArg x) const;
113 // </group>
114
115 //# Member functions
116 // Return a copy of this object from the heap. The caller is responsible
117 // for deleting this pointer.
118 // <group>
119 virtual Function<T> *clone() const { return new KaiserBFunction<T>(*this); }
124
125 // </group>
126
127 //# Make members of parent classes known.
128protected:
129 using KaiserBParam<T>::param_p;
130public:
131 using KaiserBParam<T>::KBPAR;
132 using KaiserBParam<T>::CENTER;
133 using KaiserBParam<T>::WIDTH;
134 using KaiserBParam<T>::HEIGHT;
135};
136
137
138} //# NAMESPACE CASACORE - END
139
140#ifndef CASACORE_NO_AUTO_TEMPLATES
141#include <casacore/scimath/Functionals/KaiserBFunction.tcc>
142#endif //# CASACORE_NO_AUTO_TEMPLATES
143#endif
FunctionParam< T > param_p
The parameters and masks.
Definition Function.h:330
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