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


C++ array::begin方法代码示例

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


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

示例1: handle_receive

        void handle_receive(const boost::system::error_code& e,
                std::size_t bytes_transferred) {
            std::cout << "received message: '" << std::string(recv_buffer_.begin(), recv_buffer_.begin() + bytes_transferred) << "'\n";

            // TRYING TO CHECK FOR TRUNCATION, NOT WORKING
            // std::cout << e << std::endl;
            // if (!e || e == boost::asio::error::message_size) {
            //     std::cout << "wat?\n";
            // }

            // restart receive
            start_receive();
        }
开发者ID:ottolote,项目名称:TTK4145,代码行数:13,代码来源:thread_com.cpp

示例2: create

    //--------------------------------------------------------------------------
    //! Construct with signed distance function values of the vertices
    void create( const boost::array<double,numElementNodes>& signedDistances )
    {
        // Minimal value of signed distances
        const double distMin = *(std::min_element( signedDistances.begin(),
                                                   signedDistances.end() ) );
        // Maximal value of signed distances
        const double distMax = *(std::max_element( signedDistances.begin(),
                                                   signedDistances.end() ) );

        // Change of signs implies a cut cell
        if ( (distMin * distMax) <= 0. ) {
            isCut_     = true;
            isInside_  = false;
            isOutside_ = false;

            // get the vertices of the shape
            boost::array<VecDim,LinearLagrange::numFun> vertexCoordinates;
            LinearLagrange::supportPoints( vertexCoordinates );

            boost::array<unsigned,LinearLagrange::numFun> vertexIndices;
            
            // fill nodes with the vertices of this shape
            for ( unsigned v = 0; v < vertexCoordinates.size(); v++ ) {
                nodes_.push_back( vertexCoordinates[v] );
                vertexIndices[v] = v;
            }

            
            // create the internal structure of the cut cell
            std::map<base::cut::Edge,unsigned> uniqueNodes;
            base::cut::MarchingProxy<shape,geomDegree>::apply( signedDistances,
                                                               vertexIndices,
                                                               nodes_,
                                                               uniqueNodes,
                                                               surface_,
                                                               volumeIn_, volumeOut_,
                                                               false );

        }
        else {
            isCut_ = false;
            // decide location of cell which is not cut
            if ( distMax < 0. ) { isInside_ = false; isOutside_ = true;  }
            else                { isInside_ = true;  isOutside_ = false; }
        }

    }
开发者ID:thrueberg,项目名称:inSilico,代码行数:49,代码来源:Cell.hpp

示例3: setup_covariance

	void setup_covariance(boost::array<double, 9> &cov, double stdev) {
		std::fill(cov.begin(), cov.end(), 0.0);
		if (stdev == 0.0)
			cov[0] = -1.0;
		else {
			cov[0+0] = cov[3+1] = cov[6+2] = std::pow(stdev, 2);
		}
	}
开发者ID:Alieff,项目名称:trui-bot-prj,代码行数:8,代码来源:imu_pub.cpp

示例4: get_padded_image

/** @brief Get a view of the main data array, including padding  */
Tracker::array_type_r Tracker::get_padded_image(const boost::array<size_t,3>& ordering)
{
	boost::array<size_t,3> paddedExt;
	for(size_t d=0;d<3;++d)
		paddedExt[ordering[d]] = (d==2) ? 2*FFTmask.shape()[d] : centersMap.shape()[d];

	bool ascending[] = {true,true,true};
	return array_type_r(data, paddedExt, boost::general_storage_order<3>(ordering.begin(),ascending));
}
开发者ID:MathieuLeocmach,项目名称:colloids,代码行数:10,代码来源:tracker.cpp

示例5: HandleReceive

void DiscoveryServer::HandleReceive(const boost::system::error_code& error) {
    if (!error &&
        std::string(m_recv_buffer.begin(), m_recv_buffer.end()) == DISCOVERY_QUESTION) {
        m_socket.send_to(
            boost::asio::buffer(DISCOVERY_ANSWER + boost::asio::ip::host_name()),
            m_remote_endpoint);
    }
    Listen();
}
开发者ID:Ablu,项目名称:freeorion,代码行数:9,代码来源:ServerNetworking.cpp

示例6: Stepper

BOOST_AUTO_TEST_CASE_TEMPLATE( copy_stepper_iterator , Stepper , dummy_steppers )
{
    typedef times_iterator< Stepper , empty_system , state_type , time_iterator_type > iterator_type;
    state_type x = {{ 1.0 }};
    iterator_type iter1 = iterator_type( Stepper() , empty_system() , x , times.begin() , times.end() , 0.1 );
    iterator_type iter2 = iter1;
    BOOST_CHECK_EQUAL( &(*iter1) , &(*iter2) );
    BOOST_CHECK_EQUAL( &(*iter1) , &x );
    BOOST_CHECK( iter1.same( iter2 ) );
}
开发者ID:Adikteev,项目名称:rtbkit-deps,代码行数:10,代码来源:times_iterator.cpp

示例7:

BOOST_AUTO_TEST_CASE_TEMPLATE( stepper_range , Stepper , dummy_steppers )
{
    std::cout << "range" << std::endl;
    Stepper stepper;
    empty_system system;
    state_type x = {{ 1.0 }};

    boost::for_each( make_times_range( stepper , boost::ref( system ) , x , times.begin() , times.end() , 0.1 ) ,
                     dummy_observer() );

    BOOST_CHECK_CLOSE( x[0] , 1.75 , 1.0e-13 );
}
开发者ID:Adikteev,项目名称:rtbkit-deps,代码行数:12,代码来源:times_iterator.cpp

示例8:

		~FiberControl(){
			AUTO(it, g_stack_pool.begin());
			for(;;){
				if(it == g_stack_pool.end()){
					stack.reset();
					break;
				}
				if(!*it){
					stack.swap(*it);
					break;
				}
				++it;
			}
		}
开发者ID:chenbk85,项目名称:poseidon,代码行数:14,代码来源:job_dispatcher.cpp

示例9: FiberControl

		explicit FiberControl(Initializer)
			: state(FS_READY)
		{
			AUTO(it, g_stack_pool.begin());
			for(;;){
				if(it == g_stack_pool.end()){
					stack.reset(new StackStorage);
					break;
				}
				if(*it){
					stack.swap(*it);
					break;
				}
				++it;
			}
		}
开发者ID:chenbk85,项目名称:poseidon,代码行数:16,代码来源:job_dispatcher.cpp

示例10: thx

    sAudioReceiver(boost::asio::io_service& io_service, sAudioBuffer* audiobuf, char* host, int port) : audiobuf(audiobuf), socket(io_service), ping_interval(boost::posix_time::seconds(1)) {
        printf("Creating sAudioReceiver on %s:%d\n", host, port);
        socket.open(boost::asio::ip::udp::v4());

        receiver_endpoint = boost::asio::ip::udp::endpoint(boost::asio::ip::address::from_string(host), port);


        std::string thx("ihazo");
        std::copy(thx.begin(), thx.end(), send_arr.begin());
        printf("Created sAudioReceiver\n");
        send_request();
        start_receive();
        printf("Sent request\n");

        ping_timer = new boost::asio::deadline_timer(socket.get_io_service(), ping_interval);
        start_timer();
    }
开发者ID:Szperak,项目名称:sAudio-receiver,代码行数:17,代码来源:client.cpp


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