#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 |
Definition at line 22 of file RoadMapSorting.h.
RoadMapSorting::RoadMapSorting | ( | ) | [inline] |
Definition at line 25 of file RoadMapSorting.h.
{}
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 cmsDriverOptions::counter, funct::pow(), query::result, and relativeConstraints::ring.
Referenced by operator()().
{ // // loop over seed rings and build index: // 2 rings: ring1->getindex()*1000 + ring2->getindex() // // return value unsigned int result = 0; unsigned int counter = seed.first.size() + seed.second.size(); for ( std::vector<const Ring*>::const_iterator ring = seed.first.begin(), ringEnd = seed.first.end(); ring != ringEnd; ++ring ) { result += (*ring)->getindex() * (unsigned int)std::pow((double)1000,(double)--counter); } for ( std::vector<const Ring*>::const_iterator ring = seed.second.begin(), ringEnd = seed.second.end(); ring != ringEnd; ++ring ) { result += (*ring)->getindex() * (unsigned int)std::pow((double)1000,(double)--counter); } return result; }
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().
{ return calculateRoadSeedIndex(a) < calculateRoadSeedIndex(b); }