1 #ifndef FWCore_Utilities_Algorithms_h 2 #define FWCore_Utilities_Algorithms_h 13 template <
typename ForwardSequence,
typename Func>
15 return std::for_each(
s.begin(),
s.end(),
f);
19 template <
typename ForwardSequence,
typename Func>
25 template <
typename ForwardSequence,
typename Datum>
26 inline typename ForwardSequence::const_iterator
find_in_all(ForwardSequence
const&
s, Datum
const&
d) {
30 template <
typename ForwardSequence,
typename Datum>
31 inline typename ForwardSequence::iterator
find_in_all(ForwardSequence&
s, Datum
const&
d) {
35 template <
typename ForwardSequence,
typename Datum>
41 template <
typename ForwardSequence,
typename Predicate>
42 inline typename ForwardSequence::const_iterator
find_if_in_all(ForwardSequence
const&
s, Predicate
const&
p) {
43 return std::find_if(
s.begin(),
s.end(),
p);
46 template <
typename ForwardSequence,
typename Predicate>
47 inline typename ForwardSequence::iterator
find_if_in_all(ForwardSequence&
s, Predicate
const&
p) {
48 return std::find_if(
s.begin(),
s.end(),
p);
51 template <
typename ForwardSequence,
typename Predicate>
53 return std::find_if(
s.begin(),
s.end(),
p) !=
s.end();
57 template <
typename ForwardSequence,
typename Datum>
62 template <
typename ForwardSequence,
typename Datum,
typename Predicate>
68 template <
typename ForwardSequence,
typename Datum>
69 inline typename ForwardSequence::const_iterator
lower_bound_all(ForwardSequence
const&
s, Datum
const&
d) {
73 template <
typename ForwardSequence,
typename Datum>
74 inline typename ForwardSequence::iterator
lower_bound_all(ForwardSequence&
s, Datum
const&
d) {
78 template <
typename ForwardSequence,
typename Datum,
typename Predicate>
79 inline typename ForwardSequence::const_iterator
lower_bound_all(ForwardSequence
const&
s,
85 template <
typename ForwardSequence,
typename Datum,
typename Predicate>
86 inline typename ForwardSequence::iterator
lower_bound_all(ForwardSequence&
s, Datum
const&
d, Predicate
p) {
91 template <
typename RandomAccessSequence>
96 template <
typename RandomAccessSequence,
typename Predicate>
97 inline void sort_all(RandomAccessSequence&
s, Predicate
p) {
102 template <
typename RandomAccessSequence>
104 std::stable_sort(
s.begin(),
s.end());
107 template <
typename RandomAccessSequence,
typename Predicate>
109 std::stable_sort(
s.begin(),
s.end(),
p);
ForwardSequence::const_iterator lower_bound_all(ForwardSequence const &s, Datum const &d)
wrappers for std::lower_bound
bool search_if_in_all(ForwardSequence const &s, Predicate const &p)
void stable_sort_all(RandomAccessSequence &s)
wrappers for std::stable_sort
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE int binary_search(const unsigned int *data, unsigned int search_val, unsigned int ndata)
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
ForwardSequence::const_iterator find_in_all(ForwardSequence const &s, Datum const &d)
wrappers for std::find
bool search_all(ForwardSequence const &s, Datum const &d)
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
bool binary_search_all(ForwardSequence const &s, Datum const &d)
wrappers for std::binary_search
ForwardSequence::const_iterator find_if_in_all(ForwardSequence const &s, Predicate const &p)
wrappers for std::find