CMS 3D CMS Logo

sorting_modules.cc
Go to the documentation of this file.
1 
4 #include <iostream>
5 
6 namespace btagbtvdeep{
7 
8 std::vector<std::size_t> invertSortingVector(const std::vector<SortingClass<std::size_t> > & in){
9  std::size_t max=0;
10  for(const auto& s:in){
11  if(s.get()>max)max=s.get();
12  }
13 
14  std::vector<std::size_t> out(max+1,0);
15  for(std::size_t i=0;i<in.size();i++){
16  out.at(in[i].get())=i;
17  }
18 
19  return out;
20 }
21 
22 }
std::vector< std::size_t > invertSortingVector(const std::vector< SortingClass< std::size_t > > &in)