35 #ifndef OPENMS_METADATA_METAINFOINTERFACEUTILS_H 36 #define OPENMS_METADATA_METAINFOINTERFACEUTILS_H 38 #include <OpenMS/OpenMSConfig.h> 74 template<
typename T_In,
typename T_Out>
75 static T_Out
findCommonMetaKeys(
const typename T_In::const_iterator& it_start,
const typename T_In::const_iterator& it_end,
float min_frequency)
78 min_frequency = std::min((
float)100.0, std::max((
float)0.0, min_frequency));
80 std::map<String, uint> counter;
81 typedef std::vector<String> KeysType;
83 for (
typename T_In::const_iterator it = it_start; it != it_end; ++it)
86 for (KeysType::const_iterator itk = keys.begin(); itk != keys.end(); ++itk)
92 const uint required_counts = uint(min_frequency / 100.0 * std::distance(it_start, it_end));
94 for (std::map<String, uint>::const_iterator it = counter.begin(); it != counter.end(); ++it)
96 if (it->second >= required_counts)
98 common_keys.insert(common_keys.end(), it->first);
114 #endif // OPENMS_METADATA_METAINFOINTERFACEUTILS_H
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47