本文整理汇总了C++中PooledData::add方法的典型用法代码示例。如果您正苦于以下问题:C++ PooledData::add方法的具体用法?C++ PooledData::add怎么用?C++ PooledData::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PooledData
的用法示例。
在下文中一共展示了PooledData::add方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: registerData
TrialWaveFunction::RealType TrialWaveFunction::registerData(ParticleSet& P, PooledData<RealType>& buf)
{
delta_G.resize(P.getTotalNum());
delta_L.resize(P.getTotalNum());
P.G = 0.0;
P.L = 0.0;
//save the current position
BufferCursor=buf.current();
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)->registerData(P,buf);
PhaseValue += (*it)->PhaseValue;
}
convert(logpsi,LogValue);
//LogValue=real(logpsi);
//append current gradients and laplacians to the buffer
NumPtcls = P.getTotalNum();
TotalDim = PosType::Size*NumPtcls;
buf.add(PhaseValue);
buf.add(LogValue);
buf.add(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
buf.add(&(P.L[0]), &(P.L[P.getTotalNum()]));
return LogValue;
}
示例2: logpsi
TrialWaveFunction::RealType
TrialWaveFunction::registerData(ParticleSet& P, PooledData<RealType>& buf) {
delta_G.resize(P.getTotalNum());
delta_L.resize(P.getTotalNum());
P.G = 0.0;
P.L = 0.0;
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)->registerData(P,buf);
PhaseValue += (*it)->PhaseValue;
}
LogValue=real(logpsi);
//append current gradients and laplacians to the buffer
NumPtcls = P.getTotalNum();
TotalDim = PosType::Size*NumPtcls;
buf.add(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
buf.add(&(P.L[0]), &(P.L[P.getTotalNum()]));
return LogValue;
// cout << "Registering gradients and laplacians " << endl;
// for(int i=0; i<P.getLocalNum(); i++) {
// cout << P.G[i] << " " << P.L[i] << endl;
// }
}
示例3:
LRTwoBodyJastrow::ValueType
LRTwoBodyJastrow::registerData(ParticleSet& P, PooledData<RealType>& buf) {
LogValue=evaluateLog(P,P.G,P.L);
buf.add(Rhok.first_address(), Rhok.last_address());
buf.add(U.first_address(), U.last_address());
buf.add(d2U.first_address(), d2U.last_address());
buf.add(FirstAddressOfdU,LastAddressOfdU);
return LogValue;
}
示例4: evaluateLogAndStore
AGPDeterminant::ValueType
AGPDeterminant::registerData(ParticleSet& P, PooledData<RealType>& buf) {
evaluateLogAndStore(P);
P.G += myG;
P.L += myL;
//copy psiM to temporary
psiM_temp = psiM;
if(UseBuffer)
{ //add the data: determinant, inverse, gradient and laplacians
buf.add(CurrentDet);
buf.add(psiM.begin(),psiM.end());
buf.add(phiT.begin(),phiT.end());
buf.add(d2psiU.begin(),d2psiU.end());
buf.add(d2psiD.begin(),d2psiD.end());
buf.add(FirstAddressOfdVU,LastAddressOfdVU);
buf.add(FirstAddressOfdVD,LastAddressOfdVD);
buf.add(d2Y.begin(),d2Y.end());
buf.add(FirstAddressOfdY,LastAddressOfdY);
buf.add(FirstAddressOfG,LastAddressOfG);
buf.add(myL.first_address(), myL.last_address());
//buf.add(myL.begin(), myL.end());
}
return LogValue = evaluateLogAndPhase(CurrentDet,PhaseValue);
}
示例5: registerData
void SpaceWarp::registerData(vector<ParticleSet*>& plist, PooledData<RealType>& buf) {
if(PtclRefs.empty()) {
SizeOfR=plist[0]->getTotalNum()*OHMMS_DIM;
for(int ipsi=0; ipsi<npsi; ipsi++){
PtclRefs.push_back(plist[ipsi]);
}
}
for(int ipsi=0; ipsi<npsi; ipsi++){
RealType* first=&(plist[ipsi]->R[0][0]);
buf.add(first,first+SizeOfR);
}
buf.add(one_ptcl_Jacob.begin(),one_ptcl_Jacob.end());
}
示例6: evaluateLog
RNDiracDeterminantBaseAlternate::RealType
RNDiracDeterminantBaseAlternate::registerData(ParticleSet& P, PooledData<RealType>& buf)
{
if (NP == 0) //first time, allocate once
{
//int norb = cols();
dpsiV.resize(NumOrbitals);
d2psiV.resize(NumOrbitals);
workV1.resize(NumOrbitals);
workV2.resize(NumOrbitals);
NP=P.getTotalNum();
myG.resize(NP);
myL.resize(NP);
myG_temp.resize(NP);
myL_temp.resize(NP);
myG_alternate.resize(NP);
myL_alternate.resize(NP);
FirstAddressOfG = &myG[0][0];
LastAddressOfG = FirstAddressOfG + NP*DIM;
FirstAddressOfdV = &(dpsiM(0,0)[0]); //(*dpsiM.begin())[0]);
LastAddressOfdV = FirstAddressOfdV + NumPtcls*NumOrbitals*DIM;
}
myG=0.0;
myL=0.0;
myG_alternate=0.0;
myL_alternate=0.0;
//ValueType x=evaluate(P,myG,myL);
evaluateLog(P,myG,myL);
P.G += myG;
P.L += myL;
//add the data: determinant, inverse, gradient and laplacians
buf.add(psiM.first_address(),psiM.last_address());
buf.add(FirstAddressOfdV,LastAddressOfdV);
buf.add(d2psiM.first_address(),d2psiM.last_address());
buf.add(myL.first_address(), myL.last_address());
buf.add(FirstAddressOfG,LastAddressOfG);
buf.add(LogValue);
buf.add(alternateLogValue);
buf.add(PhaseValue);
return LogValue;
}
示例7: evaluateLogAndStore
OrbitalBase::RealType
ThreeBodyGeminal::registerData(ParticleSet& P, PooledData<RealType>& buf)
{
evaluateLogAndStore(P);
FirstAddressOfdY=&(dY(0,0)[0]);
LastAddressOfdY=FirstAddressOfdY+NumPtcls*BasisSize*DIM;
FirstAddressOfgU=&(dUk(0,0)[0]);
LastAddressOfgU = FirstAddressOfgU + NumPtcls*NumPtcls*DIM;
buf.add(LogValue);
buf.add(V.begin(), V.end());
buf.add(Y.begin(), Y.end());
buf.add(FirstAddressOfdY,LastAddressOfdY);
buf.add(d2Y.begin(),d2Y.end());
buf.add(Uk.begin(), Uk.end());
buf.add(FirstAddressOfgU,LastAddressOfgU);
buf.add(d2Uk.begin(), d2Uk.end());
return LogValue;
}
示例8: registerData
DiracDeterminantBase::ValueType DiracDeterminantBase::registerData(ParticleSet& P, PooledData<RealType>& buf) {
if(NP == 0) {//first time, allocate once
//int norb = cols();
dpsiV.resize(NumOrbitals);
d2psiV.resize(NumOrbitals);
workV1.resize(NumOrbitals);
workV2.resize(NumOrbitals);
NP=P.getTotalNum();
myG.resize(NP);
myL.resize(NP);
myG_temp.resize(NP);
myL_temp.resize(NP);
FirstAddressOfG = &myG[0][0];
LastAddressOfG = FirstAddressOfG + NP*DIM;
FirstAddressOfdV = &(dpsiM(0,0)[0]); //(*dpsiM.begin())[0]);
LastAddressOfdV = FirstAddressOfdV + NumPtcls*NumOrbitals*DIM;
}
//allocate once but each walker calls this
myG=0.0;
myL=0.0;
ValueType x=evaluate(P,myG,myL);
P.G += myG;
P.L += myL;
//add the data: determinant, inverse, gradient and laplacians
buf.add(psiM.first_address(),psiM.last_address());
buf.add(FirstAddressOfdV,LastAddressOfdV);
buf.add(d2psiM.first_address(),d2psiM.last_address());
buf.add(myL.first_address(), myL.last_address());
buf.add(FirstAddressOfG,LastAddressOfG);
buf.add(CurrentDet);
return CurrentDet;
}
示例9: dumpToBuffer
/** dump the inverse to the buffer
*/
void DiracDeterminantBase::dumpToBuffer(ParticleSet& P, PooledData<RealType>& buf) {
buf.add(psiM.first_address(),psiM.last_address());
}