hash算法

camel_lzd 2012-03-22 08:20:03
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;

以上是我定义的map容器,但是我想把map容器转换成unordered_map,我想用合适的hash算法实现它,大神们,给点意见啊···新手不会呀···
...全文
111 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Kaile 2012-03-26
  • 打赏
  • 举报
回复
www.boost.org
camel_lzd 2012-03-26
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 kaile 的回复:]

查看一下boost::hash函数的源码
[/Quote]
能推荐一个网址吗???
Kaile 2012-03-24
  • 打赏
  • 举报
回复
查看一下boost::hash函数的源码
hen_hao_ji 2012-03-24
  • 打赏
  • 举报
回复
学习了,原来还有 unordered_map这个东西,以前都没听说。
camel_lzd 2012-03-23
  • 打赏
  • 举报
回复
????难道没有人回复吗??大神们都去哪里了呢??
camel_lzd 2012-03-22
  • 打赏
  • 举报
回复
注:我想用std::tr1::命名空间下的unordered_map。

64,281

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧