Loading...
Searching...
No Matches
casacore::MarshallableChebyshev< T > Class Template Reference
scimath package (libcasa_scimath) » Functionals_module

More...

`#include <MarshallableChebyshev.h>`

## Public Types

enum | FieldNames { COEFFS , MODE , DEF , INTERVAL , NFieldNames }
| definitions of the fields stored in a serialized Record. More...
Public Types inherited from casacore::Function1D< T, U >
typedef const T * | FunctionArg
Public Types inherited from casacore::Function< T, T >
typedef FunctionTraits< T >::ArgType | ArgType
typedef const ArgType * | FunctionArg

## Public Member Functions

| MarshallableChebyshev ()
| create a zero-th order Chebyshev polynomial with the first coefficient equal to zero.
| MarshallableChebyshev (const uInt n)
| create an n-th order Chebyshev polynomial with the coefficients equal to zero.
| MarshallableChebyshev (const T &min, const T &max, const typename ChebyshevEnums::OutOfIntervalMode mode=ChebyshevEnums::CONSTANT, const T &defval=T(0))
| create a zero-th order Chebyshev polynomical with the first coefficient equal to one.
| MarshallableChebyshev (const Vector< T > &coeffs, const T &min, const T &max, const typename ChebyshevEnums::OutOfIntervalMode mode=ChebyshevEnums::CONSTANT, const T &defval=T(0))
| create a fully specified Chebyshev polynomial.
| MarshallableChebyshev (const Record &gr) throw (InvalidSerializationError)
| create a fully specified Chebyshev polynomial from parameters stored in a Record.
| MarshallableChebyshev (const Chebyshev< T > &other)
| create a deep copy of another Chebyshev polynomial
| MarshallableChebyshev (const MarshallableChebyshev< T > &other)
MarshallableChebyshev< T > & | operator= (const MarshallableChebyshev< T > &other)
| make a (deep) copy of another Chebyshev polynomial
MarshallableChebyshev< T > & | operator= (const Chebyshev< T > &other)
virtual | ~MarshallableChebyshev ()
| Destructor.
virtual void | store (Record &gr) const
| store the state of this Function into a Record
virtual Function< T > * | clone () const
| Create a copy of this object.
Public Member Functions inherited from casacore::Chebyshev< T >
| Chebyshev ()
| create a zero-th order Chebyshev polynomial with the first coefficient equal to zero.
| Chebyshev (const uInt n)
| create an n-th order Chebyshev polynomial with the coefficients equal to zero.
| Chebyshev (const T &min, const T &max, const typename ChebyshevEnums::OutOfIntervalMode mode=ChebyshevEnums::CONSTANT, const T &defval=T(0))
| create a zero-th order Chebyshev polynomical with the first coefficient equal to one.
| Chebyshev (const Vector< T > &coeffs, const T &min, const T &max, const typename ChebyshevEnums::OutOfIntervalMode mode=ChebyshevEnums::CONSTANT, const T &defval=T(0))
| create a fully specified Chebyshev polynomial.
| Chebyshev (uInt order, const RecordInterface &mode)
| create a fully specified Chebyshev polynomial.
| Chebyshev (const Vector< T > &coeffs, const RecordInterface &mode)
| Chebyshev (const Chebyshev &other)
| create a deep copy of another Chebyshev polynomial
Chebyshev< T > & | operator= (const Chebyshev< T > &other)
| make this instance a (deep) copy of another Chebyshev polynomial
virtual | ~Chebyshev ()
| Destructor.
virtual T | eval (const typename FunctionTraits< T >::ArgType *x) const
| Evaluate the Chebyshev at x.
Chebyshev< T > | derivative () const
| Return the Chebyshev polynomial which is the derivative of this one (with respect to the argument x).
Public Member Functions inherited from casacore::ChebyshevParamModeImpl< T >
| ChebyshevParamModeImpl ()
| ChebyshevParamModeImpl (const uInt n)
| ChebyshevParamModeImpl (const T &min, const T &max, typename ChebyshevEnums::OutOfIntervalMode mode=ChebyshevEnums::CONSTANT, const T &defval=T(0))
| ChebyshevParamModeImpl (const Vector< T > &coeffs, const T &min, const T &max, typename ChebyshevEnums::OutOfIntervalMode mode=ChebyshevEnums::CONSTANT, const T &defval=T(0))
| ChebyshevParamModeImpl (uInt order, const RecordInterface &mode)
| ChebyshevParamModeImpl (const Vector< T > &coeffs, const RecordInterface &mode)
| ChebyshevParamModeImpl (const ChebyshevParamModeImpl &other)
virtual void | setMode (const RecordInterface &mode)
| get/set the function mode.
virtual void | getMode (RecordInterface &mode) const
virtual Bool | hasMode () const
| return True if the implementing function supports a mode.
Public Member Functions inherited from casacore::ChebyshevParam< T >
| ChebyshevParam ()
| create a zero-th order Chebyshev polynomial with the first coefficient equal to zero.
| ChebyshevParam (const uInt n)
| create an n-th order Chebyshev polynomial with the coefficients equal to zero.
| ChebyshevParam (const T &min, const T &max, ChebyshevEnums::OutOfIntervalMode mode=ChebyshevEnums::CONSTANT, const T &defval=T(0))
| create a zero-th order Chebyshev polynomical with the first coefficient equal to one.
| ChebyshevParam (const Vector< T > &coeffs, const T &min, const T &max, ChebyshevEnums::OutOfIntervalMode mode=ChebyshevEnums::CONSTANT, const T &defval=T(0))
| create a fully specified Chebyshev polynomial.
| ChebyshevParam (uInt order, const RecordInterface &mode)
| create a fully specified Chebyshev polynomial.
| ChebyshevParam (const Vector< T > &coeffs, const RecordInterface &mode)
| ChebyshevParam (const ChebyshevParam &other)
| create a deep copy of another Chebyshev polynomial
template<class W>
| ChebyshevParam (const ChebyshevParam< W > &other)
ChebyshevParam< T > & | operator= (const ChebyshevParam< T > &other)
| make a (deep) copy of another Chebyshev polynomial
virtual | ~ChebyshevParam ()
| Destructor.
void | setCoefficients (const Vector< T > &coeffs)
| set the Chebyshev coefficients.
void | setCoefficient (const uInt which, const T &value)
| set a particular Chebyshev coefficient.
const Vector< T > & | getCoefficients () const
| return the current set of coefficients into a given Vector.
T | getCoefficient (const uInt which) const
| return a particular coefficient.
uInt | nCoefficients () const
| return the number of coeefficients currently loaded.
void | setInterval (T xmin, T xmax)
| set the Chebyshev interval for this function.
T | getIntervalMin () const
| return the minimum value for the currently Chebyshev interval.
T | getIntervalMax () const
| return the maximum value for the currently Chebyshev interval.
void | setOutOfIntervalMode (ChebyshevEnums::OutOfIntervalMode mode)
| set the behavior of this function when it is evaluated outside its Chebyshev interval
ChebyshevEnums::OutOfIntervalMode | getOutOfIntervalMode () const
| return the behavior of this function when it is evaluated outside of its Chebyshev interval.
void | setDefault (const T &val)
| set the default value of this function.
const T & | getDefault () const
| return the currently set default value.
uInt | order () const
| return the order of this polynomial.
virtual const String & | name () const
| Give name of function.
Public Member Functions inherited from casacore::Function1D< T, U >
| Function1D ()
| Constructors.
| Function1D (const uInt n)
| Function1D (const Vector< T > &in)
| Function1D (const FunctionParam< T > &other)
template<class W, class X>
| Function1D (const Function1D< W, X > &other)
virtual | ~Function1D ()
| Destructor.
virtual uInt | ndim () const
| Returns the number of dimensions of function.
Public Member Functions inherited from casacore::Function< T, T >
| Function ()
| Constructors.
virtual | ~Function ()
| Destructor.
uInt | nparameters () const
| Returns the number of parameters.
virtual T | eval (FunctionArg x) const=0
| Evaluate the function object.
T & | operator[] (const uInt n)
| Manipulate the nth parameter (0-based) with no index check.
virtual T | operator() () const
| Evaluate this function object at xor at x, y.
Bool & | mask (const uInt n)
| Manipulate the mask associated with the nth parameter (e.g.
const FunctionParam< T > & | parameters () const
| Return the parameter interface.
const Vector< ArgType > & | argp () const
| Get arg_p and parset_p.
Bool | parsetp () const
void | lockParam ()
| Compiler cannot always find the correct 'const' version of parameter access.
void | unlockParam ()
ostream & | print (ostream &os) const
| Print the function (i.e.
virtual Function< typename FunctionTraits< T >::DiffType > * | cloneAD () const
virtual Function< typename FunctionTraits< T >::BaseType > * | cloneNonAD () const
Public Member Functions inherited from casacore::Functional< FunctionTraits< T >::ArgType, T >
virtual | ~Functional ()
| Destructor.
virtual T | operator() (const FunctionTraits< T >::ArgType &x) const=0
| Map a Domain x into a Range y value.
Public Member Functions inherited from casacore::Functional< Vector< FunctionTraits< T >::ArgType >, T >
virtual | ~Functional ()
| Destructor.
virtual T | operator() (const Vector< FunctionTraits< T >::ArgType > &x) const=0
| Map a Domain x into a Range y value.
Public Member Functions inherited from casacore::FunctionMarshallable
| FunctionMarshallable (const String &functype)
| create a FunctionMarshallable.
| FunctionMarshallable (const FunctionMarshallable &other)
virtual | ~FunctionMarshallable ()
virtual FunctionMarshallable & | operator= (const FunctionMarshallable &other)
const String & | getFuncType () const
| return the name representing the Function type that will be placed in the functype field of Record passed to store().
void | loadFuncType (Record &gr) const
| load functype field into the given Record

## Static Public Attributes

static const String | FUNCTYPE
static const String | FUNCFIELDS []

## Static Private Attributes

static const String | modenames []

## Additional Inherited Members

Static Public Member Functions inherited from casacore::ChebyshevParam< T >
static void | derivativeCoeffs (Vector< T > &coeffs, const T &xmin=T(-1), const T &xmax=T(1))
| transform a set of Chebyshev polynomial coefficients into a set representing the series' derivative.
static void | chebyshevToPower (Vector< T > &coeffs)
| convert a set of Chebyshev polynomial coefficients to power series coefficients.
static void | powerToChebyshev (Vector< T > &coeffs)
| convert a set of power series coefficients to Chebyshev polynomial coefficients.
Protected Attributes inherited from casacore::ChebyshevParam< T >
T | def_p
| Default value if outside interval.
T | minx_p
| Lowest interval bound.
T | maxx_p
| Highest inetrval bound.
ChebyshevEnums::OutOfIntervalMode | mode_p
| Out-of-interval handling type.
Protected Attributes inherited from casacore::Function< T, T >
FunctionParam< T > | param_p
| The parameters and masks.
Vector< ArgType > | arg_p
| Aid for non-contiguous argument storage.
Bool | parset_p
| Indicate parameter written.
Bool | locked_p
| Indicate that parameters are expected to be locked from changing.
Static Protected Attributes inherited from casacore::ChebyshevParam< T >
static Vector< String > | modes_s

## Detailed Description

template<class T>
class casacore::MarshallableChebyshev< T >

A Chebyshev function class that supports serialization

### Intended use:

Public interface

### Review Status

Reviewed By:
  wbrouw
Date Reviewed:
  2001/11/12
Test programs:
  tChebyshev

### Prerequisite

- Function

### Etymology

This class is named after Chebyshev Type I polynomials. "Marshallable" means that the class can be serialized into a form that can be transmitted to another execution context.

### Synopsis

This class is a specialization of the Chebyshev class that supports serialization. That is, it allows one to write the state of the Chebyshev polynomial object into a Record. This record can then be transmitted to another execution context where it can be "reconstituted" as a new object with identical state as this one.
This documentation focusses on this serialization functionality (also known as "marshalling"); for details about the general features of the Chebyshev polynomial series, see the Chebyshev
class.

### Example

### Motivation

Making Chebyshev Marshallable provides a convenient way of configuring the simulator tool from.

### Thrown Exceptions

- Assertion in debug mode if attempt is made to address incorrect coefficients

Definition at line 84 of file MarshallableChebyshev.h.

## Member Enumeration Documentation

## FieldNames

template<class T>

enum casacore::MarshallableChebyshev::FieldNames

definitions of the fields stored in a serialized Record.

The actual string names are stored in FUNCFIELDS

Enumerator
COEFFS | the array of coefficients
MODE | the default mode
DEF | the default value to use when mode=CONSTANT
INTERVAL | the 2-element double array
NFieldNames | the number of supported fields

Definition at line 96 of file MarshallableChebyshev.h.

## Constructor & Destructor Documentation

## MarshallableChebyshev() [1/7]

template<class T>

casacore::MarshallableChebyshev< T >::MarshallableChebyshev | ( |  | ) |

inline

create a zero-th order Chebyshev polynomial with the first coefficient equal to zero.

The bounded domain is [T(-1), T(1)]. The OutOfDomainMode is CONSTANT, and the default value is T(0).

Definition at line 113 of file MarshallableChebyshev.h.

References casacore::Chebyshev< T >::Chebyshev(), casacore::FunctionMarshallable::FunctionMarshallable(), and FUNCTYPE.

Referenced by clone(), MarshallableChebyshev(), operator=(), and operator=().

## MarshallableChebyshev() [2/7]

template<class T>

casacore::MarshallableChebyshev< T >::MarshallableChebyshev | ( | const uInt | n | ) |

inline explicit

create an n-th order Chebyshev polynomial with the coefficients equal to zero.

The bounded domain is [T(-1), T(1)]. The OutOfDomainMode is CONSTANT, and the default value is T(0).

Definition at line 119 of file MarshallableChebyshev.h.

References casacore::Chebyshev< T >::Chebyshev(), casacore::FunctionMarshallable::FunctionMarshallable(), and FUNCTYPE.

## MarshallableChebyshev() [3/7]

template<class T>

casacore::MarshallableChebyshev< T >::MarshallableChebyshev | ( | const T & | min,
|  | const T & | max,
|  | const typename ChebyshevEnums::OutOfIntervalMode | mode = ChebyshevEnums::CONSTANT,
|  | const T & | defval = T(0) )

inline

create a zero-th order Chebyshev polynomical with the first coefficient equal to one.

min is the minimum value of its Chebyshev interval, and max is the maximum value.
mode sets the behavior of the function outside the Chebyshev interval (see setOutOfIntervalMode() and OutOfIntervalMode enumeration definition for details).
defval is the value returned when the function is evaluated outside the Chebyshev interval and mode=CONSTANT.

Definition at line 131 of file MarshallableChebyshev.h.

References casacore::Chebyshev< T >::Chebyshev(), casacore::ChebyshevEnums::CONSTANT, casacore::FunctionMarshallable::FunctionMarshallable(), FUNCTYPE, casacore::max(), and casacore::min().

## MarshallableChebyshev() [4/7]

template<class T>

casacore::MarshallableChebyshev< T >::MarshallableChebyshev | ( | const Vector< T > & | coeffs,
|  | const T & | min,
|  | const T & | max,
|  | const typename ChebyshevEnums::OutOfIntervalMode | mode = ChebyshevEnums::CONSTANT,
|  | const T & | defval = T(0) )

inline

create a fully specified Chebyshev polynomial.

coeffs holds the coefficients of the Chebyshev polynomial (see setCoefficients() for details). min is the minimum value of its canonical range, and max is the maximum value.
mode sets the behavior of the function outside the Chebyshev interval (see setOutOfIntervalMode() and OutOfIntervalMode enumeration definition for details).
defval is the value returned when the function is evaluated outside the canonical range and mode=CONSTANT.

Definition at line 148 of file MarshallableChebyshev.h.

References casacore::Chebyshev< T >::Chebyshev(), casacore::ChebyshevEnums::CONSTANT, casacore::FunctionMarshallable::FunctionMarshallable(), FUNCTYPE, casacore::max(), and casacore::min().

## MarshallableChebyshev() [5/7]

template<class T>

casacore::MarshallableChebyshev< T >::MarshallableChebyshev | ( | const Record & | gr | ) |
throw | ( | InvalidSerializationError ) |  |  |

explicit

create a fully specified Chebyshev polynomial from parameters stored in a Record.

References casacore::Record().

## MarshallableChebyshev() [6/7]

template<class T>

casacore::MarshallableChebyshev< T >::MarshallableChebyshev | ( | const Chebyshev< T > & | other | ) |

inline

create a deep copy of another Chebyshev polynomial

Definition at line 164 of file MarshallableChebyshev.h.

References casacore::Chebyshev< T >::Chebyshev(), casacore::FunctionMarshallable::FunctionMarshallable(), and FUNCTYPE.

## MarshallableChebyshev() [7/7]

template<class T>

casacore::MarshallableChebyshev< T >::MarshallableChebyshev | ( | const MarshallableChebyshev< T > & | other | ) |

inline

Definition at line 166 of file MarshallableChebyshev.h.

References casacore::Chebyshev< T >::Chebyshev(), casacore::FunctionMarshallable::FunctionMarshallable(), and MarshallableChebyshev().

## ~MarshallableChebyshev()

template<class T>

virtual casacore::MarshallableChebyshev< T >::~MarshallableChebyshev | ( |  | ) |

inline virtual

Destructor.

Definition at line 188 of file MarshallableChebyshev.h.

## Member Function Documentation

## clone()

template<class T>

virtual Function< T > * casacore::MarshallableChebyshev< T >::clone | ( |  | ) | const

inline virtual

Create a copy of this object.

The caller is responsible for deleting the pointer.

Reimplemented from casacore::Chebyshev< T >.

Definition at line 195 of file MarshallableChebyshev.h.

References MarshallableChebyshev().

## operator=() [1/2]

template<class T>

MarshallableChebyshev< T > & casacore::MarshallableChebyshev< T >::operator= | ( | const Chebyshev< T > & | other | ) |

inline

Definition at line 179 of file MarshallableChebyshev.h.

References casacore::Chebyshev< T >::Chebyshev(), MarshallableChebyshev(), and casacore::Chebyshev< T >::operator=().

## operator=() [2/2]

template<class T>

MarshallableChebyshev< T > & casacore::MarshallableChebyshev< T >::operator= | ( | const MarshallableChebyshev< T > & | other | ) |

inline

make a (deep) copy of another Chebyshev polynomial

Definition at line 172 of file MarshallableChebyshev.h.

References MarshallableChebyshev(), casacore::Chebyshev< T >::operator=(), and casacore::FunctionMarshallable::operator=().

## store()

template<class T>

virtual void casacore::MarshallableChebyshev< T >::store | ( | Record & | gr | ) | const

virtual

store the state of this Function into a Record

Implements casacore::FunctionMarshallable.

References casacore::Record().

## Member Data Documentation

## FUNCFIELDS

template<class T>

const String casacore::MarshallableChebyshev< T >::FUNCFIELDS[]

static

Definition at line 92 of file MarshallableChebyshev.h.

## FUNCTYPE

template<class T>

const String casacore::MarshallableChebyshev< T >::FUNCTYPE

static

Definition at line 91 of file MarshallableChebyshev.h.

Referenced by MarshallableChebyshev(), MarshallableChebyshev(), MarshallableChebyshev(), MarshallableChebyshev(), and MarshallableChebyshev().

## modenames

template<class T>

const String casacore::MarshallableChebyshev< T >::modenames[]

static private

Definition at line 88 of file MarshallableChebyshev.h.

The documentation for this class was generated from the following file:

- scimath/Functionals/MarshallableChebyshev.h