casa::SpectralList Class Reference
[SpectralComponents]

#include <SpectralList.h>

List of all members.


Detailed Description

A set of SpectralElements.

Intended use:

Part of API

Review Status

Date Reviewed:
yyyy/mm/dd
Test programs:
tSpectralFit

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

Definition at line 81 of file SpectralList.h.

Public Member Functions

 SpectralList ()
 Default constructor creates an empty list.
 SpectralList (uInt nmax)
 Construct a list with a maximum length of n (0: unlimited length).
 SpectralList (const SpectralElement &in)
 Construct with an initial element.
 SpectralList (const SpectralList &other)
 Copy constructor (deep copy).
 ~SpectralList ()
 Destructor.
SpectralListoperator= (const SpectralList &other)
 Assignment (copy semantics).
Double operator() (const Double x) const
 Evaluate the value of the sum of the elements at x.
uInt nelements () const
 Get the number of elements in list.
Bool set (const SpectralElement &in, const uInt which)
 Set an element in the list.
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.
const SpectralElementoperator[] (const uInt n) const
 Get element n.
SpectralElementoperator[] (const uInt n)
template<class MT>
void evaluate (Vector< MT > &y) const
 Get the profile values for all elements in list.
template<class MT>
void evaluate (Vector< MT > &y, const Vector< MT > &x) const
template<class MT>
void residual (Vector< MT > &y) const
 Calculate the residuals at the points x; by subtracting the model from y.
template<class MT>
void residual (Vector< MT > &y, const Vector< MT > &x) const
Bool add (const SpectralElement &in)
 Add elements to list (False if list has max length and full).
Bool add (const SpectralList &in)
void insert (const SpectralElement &in)
 Insert in sort order in the list.
void insert (const SpectralList &in)
Bool fromRecord (String &errMsg, const RecordInterface &container)
 Convert to and from a Record (see details in SpectralElement).
Bool toRecord (RecordInterface &container) const

Private Member Functions

Int compar (const SpectralElement &p1, const SpectralElement &p2)
 Compare two elements.

Private Attributes

uInt nmax_p
 Max length allowed of list.
PtrBlock< SpectralElement * > list_p
 List of elements.


Constructor & Destructor Documentation

casa::SpectralList::SpectralList (  ) 

Default constructor creates an empty list.

casa::SpectralList::SpectralList ( uInt  nmax  )  [explicit]

Construct a list with a maximum length of n (0: unlimited length).

casa::SpectralList::SpectralList ( const SpectralElement in  )  [explicit]

Construct with an initial element.

casa::SpectralList::SpectralList ( const SpectralList other  ) 

Copy constructor (deep copy).

casa::SpectralList::~SpectralList (  ) 

Destructor.


Member Function Documentation

SpectralList& casa::SpectralList::operator= ( const SpectralList other  ) 

Assignment (copy semantics).

Double casa::SpectralList::operator() ( const Double  x  )  const

Evaluate the value of the sum of the elements at x.

const SpectralElement& casa::SpectralList::operator[] ( const uInt  n  )  const

Get element n.

Thrown Exceptions

SpectralElement& casa::SpectralList::operator[] ( const uInt  n  ) 

uInt casa::SpectralList::nelements (  )  const [inline]

Get the number of elements in list.

Definition at line 114 of file SpectralList.h.

References list_p.

template<class MT>
void casa::SpectralList::evaluate ( Vector< MT > &  y  )  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 casa::SpectralList::evaluate ( Vector< MT > &  y,
const Vector< MT > &  x 
) const

template<class MT>
void casa::SpectralList::residual ( Vector< MT > &  y  )  const

Calculate the residuals at the points x; by subtracting the model from y.

x=0,1,2,.\. if not given.

Thrown Exceptions

template<class MT>
void casa::SpectralList::residual ( Vector< MT > &  y,
const Vector< MT > &  x 
) const

Bool casa::SpectralList::add ( const SpectralElement in  ) 

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

Bool casa::SpectralList::add ( const SpectralList in  ) 

void casa::SpectralList::insert ( const SpectralElement in  ) 

Insert in sort order in the list.

void casa::SpectralList::insert ( const SpectralList in  ) 

Bool casa::SpectralList::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 casa::SpectralList::clear (  ) 

Clear the list.

void casa::SpectralList::set ( const uInt  nmax  ) 

Set a maximum size of the list.

void casa::SpectralList::sort (  ) 

Sort the list on the first parameter (i.e.

peak value for Gaussian)

Bool casa::SpectralList::fromRecord ( String errMsg,
const RecordInterface container 
)

Convert to and from a Record (see details in SpectralElement).

Bool casa::SpectralList::toRecord ( RecordInterface container  )  const

Int casa::SpectralList::compar ( const SpectralElement p1,
const SpectralElement p2 
) [private]

Compare two elements.


Member Data Documentation

uInt casa::SpectralList::nmax_p [private]

Max length allowed of list.

Definition at line 170 of file SpectralList.h.

PtrBlock<SpectralElement *> casa::SpectralList::list_p [private]

List of elements.

Definition at line 172 of file SpectralList.h.

Referenced by nelements().


The documentation for this class was generated from the following file:
Generated on Mon Sep 1 22:46:35 2008 for NRAOCASA by  doxygen 1.5.1