本文整理汇总了C++中PeakSpectrum::front方法的典型用法代码示例。如果您正苦于以下问题:C++ PeakSpectrum::front方法的具体用法?C++ PeakSpectrum::front怎么用?C++ PeakSpectrum::front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PeakSpectrum
的用法示例。
在下文中一共展示了PeakSpectrum::front方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: window_upper_bound
std::vector<PeakSpectrum> AScore::peakPickingPerWindowsInSpectrum_(PeakSpectrum &real_spectrum) const
{
vector<PeakSpectrum> windows_top10;
double spect_lower_bound = floor(real_spectrum.front().getMZ() / 100) * 100;
double spect_upper_bound = ceil(real_spectrum.back().getMZ() / 100) * 100;
Size number_of_windows = static_cast<Size>(ceil((spect_upper_bound - spect_lower_bound) / 100));
windows_top10.resize(number_of_windows);
PeakSpectrum::Iterator it_current_peak = real_spectrum.begin();
Size window_upper_bound(spect_lower_bound + 100);
for (Size current_window = 0; current_window < number_of_windows; ++current_window)
{
PeakSpectrum real_window;
while (((*it_current_peak).getMZ() <= window_upper_bound) && (it_current_peak < real_spectrum.end()))
{
real_window.push_back(*it_current_peak);
++it_current_peak;
}
real_window.sortByIntensity(true);
for (Size i = 0; (i < 10) & (i < real_window.size()); ++i)
{
windows_top10[current_window].push_back(real_window[i]);
}
window_upper_bound += 100;
}
return windows_top10;
}