| OpenMS 2.5.0

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BaseModel< D > Class Template Referenceabstract

Abstract base class for all D-dimensional models. More...

`#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/BaseModel.h>`

Inheritance diagram for BaseModel< D >:

## Public Types

typedef double | IntensityType
typedef double | CoordinateType
typedef DPosition< D > | PositionType
typedef DPeak< D >::Type | PeakType
typedef std::vector< PeakType > | SamplesType

## Public Member Functions

| BaseModel ()
| Default constructor. More...
| BaseModel (const BaseModel &source)
| copy constructor More...
| ~BaseModel () override
| Destructor. More...
virtual BaseModel & | operator= (const BaseModel &source)
| assignment operator More...
virtual IntensityType | getIntensity (const PositionType &pos) const =0
| access model predicted intensity at position `pos` More...
virtual bool | isContained (const PositionType &pos) const
| check if position `pos` is part of the model regarding the models cut-off. More...
template<typename PeakType >
void | fillIntensity (PeakType &peak) const
| Convenience function to set the intensity of a peak to the predicted intensity at its current position, calling virtual void getIntensity(). More...
template<class PeakIterator >
void | fillIntensities (PeakIterator begin, PeakIterator end) const
| Convenience function that applies fillIntensity() to an iterator range. More...
virtual IntensityType | getCutOff () const
| get cutoff value More...
virtual void | setCutOff (IntensityType cut_off)
| set cutoff value More...
virtual void | getSamples (SamplesType &cont) const =0
| get reasonable set of samples from the model (i.e. for printing) More...
virtual void | getSamples (std::ostream &os)
| fill stream with reasonable set of samples from the model (i.e. for printing) More...
template<>
void | registerChildren ()
template<>
void | registerChildren ()
Public Member Functions inherited from DefaultParamHandler
| DefaultParamHandler (const String &name)
| Constructor with name that is displayed in error messages. More...
| DefaultParamHandler (const DefaultParamHandler &rhs)
| Copy constructor. More...
virtual | ~DefaultParamHandler ()
| Destructor. More...
virtual DefaultParamHandler & | operator= (const DefaultParamHandler &rhs)
| Assignment operator. More...
virtual bool | operator== (const DefaultParamHandler &rhs) const
| Equality operator. More...
void | setParameters (const Param &param)
| Sets the parameters. More...
const Param & | getParameters () const
| Non-mutable access to the parameters. More...
const Param & | getDefaults () const
| Non-mutable access to the default parameters. More...
const String & | getName () const
| Non-mutable access to the name. More...
void | setName (const String &name)
| Mutable access to the name. More...
const std::vector< String > & | getSubsections () const
| Non-mutable access to the registered subsections. More...

## Static Public Member Functions

static void | registerChildren ()
| register all derived classes here (implemented in file BaseModel_impl.h) More...

## Protected Member Functions

void | updateMembers_ () override
| This method is used to update extra member variables at the end of the setParameters() method. More...
Protected Member Functions inherited from DefaultParamHandler
void | defaultsToParam_ ()
| Updates the parameters after the defaults have been set in the constructor. More...

## Protected Attributes

IntensityType | cut_off_
Protected Attributes inherited from DefaultParamHandler
Param | param_
| Container for current parameters. More...
Param | defaults_
| Container for default parameters. This member should be filled in the constructor of derived classes! More...
std::vector< String > | subsections_
| Container for registered subsections. This member should be filled in the constructor of derived classes! More...
String | error_name_
| Name that is displayed in error messages during the parameter checking. More...
bool | check_defaults_
| If this member is set to false no checking if parameters in done;. More...
bool | warn_empty_defaults_
| If this member is set to false no warning is emitted when defaults are empty;. More...

## Detailed Description

### template<UInt D>
class OpenMS::BaseModel< D >

Abstract base class for all D-dimensional models.

Every derived class has to implement the static functions "T* create()" and "const String getProductName()" (see DefaultParamHandler for details)

## Member Typedef Documentation

## ◆ CoordinateType

typedef double CoordinateType

## ◆ IntensityType

typedef double IntensityType

## ◆ PeakType

typedef DPeak<D>::Type PeakType

## ◆ PositionType

typedef DPosition<D> PositionType

## ◆ SamplesType

typedef std::vector<PeakType> SamplesType

## Constructor & Destructor Documentation

## ◆ BaseModel() [1/2]

BaseModel | ( |  | ) |

inline

Default constructor.

## ◆ BaseModel() [2/2]

BaseModel | ( | const BaseModel< D > & | source | ) |

inline

copy constructor

## ◆ ~BaseModel()

~BaseModel | ( |  | ) |

inline override

Destructor.

## Member Function Documentation

## ◆ fillIntensities()

void fillIntensities | ( | PeakIterator | begin,
|  | PeakIterator | end
| ) |  | const

inline

Convenience function that applies fillIntensity() to an iterator range.

## ◆ fillIntensity()

void fillIntensity | ( | PeakType & | peak | ) | const

inline

Convenience function to set the intensity of a peak to the predicted intensity at its current position, calling virtual void getIntensity().

Referenced by BaseModel< 2 >::fillIntensities().

## ◆ getCutOff()

virtual IntensityType getCutOff | ( |  | ) | const

inline virtual

get cutoff value

## ◆ getIntensity()

virtual IntensityType getIntensity | ( | const PositionType & | pos | ) | const

pure virtual

access model predicted intensity at position `pos`

Implemented in ProductModel< 2 >.

Referenced by BaseModel< 2 >::fillIntensity(), and BaseModel< 2 >::isContained().

## ◆ getSamples() [1/2]

virtual void getSamples | ( | SamplesType & | cont | ) | const

pure virtual

get reasonable set of samples from the model (i.e. for printing)

Implemented in ProductModel< 2 >, and InterpolationModel.

Referenced by BaseModel< 2 >::getSamples().

## ◆ getSamples() [2/2]

virtual void getSamples | ( | std::ostream & | os | ) |

inline virtual

fill stream with reasonable set of samples from the model (i.e. for printing)

## ◆ isContained()

virtual bool isContained | ( | const PositionType & | pos | ) | const

inline virtual

check if position `pos` is part of the model regarding the models cut-off.

## ◆ operator=()

virtual BaseModel& operator= | ( | const BaseModel< D > & | source | ) |

inline virtual

assignment operator

Referenced by InterpolationModel::operator=(), and ProductModel< 2 >::operator=().

## ◆ registerChildren() [1/3]

void registerChildren | ( |  | ) |

## ◆ registerChildren() [2/3]

void registerChildren | ( |  | ) |

## ◆ registerChildren() [3/3]

static void registerChildren | ( |  | ) |

static

register all derived classes here (implemented in file BaseModel_impl.h)

## ◆ setCutOff()

virtual void setCutOff | ( | IntensityType | cut_off | ) |

inline virtual

set cutoff value

## ◆ updateMembers_()

void updateMembers_ | ( |  | ) |

inline override protected virtual

This method is used to update extra member variables at the end of the setParameters() method.

Also call it at the end of the derived classes' copy constructor and assignment operator.

The default implementation is empty.

Reimplemented from DefaultParamHandler.

Referenced by InterpolationModel::updateMembers_(), and ProductModel< 2 >::updateMembers_().

## Member Data Documentation

## ◆ cut_off_

IntensityType cut_off_

protected

Referenced by BaseModel< 2 >::getCutOff(), BaseModel< 2 >::isContained(), BaseModel< 2 >::operator=(), BaseModel< 2 >::setCutOff(), and BaseModel< 2 >::updateMembers_().