当前位置: 首页>>代码示例>>C++>>正文


C++ HT::end方法代码示例

本文整理汇总了C++中HT::end方法的典型用法代码示例。如果您正苦于以下问题:C++ HT::end方法的具体用法?C++ HT::end怎么用?C++ HT::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HT的用法示例。


在下文中一共展示了HT::end方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mapOr

void mapOr(const HT& leftExp, const HT& rightExp, HT& result)
{
	result.clear();
	vector<int> vl(leftExp.size()), vr(rightExp.size()), vm;
	transform(leftExp.begin(), leftExp.end(), vl.begin(), keySel);   
	transform(rightExp.begin(), rightExp.end(), vr.begin(), keySel); 
	sort(vl.begin(), vl.end());
	sort(vr.begin(), vr.end());
	set_union(vl.cbegin(), vl.cend(), vr.cbegin(), vr.cend(), inserter(vm, vm.begin()));
	int i=0;
	for (auto it = vm.cbegin(); it != vm.cend(); ++it, ++i)
		result.insert(HT::value_type((*it), i));
}
开发者ID:Komdosh,项目名称:ELTECHLabWorks,代码行数:13,代码来源:Source.cpp

示例2:

inline
typename HT::size_type
get_keys(HT& ht, typename HT::key_type* keys)
{
  typename HT::size_type num_keys = 0;

  typename HT::size_type stream_id = 0;
  typename HT::size_type num_streams = 1;

  #pragma mta use 100 streams
  #pragma mta for all streams stream_id of num_streams
  {
    typename HT::thread_iterator begin = ht.begin(stream_id, num_streams);
    typename HT::thread_iterator end = ht.end(stream_id, num_streams);

    // Claim a block of indices for the occupied entries in the stream's
    // region.
    typename HT::size_type start_index = mt_incr(num_keys, end - begin);

    // Get the keys from this stream's region.
    for ( ; begin != end; ++begin)
    {
      keys[start_index] = begin->first;
      ++start_index;
    }
  }

  return num_keys;
}
开发者ID:Auguraculums,项目名称:graphdb-testing,代码行数:29,代码来源:hash_defs.hpp

示例3: assign_contiguous_ids

inline
void assign_contiguous_ids(HT& ht, typename HT::size_type starting_value = 0)
{
  typename HT::size_type stream_id = 0;
  typename HT::size_type num_streams = 1;

  #pragma mta use 75 streams
  #pragma mta for all streams stream_id of num_streams
  {
    typename HT::thread_iterator begin_iter = ht.begin(stream_id, num_streams);
    typename HT::thread_iterator end_iter = ht.end(stream_id, num_streams);

    // Claim a block of indices for the occupied entries in the stream's
    // region.
    typename HT::size_type start_index = mt_incr(starting_value,
                                                 end_iter - begin_iter);

    // Assign contiguous ids to the occupied entries in this stream's
    // region.
    for ( ; begin_iter != end_iter; ++begin_iter)
    {
      begin_iter->second = start_index;
      ++start_index;
    }
  }
}
开发者ID:Auguraculums,项目名称:graphdb-testing,代码行数:26,代码来源:hash_defs.hpp

示例4: debug_buckets

void debug_buckets(HT const& hashtable) {
    std::multimap<size_t, MyClass const*> debug_map;
    std::transform(hashtable.begin(), hashtable.end(), 
            std::inserter(debug_map, debug_map.end()), 
            [&](MyClass const& mc) { return std::make_pair(hashtable.bucket(mc), &mc); }
        );

    std::cout << "\nDebugging buckets of hashtable\n";
    for (auto& entry : debug_map)
        std::cout << "Debug bucket: " << entry.first << " -> " << *entry.second << "\n";
}
开发者ID:CCJY,项目名称:coliru,代码行数:11,代码来源:main.cpp

示例5: erase

//***********************************************************************
void erase(HT& T, int start, int finish)
{
	if (!T.empty()) {
		int s = T.size();
		for (int i = start; i < s && i <= finish; ++i) {
			for (HT::iterator it = T.begin(); it != T.end(); ++it)
				if (it->second == i) {
					T.erase(it);
					break;
				}
		}
		for (auto &temp : T)
			if (temp.second >= finish)
				temp.second = temp.second - (finish - start) - 1;
	}
}
开发者ID:Komdosh,项目名称:ELTECHLabWorks,代码行数:17,代码来源:Source.cpp

示例6: end

 /// Get a const iterator to the end of the table
 const_iterator end()   const { return m_ht.end();   }
开发者ID:msupernaw,项目名称:AutoDiff_Paper,代码行数:2,代码来源:cache_set.hpp


注:本文中的HT::end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。