本文整理汇总了C++中MCWalkerConfiguration::getParticleNum方法的典型用法代码示例。如果您正苦于以下问题:C++ MCWalkerConfiguration::getParticleNum方法的具体用法?C++ MCWalkerConfiguration::getParticleNum怎么用?C++ MCWalkerConfiguration::getParticleNum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MCWalkerConfiguration
的用法示例。
在下文中一共展示了MCWalkerConfiguration::getParticleNum方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sprintf
bool
HDFWalkerInput0::append(MCWalkerConfiguration& W, int blocks){
if(Counter<0) return false;
//if(nwalkers<0) return put(W,-1);
typedef MCWalkerConfiguration::PosType PosType;
typedef Matrix<PosType> PosContainer_t;
PosContainer_t Pos_temp;
int nw_in=0;
int firstConf=std::max(0,NumSets-blocks);
if(blocks<0) firstConf=0;
for(int iconf=firstConf; iconf<NumSets; iconf++) {
//open the group
char GrpName[128];
sprintf(GrpName,"config%04d",iconf);
hid_t group_id = H5Gopen(h_config,GrpName);
HDFAttribIO<PosContainer_t> Pos_in(Pos_temp);
//read the dataset
Pos_in.read(group_id,"coord");
//close the group
H5Gclose(group_id);
/*check to see if the number of walkers and particles is consistent with W */
int nptcl = Pos_temp.cols();
int nwt = Pos_temp.rows();
int curWalker=0;
if(nptcl != W.getParticleNum()) {
W.resize(nwt,nptcl);
} else {
curWalker=W.getActiveWalkers();
W.createWalkers(nwt);
}
MCWalkerConfiguration::iterator it = W.begin()+curWalker;
for(int iw=0; iw<nwt; iw++) {
//std::copy(Post_temp[iw],Post_temp[iw+1], (*it)->R.begin());
for(int iat=0; iat < nptcl; iat++){
(*it)->R(iat) = Pos_temp(iw,iat);
}
++it;
}
nw_in += nwt;
}
LOGMSG("Total " << nw_in << " walkers are loaded using " << NumSets-firstConf << " blocks.")
return true;
}