casa  \$Rev:20696\$
casa::SpectralList Class Reference

A set of SpectralElements. More...

`#include <SpectralList.h>`

List of all members.

## 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.
const SpectralElementoperator[] (const uInt n) const
Get element n.
SpectralElementoperator[] (const uInt n)
uInt nelements () const
Get the number of elements in list.
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
Add elements to list (False if list has max length and full)
void insert (const SpectralElement &in)
Insert in sort order in the list.
void insert (const SpectralList &in)
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.
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) const
Compare two elements.

## Private Attributes

uInt nmax_p

`   `

PtrBlock< SpectralElement * > list_p
List of elements.

## Detailed Description

A set of SpectralElements.

Public interface

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

### 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.

### Motivation

To have a container for fitting of spectral profiles to an observed spectrum

### To Do

Definition at line 81 of file SpectralList.h.

## 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

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

Clear the list.

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

Compare two elements.

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
 Bool casa::SpectralList::fromRecord ( String & errMsg, const RecordInterface & container )

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

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

Insert in sort order in the list.

 void casa::SpectralList::insert ( const SpectralList & in )
 uInt casa::SpectralList::nelements ( ) const` [inline]`

Get the number of elements in list.

Definition at line 114 of file SpectralList.h.

References list_p, and casa::PtrBlock< T >::nelements().

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

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

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

Assignment (copy semantics)

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

Get element n.

### Thrown Exceptions

 SpectralElement* casa::SpectralList::operator[] ( const uInt n )
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

• AipsError if y and x have different lengths
template<class MT >
 void casa::SpectralList::residual ( Vector< MT > & y, const Vector< MT > & x ) const
 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::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::toRecord ( RecordInterface & container ) const

## Member Data Documentation

 PtrBlock casa::SpectralList::list_p` [private]`

List of elements.

Definition at line 172 of file SpectralList.h.

Referenced by nelements().

 uInt casa::SpectralList::nmax_p` [private]`

`   `

Max length allowed of list

Definition at line 170 of file SpectralList.h.

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