本文整理汇总了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_);
}
示例2: operator
void operator()( const tbb::blocked_range<int> &r ) const {
for (int i = r.begin(); i != r.end(); ++i) {
sums.local() += 1 ;
}
}
示例3: operator
void operator()(const tbb::blocked_range<size_t>& r) {
pReduce_->operator()(r.begin(), r.end());
}
示例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);
}
示例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);
}
示例6:
void
SoftBody::MeshProcessor::operator ()(const tbb::blocked_range<uint32_t> r) const
{
mBody.updateMesh(r.begin(), r.end());
}
示例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;
}
}
}
}
示例8: operator
void operator()(const tbb::blocked_range<size_t>& r) const {
for (size_t i=r.begin();i!=r.end();++i)
_tasks[i]();
}
示例9: operator
void operator()(const tbb::blocked_range<size_t>& r) const
{
checkPoints(r.begin(), r.end());
}
示例10: operator
void operator ()(const tbb::blocked_range<int>& range) const
{
body->operator()(Range(range.begin(), range.end()));
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}