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


C++ MCWalkerConfiguration::getGlobalNumWalkers方法代码示例

本文整理汇总了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);
 }
开发者ID:digideskio,项目名称:qmcpack,代码行数:10,代码来源:EstimatorManager.cpp

示例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);
}
开发者ID:digideskio,项目名称:qmcpack,代码行数:12,代码来源:EstimatorManager.cpp

示例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();
}
开发者ID:svn2github,项目名称:qmcpack,代码行数:40,代码来源:WalkerControlBase.cpp


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