OpenMS
|
Base class for transformation models. More...
#include <OpenMS/ANALYSIS/MAPMATCHING/TransformationModel.h>
Classes | |
struct | DataPoint |
Coordinate pair (with optional annotation) More... | |
Public Types | |
typedef std::vector< DataPoint > | DataPoints |
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 Param & | getParameters () const |
Gets the (actual) parameters. More... | |
std::vector< String > | getValidXWeights () const |
Returns a list of valid x weight function strings. More... | |
std::vector< String > | getValidYWeights () const |
Returns a list of valid y weight function strings. More... | |
Static Public Member Functions | |
static void | getDefaultParameters (Param ¶ms) |
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 TransformationModel & | operator= (const TransformationModel &) |
do not allow assignment More... | |
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.
typedef std::vector<DataPoint> DataPoints |
Vector of coordinate pairs.
|
inline |
Constructor.
TransformationModel | ( | const TransformationModel::DataPoints & | , |
const Param & | |||
) |
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!
|
virtual |
Destructor.
|
private |
do not allow copy
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.
Check for a valid weighting function string.
|
virtual |
Evaluates the model at the given value.
Reimplemented in TransformationModelLowess, TransformationModelLinear, TransformationModelInterpolated, and TransformationModelBSpline.
|
static |
Gets the default parameters.
const Param& getParameters | ( | ) | const |
Gets the (actual) parameters.
std::vector<String> getValidXWeights | ( | ) | const |
Returns a list of valid x weight function strings.
std::vector<String> getValidYWeights | ( | ) | const |
Returns a list of valid y weight function strings.
|
private |
do not allow assignment
|
virtual |
Unweight the data by the given weight function.
double unWeightDatum | ( | const double & | datum, |
const String & | weight | ||
) | const |
Apply the reverse of the weighting function to the data.
|
virtual |
Weight the data by the given weight function.
Currently supported valid weighting functions include the following:
double weightDatum | ( | const double & | datum, |
const String & | weight | ||
) | const |
Weight the data according to the weighting function.
|
protected |
Parameters.
|
protected |
|
protected |
|
protected |
|
protected |
x weighting
|
protected |
|
protected |
|
protected |
y weighting