|
casacore
|
#include <FunctionTraits.h>
Public Types | |
| typedef T | Type |
| Actual template type. | |
| typedef T | BaseType |
| Template base type. | |
| typedef T | NumericType |
| Numeric type of template. | |
| typedef T | ParamType |
| Type for parameters. | |
| typedef T | ArgType |
| Type for arguments. | |
| typedef AutoDiff< T > | DiffType |
| Default type for differentiation. | |
Static Public Member Functions | |
| static const T & | getValue (const T &in) |
| Get the value. | |
| static void | setValue (T &out, const T &val, const uInt, const uInt) |
| Set a value (and possible derivative). | |
Function data types for parameters and arguments
Internal
A trait is a characteristic feature. FunctionTraits defines relationships between the data types of result, parameters and arguments of function objects.
This templated class contains a number of typedefs that describe the relationship between different numeric data types used for the calculation of Function and the function parameter and arguments.
Its main use is to optimize the speed of the calculation of function values and derivatives in the case of AutoDiff use and manual calculation of derivatives, by allowing the data type of the the arguments and/or parameters to be plain numeric in cases where the derivatives wrt these are not needed. To enable this, the following definitions are used for the use of the Function template. Bear in mind that the Function operator is defined as result = f<T>(x; parameters).
The following types are defined:
The specializations are done in such a way that higher order derivatives (e.g. AutoDiff<AutoDiff<Double> >) are catered for.
Note that the class names in the following definitions are extended with some individual id (like _PA): do not use them in programming, they are only necessary for the cxx2html interpreter)
This class is implemented as a number of specializations for the following data types.
See the Function class code.
To keep the Function class single templated
Definition at line 138 of file FunctionTraits.h.
| typedef T casacore::FunctionTraits< T >::ArgType |
Type for arguments.
Definition at line 149 of file FunctionTraits.h.
| typedef T casacore::FunctionTraits< T >::BaseType |
Template base type.
Definition at line 143 of file FunctionTraits.h.
| typedef AutoDiff<T> casacore::FunctionTraits< T >::DiffType |
Default type for differentiation.
Definition at line 151 of file FunctionTraits.h.
| typedef T casacore::FunctionTraits< T >::NumericType |
Numeric type of template.
Definition at line 145 of file FunctionTraits.h.
| typedef T casacore::FunctionTraits< T >::ParamType |
Type for parameters.
Definition at line 147 of file FunctionTraits.h.
| typedef T casacore::FunctionTraits< T >::Type |
Actual template type.
Definition at line 141 of file FunctionTraits.h.
|
inlinestatic |
Get the value.
Definition at line 153 of file FunctionTraits.h.
Referenced by casacore::FunctionParam< T >::FunctionParam(), casacore::FunctionTraits_P< AutoDiff< T > >::getValue(), casacore::FunctionTraits_PA< AutoDiffA< T > >::getValue(), and casacore::FunctionTraits_PX< AutoDiffX< T > >::getValue().
|
inlinestatic |
Set a value (and possible derivative).
Definition at line 155 of file FunctionTraits.h.
Referenced by casacore::FunctionParam< T >::FunctionParam().