• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ data_type类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中data_type的典型用法代码示例。如果您正苦于以下问题:C++ data_type类的具体用法?C++ data_type怎么用?C++ data_type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: FrobeniusLossWeighted

 FrobeniusLossWeighted(data_type const& data)
     : 	n_samples(data.get_A().n_samples),
        n_responses(data.get_B().n_groups),
        Y(data.get_B().response),
        W(data.get_C().data),
        lp(n_samples, n_responses) {
 }
开发者ID:rforge,项目名称:msgl,代码行数:7,代码来源:frobenius_norm_weighted.hpp


示例2: to_string

std::string document_info_context_to<DocumentInfo>::
	to_string(const data_type& from) const
{
	std::stringstream stream;
	on_stream_setup(stream);
	stream << from->get_owner_id() << ' ' << from->get_id();
	return stream.str();
}
开发者ID:gobby,项目名称:obby,代码行数:8,代码来源:document_info.hpp


示例3: save_data

void session_interface::save_data(data_type const &data,std::string &s)
{
	s.clear();
	data_type::const_iterator p;
	for(p=data.begin();p!=data.end();++p) {
		packed header(p->first.size(),p->second.exposed,p->second.value.size());
		char *ptr=(char *)&header;
		s.append(ptr,ptr+sizeof(header));
		s.append(p->first.begin(),p->first.end());
		s.append(p->second.value.begin(),p->second.value.end());
	}
}
开发者ID:klupek,项目名称:cppcms,代码行数:12,代码来源:session_interface.cpp


示例4:

void task4_5::solution::start(const data_type& data) const
{
	if (data.size()==0)
	{
		min=max=0;
		return;
	}
	boost::thread_group t;
	for (int i=0;i<data.size();i++)
		t.create_thread( boost::bind(&task4_5::solution::solve,this,boost::ref(data[i])));
	t.join_all();
}
开发者ID:dmitrymatveev-work,项目名称:cpp_craft_0314,代码行数:12,代码来源:solution.cpp


示例5: data_write

 void datastructure::data_write(std::string const& symbolic_name
     , std::size_t num_instances, std::size_t my_cardinality
     , data_type client_data)
 {
     // get_config(gid_component);  implement?
     //distributed::config_comp config_data = get_config();
     if(config_data_.my_cardinality_ != my_cardinality)
         config_data_.my_cardinality_ = my_cardinality;
     if(data_.size() != client_data.size())
         data_.resize(client_data.size());
     data_ = client_data;
     for (data_type::iterator itr = data_.begin(); itr != data_.end(); ++itr)
         std::cout << "Data:" << *itr << std::endl;
     std::cout<< "Write Data Part for component:" << my_cardinality << std::endl;
 }
开发者ID:Stevejohntest,项目名称:hpx,代码行数:15,代码来源:datastructure.cpp


示例6:

task4_5::solution::solution( const data_type& data )
{
	if(!data.empty())
	{
		m_max = data[0][0];
		m_min = data[0][0];
		m_current_vector = data.size();
		calculate_result(data);
	}
	else
	{
		m_max = 0;
		m_min = 0;
	}
}
开发者ID:Aljaksandr,项目名称:cpp_craft_1013,代码行数:15,代码来源:solution.cpp


示例7: put

			void put(data_type const & E, std::pair<uint64_t,uint64_t> const & P)
			{
				libmaus2::util::NumberSerialisation::serialiseNumber(stream,P.first);
				libmaus2::util::NumberSerialisation::serialiseNumber(stream,P.second);
				E.serialise(stream);				
				ic += 1;
			}
开发者ID:jameslz,项目名称:libmaus2,代码行数:7,代码来源:ExternalMemoryIndexGenerator.hpp


示例8: get_value

        T get_value(Key const& key, bool erase)
        {
            typename data_type::iterator it = partition_unordered_map_.find(key);
            if (it == partition_unordered_map_.end())
            {
                HPX_THROW_EXCEPTION(bad_parameter,
                    "partition_unordered_map::get_value",
                    "unable to find requested key in this partition of the "
                    "unordered_map");
            }

            if (!erase)
                return it->second;

            erase_on_exit t(partition_unordered_map_, it);
            return it->second;
        }
开发者ID:dailypips,项目名称:hpx,代码行数:17,代码来源:partition_unordered_map_component.hpp


示例9:

task4_5::solution::solution( const data_type& data )
{
	
	min_of_min = INT32_MAX;
	max_of_max = INT32_MIN;
	curr_vector = data.begin();
	end_of_data = data.end();
	data_size = data.size();
	
	for( size_t i = 0; i < threads_count; i++ )
	{
		threads.create_thread( boost::bind( &task4_5::solution::solve, this  ) );
	}

	threads.join_all();

}
开发者ID:Eldar322,项目名称:cpp_craft_0314,代码行数:17,代码来源:solution.cpp


示例10: create_thr

void task4_5:: solution:: create_thr( const data_type& data) 
{
	boost::thread_group tg;
	for( size_t i = 1; i < data.size(); ++i )
		tg.create_thread( boost::bind( &solution::process, this , boost::ref(data[i]) ) );

	tg.join_all();
	
}
开发者ID:Gedeon-by,项目名称:cpp_craft_0314,代码行数:9,代码来源:solution.cpp


示例11:

task4_5::solution::solution( const data_type& data )
{
	if(data.size() == 0)
	{
		max_=min_=0;
		return;
	}
	min_ = std::numeric_limits< int >().max();
	max_ = std::numeric_limits< int >().min();
	create_thr( data);

}
开发者ID:Gedeon-by,项目名称:cpp_craft_0314,代码行数:12,代码来源:solution.cpp


示例12: min

task4_5::solution::solution(const data_type& data) : min(std::numeric_limits< int >().max()), max(std::numeric_limits< int >().min())
{
	boost::thread_group threads;

	if (!data.empty())
	{
		for (size_t i = 0; i < data.size(); i++)
		{
			threads.create_thread(boost::bind(&task4_5::solution::search_min, this, boost::ref(data[i])));
			threads.create_thread(boost::bind(&task4_5::solution::search_max, this, boost::ref(data[i])));
		}

		threads.join_all();

	}
	else
	{
		min = 0;
		max = 0;
	}
}
开发者ID:Gedeon-by,项目名称:cpp_craft_0314,代码行数:21,代码来源:solution.cpp


示例13: get_values

        /// Return the element at the position \a pos in the partition_unordered_map
        /// container.
        ///
        /// \param pos Positions of the elements in the partition_unordered_map
        ///
        /// \return Return the values of the elements at position represented
        ///         by \a pos.
        ///
        std::vector<T> get_values(std::vector<Key> const& keys)
        {
            std::vector<T> result;
            result.reserve(keys.size());

            for (std::size_t i = 0; i != keys.size(); ++i)
            {
                typename data_type::iterator it =
                    partition_unordered_map_.find(keys[i]);
                if (it == partition_unordered_map_.end())
                {
                    HPX_THROW_EXCEPTION(bad_parameter,
                        "partition_unordered_map::get_values",
                        "unable to find requested key in this partition of the "
                        "unordered_map");
                    break;
                }
                result.push_back(it->second);
            }
            return result;
        }
开发者ID:dailypips,项目名称:hpx,代码行数:29,代码来源:partition_unordered_map_component.hpp


示例14: min_

task4_5::solution::solution(const data_type& data) : min_(0), max_(0)
{
	std::vector<std::future<std::pair<int, int>>> futures;
	if (data.empty())
	{
		min_ = 0;
		max_ = 0;
	}
	else
	{
		min_ = std::numeric_limits<int>().max();
		max_ = std::numeric_limits<int>().min();
	}
	for (size_t i = 0; i < data.size(); ++i)
		futures.push_back(std::async(&VectMinMaxFindingFunc, std::cref(data[i])));
	for (auto & ftr : futures)
	{
		const auto ftrAns = ftr.get();
		min_ = std::min(min_, ftrAns.first);
		max_ = std::max(max_, ftrAns.second);
	}
}
开发者ID:Eldar322,项目名称:cpp_craft_0314,代码行数:22,代码来源:solution.cpp


示例15: min_

task4_5::solution::solution( const data_type& data ) : min_(0), max_(0)
{		
	if (!data.empty())
	{
		data_ = data;

		min_ = std::numeric_limits< int >().max();
		max_ = std::numeric_limits< int >().min();

		cur_it_ = data_.begin();

		boost::thread_group thread_group;
		for(int i = 0; i < 4; ++i)
		{
			thread_group.create_thread(boost::bind(&solution::thread_fun, this));
		}

		thread_group.join_all();
	}
}
开发者ID:Aljaksandr,项目名称:cpp_craft_1013,代码行数:20,代码来源:solution.cpp


示例16: load_data

void session_interface::load_data(data_type &data,std::string const &s)
{
	data.clear();
	char const *begin=s.data(),*end=begin+s.size();
	while(begin < end) {
		packed p(begin,end);
		begin +=sizeof(p);
		if(end - begin >= int(p.key_size + p.data_size)) {
			string key(begin,begin+p.key_size);
			begin+=p.key_size;
			string val(begin,begin+p.data_size);
			begin+=p.data_size;
			entry &ent=data[key];
			ent.exposed = p.exposed;
			ent.value.swap(val);
		}
		else {
			throw cppcms_error("sessions::format violation data");
		}

	}

}
开发者ID:klupek,项目名称:cppcms,代码行数:23,代码来源:session_interface.cpp


示例17: onHtml

void Ecppll::onHtml(const std::string& html)
{
  if (inLang)
  {
    std::ostringstream msg;
    std::transform(
      html.begin(),
      html.end(),
      std::ostream_iterator<const char*>(msg),
      tnt::stringescaper(false));

    bool found = true;

    if (next == replacetokens.end()
     || next->first != msg.str())
    {
      // nächster Token passt nicht (oder kommt keiner mehr) - suche, ob wir ihn
      // noch finden
      replacetokens_type::const_iterator it;
      for (it = next;
           it != replacetokens.end() && it->first != msg.str();
           ++it)
        ;

      if (it == replacetokens.end())
      {
        std::cerr << "warning: replacement-text \"" << html << "\" not found ("
          << data.size() << ')'
          << std::endl;
        warn();
        found = false;
      }
      else
      {
        for (replacetokens_type::const_iterator it2 = next;
             it2 != it; ++it2)
          std::cerr << "warning: replacement-text \"" << it2->first << "\" skipped ("
            << data.size() << ')'
            << std::endl;
        next = it;
        warn();
      }
    }

    if (found)
    {
      data.push_back(next->second);
      ++next;
    }
    else
      data.push_back(html);
  }
  else
  {
    data.push_back(html);
  }
}
开发者ID:913862627,项目名称:tntnet,代码行数:57,代码来源:ecppll.cpp


示例18: reserve

 // Обязателен вызов перед формированием ответа адвайсом пользователя
 void reserve(size_t s) 
 {
   /*if ( _data.size() < s + 128 )
   {*/
     _data.resize(s + 16635, 0);
     char* beg = &(_data[0]);
     char* end = beg + _data.size();
     _outgoing = amj::json_pack( beg, end );
   // }
 }
开发者ID:ApelSYN,项目名称:leveldb-daemon,代码行数:11,代码来源:ad_outgoing_object.hpp


示例19: decrement_use_count

 void decrement_use_count()
 {
     if (0 == --ref_count_)
     {
         data_.second()(this);
     }
 }
开发者ID:BackupTheBerlios,项目名称:breeze-svn,代码行数:7,代码来源:shared_proxy.hpp


示例20: set_values

        /// Copy the value of \a val for the elements at positions \a pos in
        /// the partition_unordered_map container.
        ///
        /// \param pos   Positions of the elements in the partition_unordered_map
        ///
        /// \param val   The value to be copied
        ///
        void set_values(std::vector<Key> const& keys,
            std::vector<T> const& val)
        {
            HPX_ASSERT(keys.size() == val.size());
            HPX_ASSERT(keys.size() <= partition_unordered_map_.size());

            for (std::size_t i = 0; i != keys.size(); ++i)
                partition_unordered_map_[keys[i]] = val[i];
        }
开发者ID:dailypips,项目名称:hpx,代码行数:16,代码来源:partition_unordered_map_component.hpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ database类代码示例发布时间:2022-05-31
下一篇:
C++ data_t类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap