CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
evf::iDie::sorted_indices Struct Reference

Public Member Functions

int ii (size_t ind)
 
bool operator() (const size_t a, const size_t b) const
 
int operator[] (size_t ind) const
 
 sorted_indices (const std::vector< int > &arr)
 

Public Attributes

const std::vector< int > & arr_
 
std::vector< int > ind_
 

Detailed Description

Definition at line 144 of file iDie.h.

Constructor & Destructor Documentation

evf::iDie::sorted_indices::sorted_indices ( const std::vector< int > &  arr)
inline

Definition at line 145 of file iDie.h.

References arr_, i, ind_, and python.multivaluedict::sort().

145  : arr_(arr)
146  {
147  ind_.resize(arr_.size(),0);
148  unsigned int i = 0;
149  while(i<ind_.size()) {ind_[i] = i; i++;}
150  std::sort(ind_.rbegin(),ind_.rend(),*this);
151  }
int i
Definition: DBlmapReader.cc:9
std::vector< int > ind_
Definition: iDie.h:159
const std::vector< int > & arr_
Definition: iDie.h:160

Member Function Documentation

int evf::iDie::sorted_indices::ii ( size_t  ind)
inline

Definition at line 158 of file iDie.h.

References ind_.

Referenced by evf::iDie::iChokeMiniInterface().

158 {return ind_[ind];}
std::vector< int > ind_
Definition: iDie.h:159
bool evf::iDie::sorted_indices::operator() ( const size_t  a,
const size_t  b 
) const
inline

Definition at line 154 of file iDie.h.

References a, arr_, and b.

155  {
156  return arr_[a]<arr_[b];
157  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
const std::vector< int > & arr_
Definition: iDie.h:160
int evf::iDie::sorted_indices::operator[] ( size_t  ind) const
inline

Definition at line 152 of file iDie.h.

References arr_, and ind_.

152 {return arr_[ind_[ind]];}
std::vector< int > ind_
Definition: iDie.h:159
const std::vector< int > & arr_
Definition: iDie.h:160

Member Data Documentation

const std::vector<int>& evf::iDie::sorted_indices::arr_

Definition at line 160 of file iDie.h.

Referenced by operator()(), operator[](), and sorted_indices().

std::vector<int> evf::iDie::sorted_indices::ind_

Definition at line 159 of file iDie.h.

Referenced by ii(), operator[](), and sorted_indices().