CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
RoadMapSorting Class Reference

#include <RoadMapSorting.h>

Public Member Functions

bool operator() (const std::pair< std::vector< const Ring * >, std::vector< const Ring * > > &a, const std::pair< std::vector< const Ring * >, std::vector< const Ring * > > &b) const
 
 RoadMapSorting ()
 

Private Member Functions

unsigned int calculateRoadSeedIndex (const std::pair< std::vector< const Ring * >, std::vector< const Ring * > > &seed) const
 

Detailed Description

Definition at line 22 of file RoadMapSorting.h.

Constructor & Destructor Documentation

RoadMapSorting::RoadMapSorting ( )
inline

Definition at line 25 of file RoadMapSorting.h.

25 {}

Member Function Documentation

unsigned int RoadMapSorting::calculateRoadSeedIndex ( const std::pair< std::vector< const Ring * >, std::vector< const Ring * > > &  seed) const
private

Definition at line 19 of file RoadMapSorting.cc.

References funct::pow(), query::result, and relativeConstraints::ring.

Referenced by operator()().

19  {
20  //
21  // loop over seed rings and build index:
22  // 2 rings: ring1->getindex()*1000 + ring2->getindex()
23  //
24 
25  // return value
26  unsigned int result = 0;
27 
28  unsigned int counter = seed.first.size() + seed.second.size();
29  for ( std::vector<const Ring*>::const_iterator ring = seed.first.begin(),
30  ringEnd = seed.first.end();
31  ring != ringEnd;
32  ++ring ) {
33  result += (*ring)->getindex() * (unsigned int)std::pow((double)1000,(double)--counter);
34  }
35  for ( std::vector<const Ring*>::const_iterator ring = seed.second.begin(),
36  ringEnd = seed.second.end();
37  ring != ringEnd;
38  ++ring ) {
39  result += (*ring)->getindex() * (unsigned int)std::pow((double)1000,(double)--counter);
40  }
41 
42  return result;
43 }
tuple result
Definition: query.py:137
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
bool RoadMapSorting::operator() ( const std::pair< std::vector< const Ring * >, std::vector< const Ring * > > &  a,
const std::pair< std::vector< const Ring * >, std::vector< const Ring * > > &  b 
) const
inline

Definition at line 28 of file RoadMapSorting.h.

References a, b, and calculateRoadSeedIndex().

28  {
30  }
unsigned int calculateRoadSeedIndex(const std::pair< std::vector< const Ring * >, std::vector< const Ring * > > &seed) const
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121