本文整理汇总了C++中MCWalkerConfiguration::getGlobalNumWalkers方法的典型用法代码示例。如果您正苦于以下问题:C++ MCWalkerConfiguration::getGlobalNumWalkers方法的具体用法?C++ MCWalkerConfiguration::getGlobalNumWalkers怎么用?C++ MCWalkerConfiguration::getGlobalNumWalkers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MCWalkerConfiguration
的用法示例。
在下文中一共展示了MCWalkerConfiguration::getGlobalNumWalkers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: accumulate
//NOTE: weights are not handled nicely.
//weight should be done carefully, not valid for DMC
//will add a function to MCWalkerConfiguration to track total weight
void EstimatorManager::accumulate(MCWalkerConfiguration& W)
{
BlockWeight += W.getActiveWalkers();
RealType norm=1.0/W.getGlobalNumWalkers();
for(int i=0; i< Estimators.size(); i++)
Estimators[i]->accumulate(W,W.begin(),W.end(),norm);
}
示例2: accumulate
/** accumulate Local energies and collectables
* @param W ensemble
*/
void EstimatorManager::accumulate(MCWalkerConfiguration& W)
{
BlockWeight += W.getActiveWalkers();
RealType norm=1.0/W.getGlobalNumWalkers();
for(int i=0; i< Estimators.size(); i++)
Estimators[i]->accumulate(W,W.begin(),W.end(),norm);
if(Collectables)//collectables are normalized by QMC drivers
Collectables->accumulate_all(W.Collectables,1.0);
}
示例3: doNotBranch
int WalkerControlBase::doNotBranch(int iter, MCWalkerConfiguration& W)
{
MCWalkerConfiguration::iterator it(W.begin());
MCWalkerConfiguration::iterator it_end(W.end());
RealType esum=0.0,e2sum=0.0,wsum=0.0,ecum=0.0, w2sum=0.0;
RealType r2_accepted=0.0,r2_proposed=0.0;
for(; it!=it_end; ++it)
{
r2_accepted+=(*it)->Properties(R2ACCEPTED);
r2_proposed+=(*it)->Properties(R2PROPOSED);
RealType e((*it)->Properties(LOCALENERGY));
int nc= std::min(static_cast<int>((*it)->Multiplicity),MaxCopy);
RealType wgt((*it)->Weight);
esum += wgt*e;
e2sum += wgt*e*e;
wsum += wgt;
w2sum += wgt*wgt;
ecum += e;
}
//temp is an array to perform reduction operations
std::fill(curData.begin(),curData.end(),0);
curData[ENERGY_INDEX]=esum;
curData[ENERGY_SQ_INDEX]=e2sum;
curData[WALKERSIZE_INDEX]=W.getActiveWalkers();
curData[WEIGHT_INDEX]=wsum;
curData[EREF_INDEX]=ecum;
curData[R2ACCEPTED_INDEX]=r2_accepted;
curData[R2PROPOSED_INDEX]=r2_proposed;
myComm->allreduce(curData);
measureProperties(iter);
trialEnergy=EnsembleProperty.Energy;
W.EnsembleProperty=EnsembleProperty;
//return the current data
return W.getGlobalNumWalkers();
}