SpectralList.h

Classes

SpectralList -- A set of SpectralElements (full description)
Global Functions -- Global functions (full description)

class SpectralList

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)

Description

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

SpectralList()

Default constructor creates an empty list

explicit SpectralList(uInt nmax)

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)

~SpectralList()

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

const SpectralElement &operator[](const uInt n) const
SpectralElement &operator[](const uInt n)

Get element n

Thrown Exceptions

uInt nelements() const

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

Bool add(const SpectralElement &in)
Bool add(const SpectralList &in)

Add elements to list (False if list has max length and full)

void insert(const SpectralElement &in)
void insert(const SpectralList &in)

Insert in sort order in the list

Bool set(const SpectralElement &in, const uInt which)

Set an element in the list. Return False if more than one place beyond end of list; or if beyond max size.

void clear()

Clear the list

void set(const uInt nmax)

Set a maximum size of the list

void sort()

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)

Int compar(const SpectralElement &p1, const SpectralElement &p2)

Compare two elements


Global functions (source)

Interface

std::ostream &operator<<(std::ostream &os, const ostream &lst)

Description

Member Description

std::ostream &operator<<(std::ostream &os, const ostream &lst)

Output declaration