![]() |
#2
rjsp2012-04-11 08:23
|
用unordered_map替换map:
typedef pair<int,int> RolePair;
typedef pair<RolePair,double> DisPair;
//function object
class DisSortCriterion
{
public:
bool operator()(const DisPair& left, const DisPair& right)const
{
if( left.second > right.second )
return true;
return false;
}
};
typedef multiset<DisPair,DisSortCriterion> Mapping;
typedef set<int> AgentSet;
typedef map<AgentSet,Mapping> HashMap;
请问各位大神怎么实现···就是hasher::hash function 怎么实现。。。希望具体点啊··初学者··请多指教···