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


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

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


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

示例1: operator

 void operator()( const tbb::blocked_range<size_t>& r) const
 {
     for( std::size_t i = r.begin(), e = r.end(); i != e; ++i)
         std::for_each( view_.row_begin(i), view_.row_end(i), f_);
 }
开发者ID:JohanAberg,项目名称:Ramen,代码行数:5,代码来源:tbb_for_each.hpp

示例2: operator

 void operator()( const tbb::blocked_range<int> &r ) const {
     for (int i = r.begin(); i != r.end(); ++i) {
         sums.local() +=  1 ;
     }
 }
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:5,代码来源:test_combinable.cpp

示例3: operator

 void operator()(const tbb::blocked_range<size_t>& r) {
    pReduce_->operator()(r.begin(), r.end());
 }
开发者ID:jjallaire,项目名称:TBB,代码行数:3,代码来源:parallel-tbb.cpp

示例4: operator

 void operator()( const tbb::blocked_range<size_t>& r ) const 
 {
     int begin = (int)r.begin();            //! capture lower range number for this chunk
     int end = (int)r.end();                //! capture upper range number for this chunk
     UpdateState(m_source, m_dest, begin, end);
 }
开发者ID:Chalenko,项目名称:PCM,代码行数:6,代码来源:Evolution.cpp

示例5: operator

 void operator()( const tbb::blocked_range<int>& range ) const {
     Universe::Rectangle area(0, range.begin(), u_.UniverseWidth-1, range.size());
     u_.UpdateStress(area);
 }
开发者ID:ElaraFX,项目名称:tbb,代码行数:4,代码来源:universe.cpp

示例6:

void
SoftBody::MeshProcessor::operator ()(const tbb::blocked_range<uint32_t> r) const
{
    mBody.updateMesh(r.begin(), r.end());
}
开发者ID:undernones,项目名称:particles,代码行数:5,代码来源:SoftBody.cpp

示例7: operator

	void ParallelParticleSystemUpdate::operator() (const tbb::blocked_range<int>& r) const
	{
		float currentTime = eagle.getTimer()->getPassedTimeSeconds();

		float frameTime = *m_particleEmitter->m_frameTime;
		float frictionEffect = 1.0f - (1.0f - m_particleEmitter->m_frictionFactor) * (frameTime);
		float aliveParticleAlphaDecrement = m_particleEmitter->m_alphaDecrement * (frameTime);
		float deadParticleAlphaDecrement = (m_particleEmitter->m_alphaDecrement + m_particleEmitter->m_removalAlphaDecrement) * (frameTime);

		for(int i = r.begin(); i != r.end(); ++i)
		{
			if(!m_particleList[i].enabled)
			{
				continue;
			}

			m_particleEmitter->aliveParticleCount++;

			//float lv = sqrt(m_particleList[i].m_velocityX * m_particleList[i].m_velocityX + m_particleList[i].m_velocityY * m_particleList[i].m_velocityY);
			/*float theta = atan2(m_particleList[i].m_velocityY, m_particleList[i].m_velocityX) + ((float)(math.random(0, 2) - 1)) * particleEmitter->m_noise;
			m_particleList[i].m_velocityX = cos(theta) * lv;
			m_particleList[i].m_velocityY = sin(theta) * lv;*/

			m_particleList[i].velocityX += ((float)(math.random(0, 2) - 1)) * m_particleEmitter->m_noise;
			m_particleList[i].velocityY += ((float)(math.random(0, 2) - 1)) * m_particleEmitter->m_noise;

			m_particleList[i].x += m_particleList[i].velocityX * (frameTime);
			m_particleList[i].y += m_particleList[i].velocityY * (frameTime);

			m_particleList[i].velocityX *= frictionEffect;
			m_particleList[i].velocityY *= frictionEffect;
			//m_particleList[i].z += m_particleList[i].speedZ;

			m_particleList[i].velocityX += m_particleList[i].accelerationX * (frameTime);
			m_particleList[i].velocityY += m_particleList[i].accelerationY * (frameTime);

			//colors[i].a = math.abs(colors[i].a);

			if(m_particleList[i].quickFade)
			{
				m_particleList[i].color.a -= deadParticleAlphaDecrement;
			}
			else
			{
				m_particleList[i].color.a -= aliveParticleAlphaDecrement;
			}

			//if((m_particleList[i].quickFade && m_particleList[i].color.a < 10) || m_particleList[i].color.a < 10)

			if(m_particleList[i].color.a < EAGLE_PARTICLE_SYSTEM_MINIMUM_PARTICLE_ALPHA)
			{
				m_particleList[i].enabled = 0;
				m_particleList[i].color.a = 0;

				m_particleEmitter->m_inactiveParticleListTopIndex++;

				m_particleEmitter->m_inactiveParticleList[m_particleEmitter->m_inactiveParticleListTopIndex] = i;

				continue;
			}
			else if(currentTime - m_particleList[i].creationTime > m_particleEmitter->m_lifespan)
			{
				m_particleList[i].quickFade = 1;

				continue;
			}
			else
			{
				int deltaX = m_particleList[i].x - m_particleEmitter->m_position.x;
				int deltaY = m_particleList[i].y - m_particleEmitter->m_position.y;

				if((deltaX) * (deltaX) + (deltaY) * (deltaY) > m_particleEmitter->m_maximumDistance * m_particleEmitter->m_maximumDistance)
				{
					m_particleList[i].quickFade = 1;

					continue;
				}
			}
		}
	}
开发者ID:0xTHR34T,项目名称:EagleEngine,代码行数:80,代码来源:ParticleSystem.cpp

示例8: operator

 void operator()(const tbb::blocked_range<size_t>& r) const {
   for (size_t i=r.begin();i!=r.end();++i)
     _tasks[i]();
 }
开发者ID:conda-forge-admin,项目名称:tbb-feedstock,代码行数:4,代码来源:tbb_example.c

示例9: operator

 void operator()(const tbb::blocked_range<size_t>& r) const
 {
   checkPoints(r.begin(), r.end());
 }
开发者ID:kglowins,项目名称:DREAM3D,代码行数:4,代码来源:SampleSurfaceMesh.cpp

示例10: operator

 void operator ()(const tbb::blocked_range<int>& range) const
 {
     body->operator()(Range(range.begin(), range.end()));
 }
开发者ID:HVisionSensing,项目名称:tweakedOpenCV,代码行数:4,代码来源:parallel.cpp

示例11: operator

 /** Increments counter once for each iteration in the iteration space. */
 void operator()( tbb::blocked_range<size_t>& range ) const {
     for( size_t i=range.begin(); i!=range.end(); ++i ) {
         typename C::mutex_type::ScopedLock lock(counter.mutex);
         counter.value = counter.value+1;
     }
 }
开发者ID:sickboy,项目名称:bis-memory_allocators,代码行数:7,代码来源:test_concurrent_monitor.cpp

示例12: DoLerpParallel

void DoLerpParallel(const tbb::blocked_range<size_t>& r, const std::tr1::function<void(void*, const void*, const void*, float, size_t)>& func, void* dest, const void* source1, const void* source2, float alpha)
{
	size_t offset = r.begin()*STRIDE;
	size_t size = r.size()*STRIDE;
	func(reinterpret_cast<s8*>(dest) + offset, reinterpret_cast<const s8*>(source1) + offset, reinterpret_cast<const s8*>(source2) + offset, alpha, size);
}
开发者ID:,项目名称:,代码行数:6,代码来源:

示例13: operator

    void operator()(const tbb::blocked_range<size_t> &range) const {
	for (size_t i = range.begin(); i != range.end(); ++i) {
	    (*f)(p[i]);
	}
	//for_each(range.begin(), range.end(), *f);
    }
开发者ID:mconnor2,项目名称:NEATlegs,代码行数:6,代码来源:GeneticAlgorithm.cpp

示例14: operator

 void operator()( const tbb::blocked_range<int>& range ) const {
     for( int i=range.begin(); i!=range.end(); ++i )
         Op::apply(my_table,i);
 }
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:4,代码来源:test_concurrent_hash_map.cpp

示例15: DoShuffleParallel

void DoShuffleParallel(const tbb::blocked_range<size_t>& r, const std::tr1::function<void(void*, const void*, size_t, const u8, const u8, const u8, const u8)>& func, void* dest, const void* source, const u8 red, const u8 green, const u8 blue, const u8 alpha)
{
	size_t offset = r.begin()*STRIDE;
	size_t size = r.size()*STRIDE;
	func(reinterpret_cast<s8*>(dest) + offset, reinterpret_cast<const s8*>(source) + offset, size, red, green, blue, alpha);
}
开发者ID:,项目名称:,代码行数:6,代码来源:


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