casacore
Loading...
Searching...
No Matches
Function1D.h
Go to the documentation of this file.
1// # Function1D.h: Numerical functional interface class for 1 dimension
2// # Copyright (C) 2001,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_FUNCTION1D_H
27#define SCIMATH_FUNCTION1D_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/scimath/Functionals/Function.h>
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// # Forward declarations
36
37// <summary> Numerical functional interface class for 1 dimension
38// </summary>
39
40// <use visibility=export>
41
42// <reviewed reviewer="tcornwel" date="1996/02/22" tests="tGaussian1D"
43// demos="">
44// </reviewed>
45
46// <prerequisite>
47// <li> <linkto class="Function">Function</linkto>
48// </prerequisite>
49//
50// <synopsis>
51// A <src>Function1D</src> is used for classes which map a
52// scalar or n-dimensional Vector of type <src>T</src> into a <src>T</src>.
53// The object also has one parameter which can be masked
54// if necessary, and be used in the <src>Fitting</src> module, and, implicitly,
55// in the <linkto class=AutoDiff>AutoDiff</linkto> differentiation module.
56//
57// The only method implemented in <src>Function1D</src> is the
58// <src>ndim()</src> method. The rest is inhereted from
59// <linkto class="Function">Function</linkto>.
60// </synopsis>
61
62// <example>
63// See <linkto class=Function>Function</linkto>.
64// </example>
65//
66// <templating arg=T>
67// <li> Besides the requirements set by the
68// <linkto class="Functional">Functional</linkto> base class, it must be
69// possible to form a <src>Vector<T></src>.
70// </templating>
71
72template <class T, class U = T>
73class Function1D : public Function<T, U> {
74 public:
75 // # Typedefs
76 typedef const T *FunctionArg;
77
78 // # Constructors
79 // Constructors
80 // <group>
81 Function1D() : Function<T, U>() {}
82 explicit Function1D(const uInt n) : Function<T, U>(n) {}
83 explicit Function1D(const Vector<T> &in) : Function<T, U>(in) {}
84 Function1D(const FunctionParam<T> &other) : Function<T, U>(other) {}
85 template <class W, class X>
86 Function1D(const Function1D<W, X> &other) : Function<T, U>(other) {}
87 // </group>
88
89 // Destructor
90 virtual ~Function1D() {}
91
92 // Returns the number of dimensions of function
93 virtual uInt ndim() const { return 1; }
94
95 // # Make members of parent classes known.
96 protected:
97 using Function<T, U>::param_p;
98
99 public:
100 using Function<T, U>::nparameters;
101 using Function<T, U>::setMode;
102};
103
104} // namespace casacore
105
106#endif
const T * FunctionArg
Definition Function1D.h:76
Function1D()
Constructors.
Definition Function1D.h:81
Function1D(const Function1D< W, X > &other)
Definition Function1D.h:86
virtual uInt ndim() const
Returns the number of dimensions of function.
Definition Function1D.h:93
virtual ~Function1D()
Destructor.
Definition Function1D.h:90
Function1D(const Vector< T > &in)
Definition Function1D.h:83
Function1D(const uInt n)
Definition Function1D.h:82
Function1D(const FunctionParam< T > &other)
Definition Function1D.h:84
FunctionParam< T > param_p
Definition Function.h:337
virtual void setMode(const RecordInterface &mode)
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49