SpectralList.h
Classes
- SpectralList -- A set of SpectralElements (full description)
- Global Functions -- Global functions (full description)
Interface
- Public Members
- SpectralList()
- explicit SpectralList(uInt nmax)
- explicit SpectralList(const SpectralElement &in)
- SpectralList(const SpectralList &other)
- ~SpectralList()
- SpectralList &operator=(const SpectralList &other)
- Double operator()(const Double x) const
- const SpectralElement &operator[](const uInt n) const
- SpectralElement &operator[](const uInt n)
- uInt nelements() const
- template <class MT> void evaluate(MT<MT> &y) const
- template <class MT> void evaluate(MT<MT> &y, const MT<MT> &x) const
- template <class MT> void residual(MT<MT> &y) const
- template <class MT> void residual(MT<MT> &y, const MT<MT> &x) const
- Bool add(const SpectralElement &in)
- Bool add(const SpectralList &in)
- void insert(const SpectralElement &in)
- void insert(const SpectralList &in)
- Bool set(const SpectralElement &in, const uInt which)
- void clear()
- void set(const uInt nmax)
- void sort()
- Bool fromRecord (String& errMsg, const RecordInterface& container)
- Bool toRecord(RecordInterface& container) const
- Private Members
- Int compar(const SpectralElement &p1, const SpectralElement &p2)
Review Status
- Date Reviewed:
- yyyy/mm/dd
- Programs:
- Tests:
Prerequisite
Etymology
From spectral line and element list
Synopsis
The SpectralList class is a container for a set of spectral elements.
The list can be used in the
SpectralFit class and in the
SpectralEstimate class.
Example
Motivation
To have a container for fitting of spectral profiles to an observed spectrum
To Do
Member Description
Default constructor creates an empty list
Construct a list with a maximum length of n (0: unlimited length)
explicit SpectralList(const SpectralElement &in)
Construct with an initial element
SpectralList(const SpectralList &other)
Copy constructor (deep copy)
Destructor
SpectralList &operator=(const SpectralList &other)
Assignment (copy semantics)
Double operator()(const Double x) const
Evaluate the value of the sum of the elements at x
Get element n
Thrown Exceptions
Get the number of elements in list
template <class MT> void evaluate(MT<MT> &y) const
template <class MT> void evaluate(MT<MT> &y, const MT<MT> &x) const
Get the profile values for all elements in list. The evaluation
is for the length of the given prof, assuming x values of
0,1,... if no x given.
template <class MT> void residual(MT<MT> &y) const
template <class MT> void residual(MT<MT> &y, const MT<MT> &x) const
Calculate the residuals at the points x; by subtracting the model from y.
x=0,1,2,.. if not given.
Thrown Exceptions
- AipsError if y and x have different lengths
Bool add(const SpectralElement &in)
Bool add(const SpectralList &in)
Add elements to list (False if list has max length and full)
Insert in sort order in the list
Set an element in the list. Return False if more than one place beyond
end of list; or if beyond max size.
Clear the list
void set(const uInt nmax)
Set a maximum size of the list
Sort the list on the first parameter (i.e. peak value for Gaussian)
Bool fromRecord (String& errMsg, const RecordInterface& container)
Bool toRecord(RecordInterface& container) const
Convert to and from a Record (see details in SpectralElement)
Compare two elements
Interface
- std::ostream &operator<<(std::ostream &os, const ostream &lst)
Member Description
std::ostream &operator<<(std::ostream &os, const ostream &lst)
Output declaration