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: 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>
33#include <casacore/scimath/Functionals/Function.h>
34
35namespace 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
75template<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.
98protected:
99 using Function<T,U>::param_p;
100public:
101 using Function<T,U>::nparameters;
102 using Function<T,U>::setMode;
103};
104
105
106} //# NAMESPACE CASACORE - END
107
108#endif
const T * FunctionArg
Definition Function1D.h:78
Function1D()
Constructors.
Definition Function1D.h:83
Function1D(const Function1D< W, X > &other)
Definition Function1D.h:88
virtual uInt ndim() const
Returns the number of dimensions of function.
Definition Function1D.h:95
virtual ~Function1D()
Destructor.
Definition Function1D.h:92
Function1D(const Vector< T > &in)
Definition Function1D.h:85
Function1D(const uInt n)
Definition Function1D.h:84
Function1D(const FunctionParam< T > &other)
Definition Function1D.h:86
FunctionParam< T > param_p
The parameters and masks.
Definition Function.h:332
virtual void setMode(const RecordInterface &mode)
get/set the function mode.
uInt nparameters() const
Returns the number of parameters.
Definition Function.h:230
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:51