OpenMS
3.7.0
Main Page
Related Pages
Topics
Namespaces
Concepts
Classes
Files
File List
File Members
Loading...
Searching...
No Matches
PeakContainerSort.h
Go to the documentation of this file.
1
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2
// SPDX-License-Identifier: BSD-3-Clause
3
//
4
// --------------------------------------------------------------------------
5
// $Maintainer: Timo Sachsenberg $
6
// $Authors: Timo Sachsenberg $
7
// --------------------------------------------------------------------------
8
9
#pragma once
10
11
#include <
OpenMS/CONCEPT/Types.h
>
12
13
#include <algorithm>
14
#include <numeric>
15
#include <vector>
16
17
namespace
OpenMS
18
{
19
namespace
Internal
20
{
28
template
<
class
Predicate>
29
std::vector<Size>
stableSortedIndices
(
Size
n,
const
Predicate& lambda)
30
{
31
std::vector<Size> indices(n);
32
std::iota(indices.begin(), indices.end(), 0);
33
std::stable_sort(indices.begin(), indices.end(), lambda);
34
return
indices;
35
}
36
}
// namespace Internal
37
}
// namespace OpenMS
Types.h
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition
Types.h:97
OpenMS::Internal::stableSortedIndices
std::vector< Size > stableSortedIndices(Size n, const Predicate &lambda)
Implementation detail of the sort(Predicate) members of MSSpectrum, MSChromatogram and Mobilogram.
Definition
PeakContainerSort.h:29
OpenMS
Main OpenMS namespace.
Definition
openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
OpenMS
KERNEL
PeakContainerSort.h
Generated on Sat Nov 14 2026 01:19:54 for OpenMS by
1.9.8