Relacs  0.9.8
Public Types | Public Member Functions | Friends | List of all members
Map< T > Class Template Reference

#include <map.h>

Inheritance diagram for Map< T >:
Inheritance graph
[legend]
Collaboration diagram for Map< T >:
Collaboration graph
[legend]

Public Types

typedef T value_type
 
typedef T * pointer
 
typedef T & reference
 
typedef const T & const_reference
 
typedef int size_type
 
typedef T * iterator
 
typedef const T * const_iterator
 
- Public Types inherited from Array< T >
typedef T value_type
 
typedef T * pointer
 
typedef T & reference
 
typedef const T & const_reference
 
typedef int size_type
 
typedef T * iterator
 
typedef const T * const_iterator
 

Public Member Functions

 Map (void)
 
 Map (int n)
 
 Map (int n, const T &xval, const T &yval)
 
 Map (const T *x, const T *y, int n)
 
 Map (const vector< T > &x, const vector< T > &y)
 
 Map (const Array< T > &x, const Array< T > &y)
 
 Map (const SampleData< T > &sa)
 
 Map (const EventData &ed)
 
 Map (const Map< T > &a)
 
virtual ~Map (void)
 
template<typename R >
const Map< T > & operator= (const R &y)
 
const Map< T > & operator= (const Array< T > &y)
 
const Map< T > & operator= (const SampleData< T > &sa)
 
const Map< T > & operator= (const Map< T > &a)
 
const Map< T > & assign (const T *y, int n, const T &xval=0)
 
const Map< T > & assign (const T *x, const T *y, int n)
 
const Map< T > & assign (const vector< T > &y, const T &xval=0)
 
const Map< T > & assign (const vector< T > &x, const vector< T > &y)
 
const Map< T > & assign (const Array< T > &y, const T &xval=0)
 
const Map< T > & assign (const Array< T > &x, const Array< T > &y)
 
const Map< T > & assign (const SampleData< T > &sa)
 
const Map< T > & assign (const Map< T > &a)
 
const Map< T > & copy (T *y, int n, const T &yval=0)
 
const Map< T > & copy (T *x, T *y, int n, const T &xval=0, const T &yval=0)
 
const Map< T > & copy (vector< T > &y)
 
const Map< T > & copy (vector< T > &x, vector< T > &y)
 
const Map< T > & copy (Array< T > &y)
 
const Map< T > & copy (Array< T > &x, Array< T > &y)
 
const Map< T > & copy (Map< T > &a)
 
const Map< T > & append (const T *x, const T *y, int n)
 
const Map< T > & append (const vector< T > &x, const vector< T > &y)
 
const Map< T > & append (const Array< T > &x, const Array< T > &y)
 
const Map< T > & append (const Map< T > &a)
 
int size (void) const
 
bool empty (void) const
 
int resize (int n, const T &val=0)
 
int resize (int n, const T &xval, const T &yval)
 
void clear (void)
 
int capacity (void) const
 
int reserve (int n)
 
void free (int n=0)
 
const Array< T > & x (void) const
 
Array< T > & x (void)
 
const Array< T > & y (void) const
 
Array< T > & y (void)
 
const T & x (int i) const
 
T & x (int i)
 
const T & y (int i) const
 
T & y (int i)
 
const T & operator[] (int i) const
 
T & operator[] (int i)
 
const T & operator() (int i, int j) const
 
T & operator() (int i, int j)
 
int push (const T &xval, const T &yval)
 
template<typename R >
int push (const R &xval, const R &yval)
 
void pop (void)
 
iterator begin (void)
 
const_iterator begin (void) const
 
iterator end (void)
 
const_iterator end (void) const
 
Map< T > & insert (int i, const T &xval, const T &yval)
 
Map< T > & push_front (const T &xval, const T &yval)
 
int insert (const T &xval, const T &yval)
 
Map< T > & erase (int i)
 
Map< T > & sortByX (void)
 
Map< T > & sortByY (void)
 
 CONTAINEROPS1SCALARDEC (Map< T >, operator=)
 
 CONTAINEROPS1DEC (Map< T >, operator+=)
 
 CONTAINEROPS1DEC (Map< T >, operator-=)
 
 CONTAINEROPS1DEC (Map< T >, operator*=)
 
 CONTAINEROPS1DEC (Map< T >, operator/=)
 
 CONTAINEROPS1DEC (Map< T >, operator%=)
 
 CONTAINEROPS2DEC (class TT, Map< TT >, operator+)
 
 CONTAINEROPS2DEC (class TT, Map< TT >, operator-)
 
 CONTAINEROPS2DEC (class TT, Map< TT >, operator*)
 
 CONTAINEROPS2DEC (class TT, Map< TT >, operator/)
 
 CONTAINEROPS2DEC (class TT, Map< TT >, operator%)
 
Map< T > operator- (void)
 
Map< T > & identity (void)
 
interpolate (double x) const
 
minX (T &y, int first=0, int last=-1) const
 
minY (T &x, int first=0, int last=-1) const
 
int minXIndex (T &min, T &y, int first=0, int last=-1) const
 
int minYIndex (T &min, T &x, int first=0, int last=-1) const
 
maxX (T &y, int first=0, int last=-1) const
 
maxY (T &x, int first=0, int last=-1) const
 
int maxXIndex (T &max, T &x, int first=0, int last=-1) const
 
int maxYIndex (T &max, T &x, int first=0, int last=-1) const
 
void minMaxX (T &min, T &miny, T &max, T &maxy, int first=0, int last=-1) const
 
void minMaxY (T &min, T &minx, T &max, T &maxx, int first=0, int last=-1) const
 
void minMaxXIndex (T &min, int &minindex, T &miny, T &max, int &maxindex, T &maxy, int first=0, int last=-1) const
 
void minMaxYIndex (T &min, int &minindex, T &minx, T &max, int &maxindex, T &maxx, int first=0, int last=-1) const
 
double cov (int first=0, int last=-1) const
 
double corrCoef (int first=0, int last=-1) const
 
void propFit (int first, int last, double &m, double &mu, double &chisq) const
 
void propFit (double &m, double &mu, double &chisq) const
 
double propFit (int first=0, int last=-1) const
 
void lineFit (int first, int last, double &b, double &bu, double &m, double &mu, double &chisq) const
 
void lineFit (double &b, double &bu, double &m, double &mu, double &chisq) const
 
void lineFit (double &b, double &m) const
 
ostream & save (ostream &str, int width=10, int prec=5, const string &start="", const string &separator=" ") const
 
void save (const string &file, int width=8, int prec=3) const
 
istream & load (istream &str, const string &stop="", string *line=0)
 
Map< T > & load (const string &file, const string &stop="")
 
- Public Member Functions inherited from Array< T >
 Array (void)
 
 Array (int n)
 
 Array (int n, const T &val)
 
template<typename S >
 Array (const S *a, int n)
 
 Array (const T *a, int n)
 
template<typename S >
 Array (const vector< S > &a, int first=0, int last=-1)
 
template<typename S >
 Array (const Array< S > &a, int first=0, int last=-1)
 
 Array (const Array< T > &a)
 
 Array (const LinearRange &range)
 
virtual ~Array (void)
 
template<typename S >
const Array< T > & operator= (const S &a)
 
const Array< T > & operator= (const LinearRange &range)
 
const Array< T > & operator= (const Array< T > &a)
 
template<typename S >
const Array< T > & assign (const S *a, int n)
 
const Array< T > & assign (const T *a, int n)
 
template<typename S >
const Array< T > & assign (const S &a)
 
const Array< T > & assign (const Array< T > &a)
 
const Array< T > & assign (const Array< T > &a, int first, int last=-1)
 
const Array< T > & assign (const LinearRange &range)
 
Array< T > & zeros (int n)
 
Array< T > & ones (int n)
 
template<typename R >
Array< T > & rand (int n, R &r=rnd)
 
template<typename R >
Array< T > & randNorm (int n, R &r=rnd)
 
template<typename S >
const Array< T > & copy (S *a, int n, const S &val=0) const
 
const Array< T > & copy (T *a, int n, const T &val=0) const
 
template<typename S >
const Array< T > & copy (S &a) const
 
template<typename S >
const Array< T > & copy (Array< S > &a) const
 
const Array< T > & append (T a, int n=1)
 
template<typename S >
const Array< T > & append (const S *a, int n)
 
const Array< T > & append (const T *a, int n)
 
template<typename S >
const Array< T > & append (const S &a)
 
const Array< T > & append (const Array< T > &a)
 
const Array< T > & repeat (int n)
 
int size (void) const
 
bool empty (void) const
 
int capacity (void) const
 
int maxCapacity (void) const
 
const T & operator[] (int i) const
 
T & operator[] (int i)
 
const T & at (int i) const
 
T & at (int i)
 
const T & front (void) const
 
T & front (void)
 
const T & back (void) const
 
T & back (void)
 
int push (const T &val)
 
template<typename R >
int push (const R &x)
 
pop (void)
 
const T * data (void) const
 
T * data (void)
 
iterator begin (void)
 
const_iterator begin (void) const
 
iterator end (void)
 
const_iterator end (void) const
 
Array< T > & insert (int i, const T &v)
 
iterator insert (iterator i, const T &v)
 
Array< T > & erase (int i)
 
iterator erase (iterator i)
 
Array< T > & sortedIndex (Array< int > &indices, int first=0, int last=-1)
 
 CONTAINEROPS1SCALARDEC (Array< T >, operator=)
 
 CONTAINEROPS1DEC (Array< T >, operator+=)
 
 CONTAINEROPS1DEC (Array< T >, operator-=)
 
 CONTAINEROPS1DEC (Array< T >, operator*=)
 
 CONTAINEROPS1DEC (Array< T >, operator/=)
 
 CONTAINEROPS1DEC (Array< T >, operator%=)
 
 CONTAINEROPS2DEC (class TT, Array< TT >, operator+)
 
 CONTAINEROPS2DEC (class TT, Array< TT >, operator-)
 
 CONTAINEROPS2DEC (class TT, Array< TT >, operator*)
 
 CONTAINEROPS2DEC (class TT, Array< TT >, operator/)
 
 CONTAINEROPS2DEC (class TT, Array< TT >, operator%)
 
Array< T > operator- (void)
 
Array< T > & sin (void)
 
Array< T > & cos (void)
 
Array< T > & tan (void)
 
Array< T > & asin (void)
 
Array< T > & acos (void)
 
Array< T > & atan (void)
 
Array< T > & sinh (void)
 
Array< T > & cosh (void)
 
Array< T > & tanh (void)
 
Array< T > & asinh (void)
 
Array< T > & acosh (void)
 
Array< T > & atanh (void)
 
Array< T > & exp (void)
 
Array< T > & log (void)
 
Array< T > & log10 (void)
 
Array< T > & erf (void)
 
Array< T > & erfc (void)
 
Array< T > & sqrt (void)
 
Array< T > & cbrt (void)
 
Array< T > & square (void)
 
Array< T > & cube (void)
 
 CONTAINERFUNC1DEC (Array< T >, pow)
 
Array< T > & exp (double base)
 
Array< T > & ceil (void)
 
Array< T > & floor (void)
 
Array< T > & abs (void)
 
Array< T > & decibel (double level=0.0)
 
Array< T > & linear (double level)
 
Array< T > & averageAdd (const Array< T > &a, int n)
 
Array< T > & averageAdd (const Array< T > &a, int n, Array< T > &sq)
 
Array< T > & averageAdd (const Array< T > &a, int n, Array< T > &sq, Array< T > &sd)
 
min (int first=0, int last=-1) const
 
int minIndex (int first=0, int last=-1) const
 
int minIndex (T &min, int first=0, int last=-1) const
 
max (int first=0, int last=-1) const
 
int maxIndex (int first=0, int last=-1) const
 
int maxIndex (T &max, int first=0, int last=-1) const
 
void minMax (T &min, T &max, int first=0, int last=-1) const
 
void minMaxIndex (int &minindex, int &maxindex, int first=0, int last=-1) const
 
void minMaxIndex (T &min, int &minindex, T &max, int &maxindex, int first=0, int last=-1) const
 
numerical_traits< T >::mean_type mean (int first=0, int last=-1) const
 
numerical_traits< T >::mean_type mean (typename numerical_traits< T >::variance_type &stdev, int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
variance (int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
varianceKnown (typename numerical_traits< T >::mean_type mean, int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
varianceFixed (typename numerical_traits< T >::mean_type fixedmean, int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
stdev (int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
stdevKnown (typename numerical_traits< T >::mean_type mean, int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
stdevFixed (typename numerical_traits< T >::mean_type fixedmean, int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
sem (int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
semKnown (typename numerical_traits< T >::mean_type mean, int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
semFixed (typename numerical_traits< T >::mean_type fixedmean, int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
absdev (int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
absdevKnown (typename numerical_traits< T >::mean_type mean, int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
rms (int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
skewness (int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
kurtosis (int first=0, int last=-1) const
 
sum (int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
squaredSum (int first=0, int last=-1) const
 
numerical_traits< T >
::variance_type 
power (int first=0, int last=-1) const
 
double rank (int first=0, int last=-1)
 
ostream & save (ostream &str, int width=10, int prec=5) const
 
void save (const string &file, int width=10, int prec=5) const
 
istream & load (istream &str, const string &stop="", string *line=0)
 
Array< T > & load (const string &file, const string &stop="")
 

Friends

template<typename TT >
bool operator== (const Map< TT > &a, const Map< TT > &b)
 
template<typename TT >
bool operator< (const Map< TT > &a, const Map< TT > &b)
 
template<typename TT >
void average (Map< TT > &meantrace, const vector< Map< TT > > &traces)
 
template<typename TT >
void average (Map< TT > &meantrace, Map< TT > &stdev, const vector< Map< TT > > &traces)
 
template<typename TT >
void average (SampleData< TT > &meantrace, const vector< Map< TT > > &traces)
 
template<typename TT >
void average (SampleData< TT > &meantrace, SampleData< TT > &stdev, const vector< Map< TT > > &traces)
 
template<typename TT >
ostream & operator<< (ostream &str, const Map< TT > &a)
 
template<typename TT >
istream & operator>> (istream &str, Map< TT > &a)
 

Detailed Description

template<typename T>
class relacs::Map< T >

A template handling an x- and an y-data array.

Author
Jan Benda
Version
0.3 A Map is an Array (the y-data array) which owns a second array (the x-data array).

Member Typedef Documentation

typedef T value_type

The type of object, T, stored in the x- and y-data arrays.

typedef T* pointer

Pointer to the type of object, T, stored in the x- and y-data arrays.

typedef T& reference

Reference to the type of object, T, stored in the x- and y-data arrays.

typedef const T& const_reference

Const reference to the type of object, T, stored in the x- and y-data arrays.

typedef int size_type

The type used for sizes and indices.

typedef T* iterator

Iterator used to iterate through the y-data array.

typedef const T* const_iterator

Const iterator used to iterate through the y-data array.

Constructor & Destructor Documentation

Map ( void  )

Creates an empty map.

Map ( int  n)

Creates a map with n data elements without initializing them.

Map ( int  n,
const T &  xval,
const T &  yval 
)

Creates a map with n data elements and initialzes the x-data with xval and the y-data with yval.

Map ( const T *  x,
const T *  y,
int  n 
)

Creates a map with n data elements and initialzes them with the values given in x and y.

Map ( const vector< T > &  x,
const vector< T > &  y 
)

Creates a map with the same size and content as the vectors x and y.

Map ( const Array< T > &  x,
const Array< T > &  y 
)

Creates a map with the same size and content as the Array x and y.

Map ( const SampleData< T > &  sa)

Creates a map with the same size and content as sa.

Map ( const EventData ed)

Creates a map with the times of ed in the x vector and the corresponding sizes in the y-vector. If the sizes are not stored in ed but the widths, then the widths are stored in the y-vector. If neither sizes or widths are available, the y-vector is initialized with zeros.

References EventData::capacity(), EventData::eventSize(), EventData::eventWidth(), EventData::minEvent(), EventData::size(), EventData::sizeBuffer(), and EventData::widthBuffer().

Map ( const Map< T > &  a)

Copy constructor.

~Map< T > ( void  )
virtual

The destructor.

Member Function Documentation

const Map< T > & operator= ( const R &  y)

Set the size() and the capacity() of the map to the size of y and set the content of the y-data array to y.

Note
Some values of the x-data array might be undefined!
const Map< T > & operator= ( const Array< T > &  y)

Set the size() and the capacity() of the map to the size of y and set the content of the y-data array to y.

Note
Some values of the x-data array might be undefined!
const Map< T > & operator= ( const SampleData< T > &  sa)

Assign sa to this.

const Map< T > & operator= ( const Map< T > &  a)

Set the size(), capacity(), and content of the map to a.

const Map< T > & assign ( const T *  y,
int  n,
const T &  xval = 0 
)

Set the size() and the capacity() of the map to n and set the content of the y-data array to y. If necessary remaining elements of the x-data array are set to xval.

References Array< T >::assign().

const Map< T > & assign ( const T *  x,
const T *  y,
int  n 
)

Set the size() and the capacity() of the map to n and its content to x and y.

References Array< T >::assign().

const Map< T > & assign ( const vector< T > &  y,
const T &  xval = 0 
)

Set the size() and the capacity() of the map to the size of y and set the content of the y-data array to y. If necessary remaining elements of the x-data array are set to xval.

References Array< T >::assign().

const Map< T > & assign ( const vector< T > &  x,
const vector< T > &  y 
)

Set the size(), capacity(), and content of the map to x and y.

References Array< T >::assign().

const Map< T > & assign ( const Array< T > &  y,
const T &  xval = 0 
)

Set the size() and the capacity() of the map to the size of y and set the content of the y-data array to y. If necessary remaining elements of the x-data array are set to xval.

References Array< T >::assign(), and Array< T >::size().

const Map< T > & assign ( const Array< T > &  x,
const Array< T > &  y 
)

Set the size(), capacity(), and content of the map to x and y.

References Array< T >::assign().

const Map< T > & assign ( const SampleData< T > &  sa)

Set the size(), capacity(), and content of the map to sa.

References SampleData< T >::array(), Array< T >::assign(), and SampleData< T >::range().

const Map< T > & assign ( const Map< T > &  a)

Set the size(), capacity(), and content of the map to a.

References Array< T >::assign().

const Map< T > & copy ( T *  y,
int  n,
const T &  yval = 0 
)

Copy the content of the y-data array to y. If necessary remaining elements of y are set to yval.

References Array< T >::copy().

const Map< T > & copy ( T *  x,
T *  y,
int  n,
const T &  xval = 0,
const T &  yval = 0 
)

Copy the content of the x-data array to x and of the y-data array to y. If necessary remaining elements of x are set to xval and remaining elements of y are set to yval.

References Array< T >::copy().

const Map< T > & copy ( vector< T > &  y)

Copy the content of the y-data array to y.

References Array< T >::copy().

const Map< T > & copy ( vector< T > &  x,
vector< T > &  y 
)

Copy the content of the x-data array to x and the content of the y-data array to y.

References Array< T >::copy().

const Map< T > & copy ( Array< T > &  y)

Copy the content of the y-data array to y.

References Array< T >::copy().

const Map< T > & copy ( Array< T > &  x,
Array< T > &  y 
)

Copy the content of the x-data array to x and the content of the y-data array to y.

References Array< T >::copy().

const Map< T > & copy ( Map< T > &  a)

Copy the content of the map to a.

const Map< T > & append ( const T *  x,
const T *  y,
int  n 
)

Append x and y of size n to the map's x-data array and y-data array, respectively.

References Array< T >::append().

const Map< T > & append ( const vector< T > &  x,
const vector< T > &  y 
)

Append x and y to the map's x-data array and y-data array, respectively.

References Array< T >::append().

const Map< T > & append ( const Array< T > &  x,
const Array< T > &  y 
)

Append x and y to the map's x-data array and y-data array, respectively.

References Array< T >::append().

const Map< T > & append ( const Map< T > &  a)

Append a to the map.

References Array< T >::append().

int size ( void  ) const
inline

The size of the map, i.e. the number of data elements.

Referenced by EventData::addFrequencies(), EventData::addIntervals(), and SampleData< T >::interpolate().

bool empty ( void  ) const
inline

True if the map does not contain any data elements.

Referenced by SampleData< T >::interpolate().

int resize ( int  n,
const T &  val = 0 
)
virtual

Resize the map to n data elements such that both the size() and the capacity of the map equals n. Data values are preserved.

Returns
the new size of the map (might be smaller than n)

Reimplemented from Array< T >.

References Array< T >::resize().

int resize ( int  n,
const T &  xval,
const T &  yval 
)

Resize the map to n data elements such that both the size() and the capacity of the map equals n. Data values are preserved.

Returns
the new size of the map (might be smaller than n)

References Array< T >::resize().

void clear ( void  )
virtual

Resize the map to zero length and free all memory.

Reimplemented from Array< T >.

References Array< T >::clear().

Referenced by SampleData< T >::copy(), EventData::copy(), EventData::frequencies(), and EventData::intervals().

int capacity ( void  ) const
inline

The capacity of the map, i.e. the number of data pairs for which memory has been allocated. capacity() is always greater than or equal to size().

int reserve ( int  n)
virtual

If n is less than or equal to capacity(), this call has no effect. Otherwise, it is a request for allocation of additional memory. If the request is successful, then capacity() is greater than or equal to n; otherwise, capacity() is unchanged. In either case, size() is unchanged and the content of the array is preserved.

Returns
the new capacity (might be smaller than n ).

Reimplemented from Array< T >.

References Array< T >::reserve().

Referenced by EventData::addFrequencies(), EventData::addIntervals(), SampleData< T >::copy(), and EventData::copy().

void free ( int  n = 0)
virtual

In contrast to the reserve() function, this function frees or allocates memory, such that capacity() equals exactly n. If the size() of the array is greater than n it is set to n as well.

Reimplemented from Array< T >.

References Array< T >::free().

const Array< T >& x ( void  ) const
inline

Returns a reference to the x-data array.

Referenced by SampleData< T >::interpolate(), and Plot::plot().

Array< T >& x ( void  )
inline

Returns a const reference to the x-data array.

const Array< T >& y ( void  ) const
inline

Returns a const reference to the y-data array.

Referenced by SampleData< T >::interpolate(), and Plot::plot().

Array< T >& y ( void  )
inline

Returns a reference to the y-data array.

const T& x ( int  i) const
inline

Returns a reference to the element of the x-data array at index i. No range checking is performed.

T& x ( int  i)
inline

Returns a reference to the element of the x-data array at index i. No range checking is performed.

const T& y ( int  i) const
inline

Returns a reference to the element of the y-data array at index i. No range checking is performed.

T& y ( int  i)
inline

Returns a reference to the element of the y-data array at index i. No range checking is performed.

const T& operator[] ( int  i) const
inline

Returns a reference to the element of the y-data array at index i. No range checking is performed.

T& operator[] ( int  i)
inline

Returns a reference to the element of the y-data array at index i. No range checking is performed.

const T& operator() ( int  i,
int  j 
) const
inline

Returns a reference to the element at index j of the x-data array if i equals zero or the y-data array if i equals one. No range checking is performed.

T& operator() ( int  i,
int  j 
)
inline

Returns a reference to the element at index j of the x-data array if i equals zero or the y-data array if i equals one. No range checking is performed.

int push ( const T &  xval,
const T &  yval 
)
inline

Add the data pair xval, yval to the map.

Returns
the number of added elements (0 or 1).

Referenced by EventData::addFrequencies(), EventData::addIntervals(), SampleData< T >::copy(), and EventData::copy().

int push ( const R &  xval,
const R &  yval 
)

Add the data pairs from the containers x and y to the map.

Returns
the number of added elements (0 or 1).
void pop ( void  )

Remove the last element of the map.

References Array< T >::pop().

iterator begin ( void  )
inline

Returns an iterator pointing to the first element of the y-data array.

const_iterator begin ( void  ) const
inline

Returns an const_iterator pointing to the first element of the y-data array.

iterator end ( void  )
inline

Returns an iterator pointing behind the last element of the y-data array.

const_iterator end ( void  ) const
inline

Returns an const_iterator pointing behind the last element of the y-data array.

Map< T > & insert ( int  i,
const T &  xval,
const T &  yval 
)

Insert the data pair xval, yval at position i.

Map< T > & push_front ( const T &  xval,
const T &  yval 
)

Insert the data pair xval, yval as the first element of the Map.

int insert ( const T &  xval,
const T &  yval 
)

Insert the data pair xval, yval after the first element whose x-value is smaller than xval. Returns the index of the inserted data element.

Map< T > & erase ( int  i)

Remove data pair at position i from the Map.

Map< T > & sortByX ( void  )

Sort the x and y-array by x.

Map< T > & sortByY ( void  )

Sort the x and y-array by y.

CONTAINEROPS1SCALARDEC ( Map< T >  ,
operator   
)

Set the value of each data element to val.

CONTAINEROPS1DEC ( Map< T >  ,
operator+   
)

Add each value of x to the corresponding data element. x can be either a container or a scalar type like float, double, int, etc.

CONTAINEROPS1DEC ( Map< T >  ,
operator-   
)

Subtract each value of x from the corresponding data element. x can be either a container or a scalar type like float, double, int, etc.

CONTAINEROPS1DEC ( Map< T >  ,
operator*   
)

Multiply each data element by the corresponding value of x. x can be either a container or a scalar type like float, double, int, etc.

CONTAINEROPS1DEC ( Map< T >  ,
operator/   
)

Divide each data element by the corresponding value of x. x can be either a container or a scalar type like float, double, int, etc.

CONTAINEROPS1DEC ( Map< T >  ,
operator%   
)

Return the remainder of the division of each data element by the corresponding value of x. x can be either a container or a scalar type like float, double, int, etc.

CONTAINEROPS2DEC ( class TT  ,
Map< TT >  ,
operator+   
)

Return the sum of x and y computed for each element. x and y can be either a container or a scalar type like float, double, int, etc.

CONTAINEROPS2DEC ( class TT  ,
Map< TT >  ,
operator-   
)

Return the difference between x and y computed for each element. x and y can be either a container or a scalar type like float, double, int, etc.

CONTAINEROPS2DEC ( class TT  ,
Map< TT >  ,
operator*   
)

Return the product of x and y computed for each element. x and y can be either a container or a scalar type like float, double, int, etc.

CONTAINEROPS2DEC ( class TT  ,
Map< TT >  ,
operator/   
)

Return x divided by y computed for each element. x and y can be either a container or a scalar type like float, double, int, etc.

CONTAINEROPS2DEC ( class TT  ,
Map< TT >  ,
operator%   
)

Return the remainder of x divided by y computed for each element. x and y can be either a container or a scalar type like float, double, int, etc.

Map< T > operator- ( void  )

Negates each element of the y-data array.

Map< T > & identity ( void  )

Set the value of each y-data element to the value of the corresponding x-data element.

T interpolate ( double  x) const

Return a linearly interpolated value for position x. If x is outside the range the value of the first or last data element is returned. Assumes the x() array to be sorted ascendingly.

T minX ( T &  y,
int  first = 0,
int  last = -1 
) const

The minimum value of the elements of the x-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered. In y the corresponding value of the y-data array is returned. If the range is empty, y is set to 0 and 0 is returned.

References relacs::min().

T minY ( T &  x,
int  first = 0,
int  last = -1 
) const

The minimum value of the elements of the y-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered. In x the corresponding value of the x-data array is returned. If the range is empty, x is set to 0 and 0 is returned.

References relacs::min(), and Array< T >::minIndex().

int minXIndex ( T &  min,
T &  y,
int  first = 0,
int  last = -1 
) const

The index of the element with the minimum value of the elements of the x-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered. The value of the minimum element is returned in min and the corresponding value of the y-data array is returned in y. If the range is empty, min and y are set to 0 and -1 is returned.

int minYIndex ( T &  min,
T &  x,
int  first = 0,
int  last = -1 
) const

The index of the element with the minimum value of the elements of the y-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered. The value of the minimum element is returned in min and the corresponding value of the x-data array is returned in x. If the range is empty, min and x are set to 0 and -1 is returned.

References Array< T >::minIndex().

T maxX ( T &  y,
int  first = 0,
int  last = -1 
) const

The maximum value of the elements of the x-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered. In y the corresponding value of the y-data array is returned. If the range is empty, y is set to 0 and 0 is returned.

References relacs::max().

T maxY ( T &  x,
int  first = 0,
int  last = -1 
) const

The maximum value of the elements of the y-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered. In x the corresponding value of the x-data array is returned. If the range is empty, x is set to 0 and 0 is returned.

References relacs::max(), and Array< T >::maxIndex().

int maxXIndex ( T &  max,
T &  x,
int  first = 0,
int  last = -1 
) const

The index of the element with the maximum value of the elements of the x-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered. The value of the maximum element is returned in max and the corresponding value of the y-data array is returned in y. If the range is empty, max and x are set to 0 and -1 is returned.

int maxYIndex ( T &  max,
T &  x,
int  first = 0,
int  last = -1 
) const

The index of the element with the maximum value of the elements of the y-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered. The value of the maximum element is returned in max and the corresponding value of the x-data array is returned in x. If the range is empty, max and x are set to 0 and -1 is returned.

References Array< T >::maxIndex().

void minMaxX ( T &  min,
T &  miny,
T &  max,
T &  maxy,
int  first = 0,
int  last = -1 
) const

The minimum value min and the maximum value max of the elements of the x-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered. In miny and maxy the corresponding values of the y-data array are returned. If the range is empty, min, miny, max, and maxy are set to 0.

void minMaxY ( T &  min,
T &  minx,
T &  max,
T &  maxx,
int  first = 0,
int  last = -1 
) const

The minimum value min and the maximum value max of the elements of the y-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered. In minx and maxx the corresponding values of the x-data array are returned. If the range is empty, min, minx, max, and maxx are set to 0.

References Array< T >::minMaxIndex().

void minMaxXIndex ( T &  min,
int &  minindex,
T &  miny,
T &  max,
int &  maxindex,
T &  maxy,
int  first = 0,
int  last = -1 
) const

The indices minindex and maxindex of the elements with the minimum value min and maximum value max of the elements of the x-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered. The corresponding values of the y-data array are returned in ymin and ymax. If the range is empty, min, miny, max, and maxy are set to 0 and minindex and maxindex to -1.

void minMaxYIndex ( T &  min,
int &  minindex,
T &  minx,
T &  max,
int &  maxindex,
T &  maxx,
int  first = 0,
int  last = -1 
) const

The indices minindex and maxindex of the elements with the minimum value min and the maximum value max of the elements of the y-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered. The corresponding values of the x-data array are returned in minx and maxx. If the range is empty, min, minx, max, and maxx are set to 0 and minindex and maxindex to -1.

References Array< T >::minMaxIndex().

double cov ( int  first = 0,
int  last = -1 
) const

The covariance cov(x,y) = <(x-<x>)(y-<y>)> of the elements of the x-data and y-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered.

References relacs::cov().

double corrCoef ( int  first = 0,
int  last = -1 
) const

The linear correlation coefficient r = cov(x,y)/sqrt(var(x)var(y)) (Pearson's r) of the elements of the x-data and y-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered.

References relacs::corrCoef().

void propFit ( int  first,
int  last,
double &  m,
double &  mu,
double &  chisq 
) const

Fit line y = m*x to the x-data and y-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Returns in m the slope, in mu the slope's uncertainty, and in chisq the chi squared.

References relacs::chisq(), and relacs::propFit().

void propFit ( double &  m,
double &  mu,
double &  chisq 
) const
inline

Fit line y = m*x to the complete x-data and y-data array. Returns in m the slope, in mu the slope's uncertainty, and in chisq the chi squared.

References Map< T >::propFit().

Referenced by Map< T >::propFit().

double propFit ( int  first = 0,
int  last = -1 
) const
inline

Fit line y = m*x to the x-data and y-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Called with no arguments all data elements are considered. Returns the slope of the line.

References Map< T >::propFit().

Referenced by Map< T >::propFit().

void lineFit ( int  first,
int  last,
double &  b,
double &  bu,
double &  m,
double &  mu,
double &  chisq 
) const

Fit line y = b+m*x to the x-data and y-data array between indices first (inclusively) and last (exclusively). If last is negative it is set behind the last data element. Returns in bu and mu the uncertainty of the offset b und slope m, and in chisq the chi squared.

References relacs::chisq(), and relacs::lineFit().

void lineFit ( double &  b,
double &  bu,
double &  m,
double &  mu,
double &  chisq 
) const
inline

Fit line y = b+m*x to the complete x-data and y-data array. Returns in bu and mu the uncertainty of the offset b und slope m, and in chisq the chi squared.

References relacs::lineFit().

void lineFit ( double &  b,
double &  m 
) const
inline

Fit line y = b+m*x to the complete x-data and y-data array. Returns the offset b und slope m of the line.

References Map< T >::lineFit().

Referenced by Map< T >::lineFit().

ostream & save ( ostream &  str,
int  width = 10,
int  prec = 5,
const string &  start = "",
const string &  separator = " " 
) const

Write content of the Map into stream str. Each element is written in a line. First, the string start is written, then the value of the x-data array, then the string separator followed by the value of the y-data array element, and finally a newline. The array elements are formatted in a field of width width characters and precision decimals.

void save ( const string &  file,
int  width = 8,
int  prec = 3 
) const
istream & load ( istream &  str,
const string &  stop = "",
string *  line = 0 
)

Read from stream str until end of file or a line beginning with stop is reached. If stop equals "EMPTY", reading is stopped at an empty line. If line does not equal zero then the last read line is returned in line.

Map< T > & load ( const string &  file,
const string &  stop = "" 
)

Friends And Related Function Documentation

bool operator== ( const Map< TT > &  a,
const Map< TT > &  b 
)
friend

True if size and content of map a and b are equal.

bool operator< ( const Map< TT > &  a,
const Map< TT > &  b 
)
friend

True if the value of each data element and size of map a is smaller than b.

void average ( Map< TT > &  meantrace,
const vector< Map< TT > > &  traces 
)
friend

Returns in meantrace the average over traces at each position x() of meantrace. The traces are linearly interpolated.

void average ( Map< TT > &  meantrace,
Map< TT > &  stdev,
const vector< Map< TT > > &  traces 
)
friend

Returns in meantrace and stdev the average and standard deviation over traces at each position x() of meantrace. The traces are linearly interpolated.

void average ( SampleData< TT > &  meantrace,
const vector< Map< TT > > &  traces 
)
friend

Returns in meantrace the average over traces at each position pos() of meantrace. The traces are linearly interpolated.

void average ( SampleData< TT > &  meantrace,
SampleData< TT > &  stdev,
const vector< Map< TT > > &  traces 
)
friend

Returns in meantrace and stdev the average and standard deviation over traces at each position pos() of meantrace. The traces are linearly interpolated.

ostream& operator<< ( ostream &  str,
const Map< TT > &  a 
)
friend
istream& operator>> ( istream &  str,
Map< TT > &  a 
)
friend

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