本文整理汇总了C++中PooledData类的典型用法代码示例。如果您正苦于以下问题:C++ PooledData类的具体用法?C++ PooledData怎么用?C++ PooledData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PooledData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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::evaluate(ParticleSet& P, PooledData<RealType>& buf) {
buf.put(Rhok.first_address(), Rhok.last_address());
buf.put(U.first_address(), U.last_address());
buf.put(d2U.first_address(), d2U.last_address());
buf.put(FirstAddressOfdU,LastAddressOfdU);
return LogValue;
}
示例4: copyFromBuffer
void SpaceWarp::copyFromBuffer(PooledData<RealType>& buf) {
vector<ParticleSet*>::iterator pit(PtclRefs.begin()), pit_end(PtclRefs.end());
while(pit != pit_end) {
RealType* first=&((**pit).R[0][0]);
buf.get(first,first+SizeOfR);
++pit;
}
buf.get(one_ptcl_Jacob.begin(),one_ptcl_Jacob.end());
}
示例5: copyFromBuffer
void TrialWaveFunction::copyFromBuffer(ParticleSet& P, PooledData<RealType>& buf)
{
buf.rewind(BufferCursor);
//TAU_PROFILE("TrialWaveFunction::copyFromBuffer","(P,..)", TAU_USER);
for (int i=0; i<Z.size(); i++)
Z[i]->copyFromBuffer(P,buf);
//get the gradients and laplacians from the buffer
buf.get(PhaseValue);
buf.get(LogValue);
buf.get(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
buf.get(&(P.L[0]), &(P.L[0])+NumPtcls);
}
示例6: copyFromBuffer
void TrialWaveFunction::copyFromBuffer(ParticleSet& P, PooledData<RealType>& buf) {
for(int i=0; i<Z.size(); i++) Z[i]->copyFromBuffer(P,buf);
//get the gradients and laplacians from the buffer
buf.get(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
buf.get(&(P.L[0]), &(P.L[0])+NumPtcls);
// cout << "Checking out gradients and laplacians " << endl;
// for(int i=0; i<P.getLocalNum(); i++) {
// cout << P.G[i] << " " << P.L[i] << endl;
// }
}
示例7: 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);
}
示例8: real
TrialWaveFunction::RealType
TrialWaveFunction::evaluateLog(ParticleSet& P, PooledData<RealType>& buf)
{
LogValue=0.0;
PhaseValue=0.0;
for(int i=0; i<Z.size(); i++)
{
LogValue += Z[i]->evaluateLog(P,buf);
PhaseValue += Z[i]->PhaseValue;
}
buf.put(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
buf.put(&(P.L[0]), &(P.L[0])+NumPtcls);
return real(LogValue);
}
示例9: 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());
}
示例10: logpsi_fixed
void
TrialWaveFunction::evaluateDeltaLog(ParticleSet& P
, RealType& logpsi_fixed_r, RealType& logpsi_opt_r
, ParticleSet::ParticleGradient_t& fixedG
, ParticleSet::ParticleLaplacian_t& fixedL
, PooledData<RealType>& buf)
{
//TAU_PROFILE("TrialWaveFunction::evaluateDeltaLog","ParticleSet& P", TAU_USER);
P.G = 0.0;
P.L = 0.0;
fixedG = 0.0;
fixedL = 0.0;
ValueType logpsi_fixed(0.0);
ValueType logpsi_opt(0.0);
buf.rewind();
vector<OrbitalBase*>::iterator it(Z.begin());
vector<OrbitalBase*>::iterator it_end(Z.end());
for (; it!=it_end; ++it)
{
if ((*it)->Optimizable)
logpsi_opt += (*it)->evaluateLog(P, P.G, P.L,buf,true);
else
logpsi_fixed += (*it)->evaluateLog(P, fixedG, fixedL,buf,true);
}
P.G += fixedG;
P.L += fixedL;
convert(logpsi_fixed,logpsi_fixed_r);
convert(logpsi_opt,logpsi_opt_r);
//logpsi_fixed_r = real(logpsi_fixed);
//logpsi_opt_r = real(logpsi_opt);
}
示例11: evaluateDeltaLog
TrialWaveFunction::RealType TrialWaveFunction::evaluateDeltaLog(ParticleSet& P, PooledData<RealType>& buf)
{
P.G = 0.0;
P.L = 0.0;
ValueType logpsi(0.0);
PhaseValue=0.0;
buf.rewind();
vector<OrbitalBase*>::iterator it(Z.begin());
vector<OrbitalBase*>::iterator it_end(Z.end());
for (; it!=it_end; ++it)
{
// mmorales: I don't remember if I did this, but eliminating the "if ((*it)->Optimizable)"
// forces everything to be evaluated. This was probably done because for optm with the
// nonlocal component in the cost function, the slater determinant might not be optimizable
// but this must be called anyway to load the inverse. CHECK CHECK CHECK, FIX FIX FIX
if ((*it)->Optimizable)
{
logpsi += (*it)->evaluateLog(P, P.G, P.L,buf,false);
PhaseValue += (*it)->PhaseValue;
}
else
// ValueType x = (*it)->evaluateLog(P, P.G, P.L,buf,false);
(*it)->copyFromDerivativeBuffer(P,buf);//keep buffer synched
}
convert(logpsi,LogValue);
return LogValue;
//return LogValue=real(logpsi);
}
示例12:
RNDiracDeterminantBase::RealType
RNDiracDeterminantBase::evaluateLog(ParticleSet& P, PooledData<RealType>& buf)
{
buf.put(psiM.first_address(),psiM.last_address());
buf.put(FirstAddressOfdV,LastAddressOfdV);
buf.put(d2psiM.first_address(),d2psiM.last_address());
buf.put(myL.first_address(), myL.last_address());
buf.put(FirstAddressOfG,LastAddressOfG);
buf.put(LogValue);
buf.put(alternateLogValue);
buf.put(alternatePhaseValue);
return LogValue;
}
示例13:
void
ThreeBodyGeminal::copyFromBuffer(ParticleSet& P, PooledData<RealType>& buf) {
buf.get(LogValue);
buf.get(V.begin(), V.end());
buf.get(Y.begin(), Y.end());
buf.get(FirstAddressOfdY,LastAddressOfdY);
buf.get(d2Y.begin(),d2Y.end());
buf.get(Uk.begin(), Uk.end());
buf.get(FirstAddressOfgU,LastAddressOfgU);
buf.get(d2Uk.begin(), d2Uk.end());
}
示例14: evaluateLogAndStore
OrbitalBase::RealType
ThreeBodyGeminal::updateBuffer(ParticleSet& P, PooledData<RealType>& buf,
bool fromscratch) {
evaluateLogAndStore(P);
buf.put(LogValue);
buf.put(V.begin(), V.end());
buf.put(Y.begin(), Y.end());
buf.put(FirstAddressOfdY,LastAddressOfdY);
buf.put(d2Y.begin(),d2Y.end());
buf.put(Uk.begin(), Uk.end());
buf.put(FirstAddressOfgU,LastAddressOfgU);
buf.put(d2Uk.begin(), d2Uk.end());
return LogValue;
}
示例15: 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;
}