casacore
Loading...
Searching...
No Matches
PoissonParam.h
Go to the documentation of this file.
1//# Copyright (C) 2002,2005
2//# Associated Universities, Inc. Washington DC, USA.
3//#
4//# This library is free software; you can redistribute it and/or modify it
5//# under the terms of the GNU Library General Public License as published by
6//# the Free Software Foundation; either version 2 of the License, or (at your
7//# option) any later version.
8//#
9//# This library is distributed in the hope that it will be useful, but WITHOUT
10//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12//# License for more details.
13//#
14//# You should have received a copy of the GNU Library General Public License
15//# along with this library; if not, write to the Free Software Foundation,
16//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17//#
18//# Correspondence concerning AIPS++ should be addressed as follows:
19//# Internet email: casa-feedback@nrao.edu.
20//# Postal address: AIPS++ Project Office
21//# National Radio Astronomy Observatory
22//# 520 Edgemont Road
23//# Charlottesville, VA 22903-2475 USA
24
25#ifndef SCIMATH_POISSONPARAM_H
26#define SCIMATH_POISSONPARAM_H
27
28//# Includes
29#include <casacore/casa/aips.h>
30#include <casacore/scimath/Functionals/Function.h>
31#include <casacore/casa/BasicSL/String.h>
32
33namespace casacore { //# NAMESPACE CASACORE - BEGIN
34
35//# Forward declarations
36
37// <summary> A one dimensional Poisson function
38// </summary>
39
40// <use visibility=local>
41
42// <reviewed reviewer="" date="" tests="tFunctionHolder"
43// demos="">
44// </reviewed>
45
46// <prerequisite>
47// <li> <linkto class="FunctionParam">FunctionParam</linkto> class
48// <li> <linkto class="Function">Function</linkto> class
49// </prerequisite>
50
51// <etymology>
52// A 1-dimensional Poisson.
53// </etymology>
54
55// <synopsis>
56// A <src>Poisson</src> is described by lambda
57// The value is:
58// <srcblock>
59// height (|x-center| == 0.0)
60// 0 (|x-center| != 0.0)
61// </srcblock>
62// The parameters are enumerated by LAMDA. They have
63// default values of 1.
64// </synopsis>
65//
66// <example>
67// <srcblock>
68// PoissonFunction<Double> sf(5.0);
69// sf(25); // = 5.0
70// </srcblock>
71// </example>
72
73// <templating arg=T>
74// <li> T should have standard numerical operators
75// </templating>
76
77// <thrown>
78// <li> AipsError if incorrect parameter number specified.
79// </thrown>
80
81template<class T> class PoissonParam : public Function<T>
82{
83public:
84 //# Enumerations
85 // Parameter numbers
86 enum { LAMBDA=0, HEIGHT};
87
88 //# Constructors
89 // Constructs the Poisson, Defaults:
90 // lambda=1.
91 // <note role=warning> Could not use default arguments
92 // that worked both with gcc and IRIX </note>
93 // <group>
95 explicit PoissonParam(const T &lambda);
96 PoissonParam( const T &lambda, const T &height );
97 // </group>
98
99 // Copy constructor (deep copy)
100 // <group>
102 template <class W>
104 Function<T>(other) {}
105 // </group>
106 // Copy assignment (deep copy)
108
109 // Destructor
110 virtual ~PoissonParam();
111
112 //# Operators
113 virtual uInt ndim() const { return 1; }
114
115 //# Member functions
116 // Give name of function
117 virtual const String &name() const {
118 static String x("poisson");
119 return x;
120 }
121
122 // Get or set lambda
123
124 T lambda() const {
125 return param_p[LAMBDA];
126 }
127 void setLambda(const T &lambda) {
129 }
130
131 T height() const {
132 return param_p[HEIGHT];
133 }
134 void setHeight(const T &height) {
136 }
137 //# Make members of parent classes known.
138protected:
139 using Function<T>::param_p;
140public:
141 using Function<T>::nparameters;
142};
143
144
145
146
147
148} //# NAMESPACE CASACORE - END
149
150#ifndef CASACORE_NO_AUTO_TEMPLATES
151#include <casacore/scimath/Functionals/PoissonParam.tcc>
152#endif //# CASACORE_NO_AUTO_TEMPLATES
153#endif
FunctionParam< T > param_p
The parameters and masks.
Definition Function.h:330
uInt nparameters() const
Returns the number of parameters.
Definition Function.h:228
PoissonParam< T > & operator=(const PoissonParam< T > &other)
Copy assignment (deep copy)
void setLambda(const T &lambda)
PoissonParam()
Constructs the Poisson, Defaults: lambda=1.
T lambda() const
Get or set lambda.
void setHeight(const T &height)
PoissonParam(const PoissonParam< W > &other)
virtual ~PoissonParam()
Destructor.
PoissonParam(const PoissonParam< T > &other)
Copy constructor (deep copy)
virtual const String & name() const
Give name of function.
PoissonParam(const T &lambda)
virtual uInt ndim() const
Returns the number of dimensions of function.
PoissonParam(const T &lambda, const T &height)
String: the storage and methods of handling collections of characters.
Definition String.h:223
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49