35 #ifndef OPENMS_MATH_MISC_RANSACMODEL_H 36 #define OPENMS_MATH_MISC_RANSACMODEL_H 38 #include <OpenMS/config.h> 58 template<
class ModelT =
int>
62 typedef std::pair<double, double>
DPair;
63 typedef std::vector<DPair>
DVec;
69 ModelParameters
rm_fit(
const DVecIt& begin,
const DVecIt& end)
const 71 return static_cast<const ModelT*
>(
this)->rm_fit_impl(begin, end);
83 double rm_rsq(
const DVecIt& begin,
const DVecIt& end)
const 85 return static_cast<const ModelT*
>(
this)->rm_rsq_impl(begin, end);
89 double rm_rss(
const DVecIt& begin,
const DVecIt& end,
const ModelParameters& coefficients)
const 91 return static_cast<const ModelT*
>(
this)->rm_rss_impl(begin, end, coefficients);
96 DVec
rm_inliers(
const DVecIt& begin,
const DVecIt& end,
const ModelParameters& coefficients,
double max_threshold)
const 98 return static_cast<const ModelT*
>(
this)->rm_inliers_impl(begin, end, coefficients, max_threshold);
106 #endif // OPENMS_MATH_MISC_RANSACMODEL_H ModelParameters rm_fit(const DVecIt &begin, const DVecIt &end) const
fit a model and return its parameters
Definition: RANSACModel.h:69
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
DVec::const_iterator DVecIt
Definition: RANSACModel.h:64
std::vector< double > ModelParameters
Definition: RANSACModel.h:65
std::vector< DPair > DVec
Definition: RANSACModel.h:63
std::pair< double, double > DPair
Definition: RANSACModel.h:62
double rm_rsq(const DVecIt &begin, const DVecIt &end) const
Returns the R-squared of the data applied to the model (computed on-the-fly).
Definition: RANSACModel.h:83
DVec rm_inliers(const DVecIt &begin, const DVecIt &end, const ModelParameters &coefficients, double max_threshold) const
Definition: RANSACModel.h:96
double rm_rss(const DVecIt &begin, const DVecIt &end, const ModelParameters &coefficients) const
calculates the residual sum of squares of the input points according to the model ...
Definition: RANSACModel.h:89
Generic plug-in template base class using 'Curiously recurring template pattern' (CRTP) to allow for ...
Definition: RANSACModel.h:59