65 auto itb = trace_b.begin();
66 double inner_intensity_product = 0;
67 for(
const auto &peak_a : trace_a)
70 double low = range.
lower();
71 double up = range.
upper();
73 while((itb != trace_b.end()) && (itb->x < low))
79 inner_intensity_product += peak_a.y * itb->y;
83 double tracea_product = 0;
85 for(
const auto &peak_a : trace_a)
87 tracea_product += peak_a.y * peak_a.y;
91 double traceb_product = 0;
93 for(
const auto &peak_a : trace_b)
95 traceb_product += peak_a.y * peak_a.y;
98 return (inner_intensity_product / (sqrt(tracea_product) * sqrt(traceb_product)));
double similarity(pappso::Trace trace_a, pappso::Trace trace_b) const
PrecisionPtr mp_precision
CosineSimilarity(PrecisionPtr precision)
FilterInterfaceSPtr msp_filterExclusion
pappso_double lower() const
pappso_double upper() const
A simple container of DataPoint instances.
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
const PrecisionBase * PrecisionPtr