本文整理汇总了C++中PooledData::rewind方法的典型用法代码示例。如果您正苦于以下问题:C++ PooledData::rewind方法的具体用法?C++ PooledData::rewind怎么用?C++ PooledData::rewind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PooledData
的用法示例。
在下文中一共展示了PooledData::rewind方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: logpsi_fixed
void
TrialWaveFunction::evaluateDeltaLog(ParticleSet& P
, RealType& logpsi_fixed_r, RealType& logpsi_opt_r
, ParticleSet::ParticleGradient_t& fixedG
, ParticleSet::ParticleLaplacian_t& fixedL
, PooledData<RealType>& buf)
{
//TAU_PROFILE("TrialWaveFunction::evaluateDeltaLog","ParticleSet& P", TAU_USER);
P.G = 0.0;
P.L = 0.0;
fixedG = 0.0;
fixedL = 0.0;
ValueType logpsi_fixed(0.0);
ValueType logpsi_opt(0.0);
buf.rewind();
vector<OrbitalBase*>::iterator it(Z.begin());
vector<OrbitalBase*>::iterator it_end(Z.end());
for (; it!=it_end; ++it)
{
if ((*it)->Optimizable)
logpsi_opt += (*it)->evaluateLog(P, P.G, P.L,buf,true);
else
logpsi_fixed += (*it)->evaluateLog(P, fixedG, fixedL,buf,true);
}
P.G += fixedG;
P.L += fixedL;
convert(logpsi_fixed,logpsi_fixed_r);
convert(logpsi_opt,logpsi_opt_r);
//logpsi_fixed_r = real(logpsi_fixed);
//logpsi_opt_r = real(logpsi_opt);
}
示例2: evaluateDeltaLog
TrialWaveFunction::RealType TrialWaveFunction::evaluateDeltaLog(ParticleSet& P, PooledData<RealType>& buf)
{
P.G = 0.0;
P.L = 0.0;
ValueType logpsi(0.0);
PhaseValue=0.0;
buf.rewind();
vector<OrbitalBase*>::iterator it(Z.begin());
vector<OrbitalBase*>::iterator it_end(Z.end());
for (; it!=it_end; ++it)
{
// mmorales: I don't remember if I did this, but eliminating the "if ((*it)->Optimizable)"
// forces everything to be evaluated. This was probably done because for optm with the
// nonlocal component in the cost function, the slater determinant might not be optimizable
// but this must be called anyway to load the inverse. CHECK CHECK CHECK, FIX FIX FIX
if ((*it)->Optimizable)
{
logpsi += (*it)->evaluateLog(P, P.G, P.L,buf,false);
PhaseValue += (*it)->PhaseValue;
}
else
// ValueType x = (*it)->evaluateLog(P, P.G, P.L,buf,false);
(*it)->copyFromDerivativeBuffer(P,buf);//keep buffer synched
}
convert(logpsi,LogValue);
return LogValue;
//return LogValue=real(logpsi);
}
示例3: copyFromBuffer
void TrialWaveFunction::copyFromBuffer(ParticleSet& P, PooledData<RealType>& buf)
{
buf.rewind(BufferCursor);
//TAU_PROFILE("TrialWaveFunction::copyFromBuffer","(P,..)", TAU_USER);
for (int i=0; i<Z.size(); i++)
Z[i]->copyFromBuffer(P,buf);
//get the gradients and laplacians from the buffer
buf.get(PhaseValue);
buf.get(LogValue);
buf.get(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
buf.get(&(P.L[0]), &(P.L[0])+NumPtcls);
}
示例4:
TrialWaveFunction::RealType
TrialWaveFunction::evaluateLog(ParticleSet& P, PooledData<RealType>& buf)
{
buf.rewind(BufferCursor);
LogValue=0.0;
PhaseValue=0.0;
for (int i=0; i<Z.size(); i++)
{
LogValue += Z[i]->evaluateLog(P,buf);
PhaseValue += Z[i]->PhaseValue;
}
buf.put(PhaseValue);
buf.put(LogValue);
//buf.put(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
//buf.put(&(P.L[0]), &(P.L[0])+NumPtcls);
return LogValue;
}
示例5: updateBuffer
TrialWaveFunction::RealType TrialWaveFunction::updateBuffer(ParticleSet& P
, PooledData<RealType>& buf, bool fromscratch)
{
//TAU_PROFILE("TrialWaveFunction::updateBuffer","(P,..)", TAU_USER);
P.G = 0.0;
P.L = 0.0;
buf.rewind(BufferCursor);
ValueType logpsi(0.0);
PhaseValue=0.0;
vector<OrbitalBase*>::iterator it(Z.begin());
vector<OrbitalBase*>::iterator it_end(Z.end());
for (; it!=it_end; ++it)
{
logpsi += (*it)->updateBuffer(P,buf,fromscratch);
PhaseValue += (*it)->PhaseValue;
}
convert(logpsi,LogValue);
//LogValue=real(logpsi);
buf.put(PhaseValue);
buf.put(LogValue);
buf.put(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
buf.put(&(P.L[0]), &(P.L[0])+NumPtcls);
return LogValue;
}