本文整理汇总了C++中QMCHamiltonian::size方法的典型用法代码示例。如果您正苦于以下问题:C++ QMCHamiltonian::size方法的具体用法?C++ QMCHamiltonian::size怎么用?C++ QMCHamiltonian::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMCHamiltonian
的用法示例。
在下文中一共展示了QMCHamiltonian::size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/** constructor
* @param h QMCHamiltonian to define the components
* @param hcopy number of copies of QMCHamiltonians
*/
CSPolymerEstimator::CSPolymerEstimator(QMCHamiltonian& h, int hcopy,
MultiChain* polymer)
// : Reptile(polymer)
{
Reptile = polymer;
NumCopies=hcopy;
NumObservables = h.size();
scalars.resize(NumCopies+NumCopies*(NumCopies-1)/2);
scalars_saved=scalars;
//d_data.resize(NumCopies*3+NumCopies*(NumCopies-1)/2);
}
示例2: hterms
LocalEnergyEstimator::LocalEnergyEstimator(QMCHamiltonian& h):Href(h) {
int hterms(h.size());
SizeOfHamiltonians = hterms;
FirstHamiltonian = h.startIndex();
elocal.resize(SizeOfHamiltonians+LE_MAX);
elocal_name.resize(SizeOfHamiltonians+LE_MAX);
elocal_name[ENERGY_INDEX] = "LocalEnergy";
elocal_name[ENERGY_SQ_INDEX] = "Variance";
elocal_name[POTENTIAL_INDEX] = "LocalPotential";
int ii(LE_MAX);
for(int i=0; i < SizeOfHamiltonians; i++) elocal_name[ii++] = h.getName(i);
}
示例3: put
/** This should be moved to branch engine */
bool EstimatorManager::put(MCWalkerConfiguration& W, QMCHamiltonian& H, xmlNodePtr cur)
{
vector<string> extra;
cur = cur->children;
while(cur != NULL)
{
string cname((const char*)(cur->name));
if(cname == "estimator")
{
string est_name(MainEstimatorName);
string use_hdf5("yes");
OhmmsAttributeSet hAttrib;
hAttrib.add(est_name, "name");
hAttrib.add(use_hdf5, "hdf5");
hAttrib.put(cur);
if( (est_name == MainEstimatorName) || (est_name=="elocal") )
{
if(use_hdf5 == "yes")
{
max4ascii=H.size()+3;//write only physical energies
add(new LocalEnergyEstimatorHDF(H),MainEstimatorName);
}
else
{//fall back to the ascii file
max4ascii=H.sizeOfObservables()+3;
add(new LocalEnergyEstimator(H),MainEstimatorName);
}
}
else if (est_name=="WFMConly")
{
max4ascii=H.sizeOfObservables()+10;
app_log() << " Using WFMConly for the MainEstimator " << endl;
add(new WFMCOnlyEstimator(H),MainEstimatorName);
est_name=MainEstimatorName;
}
else if (est_name=="releasednode")
{
int Smax(100);
int primary(1);
OhmmsAttributeSet hAttrib;
hAttrib.add(Smax, "Smax");
hAttrib.add(primary, "primary");
hAttrib.put(cur);
max4ascii=H.sizeOfObservables()+ 4 + 3*(Smax+1);
app_log() << " Using ReleasedNode for the MainEstimator with Smax="<<Smax<<" and max4ascii="<<max4ascii << endl;
if (primary==2) add(new ReleasedNodeEnergyEstimator(H,Smax),MainEstimatorName);
else add(new AlternateReleasedNodeEnergyEstimator(H,Smax),MainEstimatorName);
est_name=MainEstimatorName;
}
else if (est_name=="forwardwalking")
{
max4ascii=2*H.sizeOfObservables()+4;
app_log() << " Doing forwardwalking on hdf5 " << endl;
add(new ForwardWalkingEstimator(H),MainEstimatorName);
est_name=MainEstimatorName;
} else
extra.push_back(est_name);
}
cur = cur->next;
}
if(Estimators.empty())
{
app_log() << " Adding a default LocalEnergyEstimator for the MainEstimator " << endl;
max4ascii=H.sizeOfObservables()+3;
add(new LocalEnergyEstimator(H),MainEstimatorName);
//add(new LocalEnergyOnlyEstimator(),MainEstimatorName);
}
if(Collectables == 0 && H.sizeOfCollectables())
{
app_log() << " Using CollectablesEstimator for collectables, e.g. sk, gofr, density " << endl;
Collectables=new CollectablesEstimator(H);
add(Collectables,"collectables");
}
return true;
}