11#include <OpenMS/OPENSWATHALGO/OpenSwathAlgoConfig.h>
25 OPENSWATHALGO_DLLAPI
void normalize(
const std::vector<double>& intensities,
double normalization_factor, std::vector<double>& normalized_intensities);
36 extern template double norm<std::vector<double>::const_iterator>(
37 std::vector<double>::const_iterator, std::vector<double>::const_iterator);
39 extern template double norm<std::vector<double>::iterator>(
40 std::vector<double>::iterator, std::vector<double>::iterator);
47 template <
typename Texp,
typename Ttheo>
48 double dotProd(Texp intExpBeg, Texp intExpEnd, Ttheo intTheo);
53 extern template double dotProd<std::vector<double>::const_iterator, std::vector<double>::const_iterator>(
54 std::vector<double>::const_iterator, std::vector<double>::const_iterator, std::vector<double>::const_iterator);
56 extern template double dotProd<std::vector<float>::const_iterator, std::vector<float>::const_iterator>(
57 std::vector<float>::const_iterator, std::vector<float>::const_iterator, std::vector<float>::const_iterator);
59 extern template double dotProd<std::vector<int>::const_iterator, std::vector<int>::const_iterator>(
60 std::vector<int>::const_iterator, std::vector<int>::const_iterator, std::vector<int>::const_iterator);
71 OPENSWATHALGO_DLLAPI
double dotprodScoring(std::vector<double> intExp, std::vector<double> theorint);
76 template <
typename Texp,
typename Ttheo>
82 extern template double manhattanDist<std::vector<double>::iterator, std::vector<double>::iterator>(
83 std::vector<double>::iterator, std::vector<double>::iterator, std::vector<double>::iterator);
85 extern template double manhattanDist<std::vector<double>::const_iterator, std::vector<double>::const_iterator>(
86 std::vector<double>::const_iterator, std::vector<double>::const_iterator, std::vector<double>::const_iterator);
97 OPENSWATHALGO_DLLAPI
double manhattanScoring(std::vector<double> intExp, std::vector<double> theorint);
104 template <
typename TInputIterator,
typename TInputIteratorY>
105 [[deprecated(
"Use Math::pearsonCorrelationCoefficient instead")]]
106 typename std::iterator_traits<TInputIterator>::value_type
cor_pearson(
112 typedef typename std::iterator_traits<TInputIterator>::value_type value_type;
116 m1 = m2 = s1 = s2 = 0.0;
118 ptrdiff_t n = std::distance(xBeg, xEnd);
119 value_type nd =
static_cast<value_type
>(n);
120 for (; xBeg != xEnd; ++xBeg, ++yBeg)
122 corr += *xBeg * *yBeg;
133 if (s1 < 1.0e-12 || s2 < 1.0e-12)
137 corr -= m1 * m2 * (double)n;
138 corr /= sqrt(s1 * s2);
153 m_(0.0), q_(0.0), c_(0u)
159 double const delta = sample - m_;
161 q_ += delta * (sample - m_);
166 return (c_ > 1u) ? (q_ / (c_ - 1)) : 0;
171 return (c_ > 1u) ? (q_ / c_) : 0;
176 return std::sqrt(sample_variance());
181 return std::sqrt(standard_variance());
196 return sample_variance();
201 return sample_stddev();
functor to compute the mean and stddev of sequence using the std::foreach algorithm
Definition StatsHelpers.h:147
double result_type
Definition StatsHelpers.h:151
mean_and_stddev()
Definition StatsHelpers.h:152
double standard_stddev() const
Definition StatsHelpers.h:179
unsigned long c_
Definition StatsHelpers.h:149
double sample_stddev() const
Definition StatsHelpers.h:174
double mean() const
Definition StatsHelpers.h:184
double stddev() const
Definition StatsHelpers.h:199
double argument_type
Definition StatsHelpers.h:151
double variance() const
Definition StatsHelpers.h:194
unsigned long count() const
Definition StatsHelpers.h:189
double standard_variance() const
Definition StatsHelpers.h:169
void operator()(double sample)
Definition StatsHelpers.h:157
double m_
Definition StatsHelpers.h:148
double operator()() const
Definition StatsHelpers.h:204
double sample_variance() const
Definition StatsHelpers.h:164
double dotProd(Texp intExpBeg, Texp intExpEnd, Ttheo intTheo)
compute dotprod of vectors
OPENSWATHALGO_DLLAPI double dotprodScoring(std::vector< double > intExp, std::vector< double > theorint)
the dot product scoring
OPENSWATHALGO_DLLAPI void normalize(const std::vector< double > &intensities, double normalization_factor, std::vector< double > &normalized_intensities)
Normalize intensities in vector by normalization_factor.
OPENSWATHALGO_DLLAPI double manhattanScoring(std::vector< double > intExp, std::vector< double > theorint)
manhattan scoring
double norm(T beg, T end)
compute the Euclidean norm of the vector
std::iterator_traits< TInputIterator >::value_type cor_pearson(TInputIterator xBeg, TInputIterator xEnd, TInputIteratorY yBeg)
compute pearson correlation of vector x and y
Definition StatsHelpers.h:106
double manhattanDist(Texp itExpBeg, Texp itExpEnd, Ttheo itTheo)
compute manhattan distance between Exp and Theo