OpenMS
TransformationModel Class Reference

Base class for transformation models. More...

#include <OpenMS/ANALYSIS/MAPMATCHING/TransformationModel.h>

Inheritance diagram for TransformationModel:
[legend]
Collaboration diagram for TransformationModel:
[legend]

Classes

struct  DataPoint
 Coordinate pair (with optional annotation) More...
 

Public Types

typedef std::vector< DataPointDataPoints
 Vector of coordinate pairs. More...
 

Public Member Functions

 TransformationModel ()
 Constructor. More...
 
 TransformationModel (const TransformationModel::DataPoints &, const Param &)
 
virtual ~TransformationModel ()
 Destructor. More...
 
virtual double evaluate (double value) const
 Evaluates the model at the given value. More...
 
virtual void weightData (DataPoints &data)
 Weight the data by the given weight function. More...
 
virtual void unWeightData (DataPoints &data)
 Unweight the data by the given weight function. More...
 
bool checkValidWeight (const String &weight, const std::vector< String > &valid_weights) const
 Check for a valid weighting function string. More...
 
double checkDatumRange (const double &datum, const double &datum_min, const double &datum_max)
 Check that the datum is within the valid min and max bounds. More...
 
double weightDatum (const double &datum, const String &weight) const
 Weight the data according to the weighting function. More...
 
double unWeightDatum (const double &datum, const String &weight) const
 Apply the reverse of the weighting function to the data. More...
 
const ParamgetParameters () const
 Gets the (actual) parameters. More...
 
std::vector< StringgetValidXWeights () const
 Returns a list of valid x weight function strings. More...
 
std::vector< StringgetValidYWeights () const
 Returns a list of valid y weight function strings. More...
 

Static Public Member Functions

static void getDefaultParameters (Param &params)
 Gets the default parameters. More...
 

Protected Attributes

Param params_
 Parameters. More...
 
String x_weight_
 x weighting More...
 
double x_datum_min_
 
double x_datum_max_
 
String y_weight_
 y weighting More...
 
double y_datum_min_
 
double y_datum_max_
 
bool weighting_
 

Private Member Functions

 TransformationModel (const TransformationModel &)
 do not allow copy More...
 
const TransformationModeloperator= (const TransformationModel &)
 do not allow assignment More...
 

Detailed Description

Base class for transformation models.

Implements the identity (no transformation). Parameters and data are ignored.

Note that this class and its derived classes do not allow copying/assignment, due to the need for internal memory management associated with some of the transformation models.

Member Typedef Documentation

◆ DataPoints

typedef std::vector<DataPoint> DataPoints

Vector of coordinate pairs.

Constructor & Destructor Documentation

◆ TransformationModel() [1/3]

TransformationModel ( )
inline

Constructor.

◆ TransformationModel() [2/3]

Alternative constructor (derived classes should implement this one!) Both data and params must be provided, since some derived classes require both to create a model!

◆ ~TransformationModel()

virtual ~TransformationModel ( )
virtual

Destructor.

◆ TransformationModel() [3/3]

do not allow copy

Member Function Documentation

◆ checkDatumRange()

double checkDatumRange ( const double &  datum,
const double &  datum_min,
const double &  datum_max 
)

Check that the datum is within the valid min and max bounds.

The method checks if the datum is within the user specified min and max bounds. If the datum is below the min bounds, the min bound is returned. If the datum is above the max bounds, the max bound is returned.

◆ checkValidWeight()

bool checkValidWeight ( const String weight,
const std::vector< String > &  valid_weights 
) const

Check for a valid weighting function string.

◆ evaluate()

virtual double evaluate ( double  value) const
virtual

◆ getDefaultParameters()

static void getDefaultParameters ( Param params)
static

Gets the default parameters.

◆ getParameters()

const Param& getParameters ( ) const

Gets the (actual) parameters.

◆ getValidXWeights()

std::vector<String> getValidXWeights ( ) const

Returns a list of valid x weight function strings.

◆ getValidYWeights()

std::vector<String> getValidYWeights ( ) const

Returns a list of valid y weight function strings.

◆ operator=()

const TransformationModel& operator= ( const TransformationModel )
private

do not allow assignment

◆ unWeightData()

virtual void unWeightData ( DataPoints data)
virtual

Unweight the data by the given weight function.

◆ unWeightDatum()

double unWeightDatum ( const double &  datum,
const String weight 
) const

Apply the reverse of the weighting function to the data.

◆ weightData()

virtual void weightData ( DataPoints data)
virtual

Weight the data by the given weight function.

Currently supported valid weighting functions include the following:

  • 1 / x.
  • 1 / x2.
  • 1 / y.
  • 1 / y2.
  • ln x.
  • ln y. Note that the user needs to ensure valid bounds for the data by setting the x_datum_min/x_datum_max and y_datum_min/y_datum_max params.

◆ weightDatum()

double weightDatum ( const double &  datum,
const String weight 
) const

Weight the data according to the weighting function.

Member Data Documentation

◆ params_

Param params_
protected

Parameters.

◆ weighting_

bool weighting_
protected

◆ x_datum_max_

double x_datum_max_
protected

◆ x_datum_min_

double x_datum_min_
protected

◆ x_weight_

String x_weight_
protected

x weighting

◆ y_datum_max_

double y_datum_max_
protected

◆ y_datum_min_

double y_datum_min_
protected

◆ y_weight_

String y_weight_
protected

y weighting