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