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


C++ data_type类代码示例

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


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


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