本文整理汇总了C++中PooledData::put方法的典型用法代码示例。如果您正苦于以下问题:C++ PooledData::put方法的具体用法?C++ PooledData::put怎么用?C++ PooledData::put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PooledData
的用法示例。
在下文中一共展示了PooledData::put方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
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;
}
示例2: copyToBuffer
void SpaceWarp::copyToBuffer(PooledData<RealType>& buf) {
vector<ParticleSet*>::iterator pit(PtclRefs.begin()), pit_end(PtclRefs.end());
while(pit != pit_end) {
RealType* first=&((**pit).R[0][0]);
buf.put(first,first+SizeOfR);
++pit;
}
buf.put(one_ptcl_Jacob.begin(),one_ptcl_Jacob.end());
}
示例3: evaluateLogAndStore
AGPDeterminant::ValueType
AGPDeterminant::updateBuffer(ParticleSet& P, PooledData<RealType>& buf,
bool fromscratch) {
evaluateLogAndStore(P);
P.G += myG;
P.L += myL;
if(UseBuffer) {
buf.put(CurrentDet);
buf.put(psiM.begin(),psiM.end());
buf.put(phiT.begin(),phiT.end());
buf.put(d2psiU.begin(),d2psiU.end());
buf.put(d2psiD.begin(),d2psiD.end());
buf.put(FirstAddressOfdVU,LastAddressOfdVU);
buf.put(FirstAddressOfdVD,LastAddressOfdVD);
buf.put(d2Y.begin(),d2Y.end());
buf.put(FirstAddressOfdY,LastAddressOfdY);
buf.put(FirstAddressOfG,LastAddressOfG);
buf.put(myL.first_address(), myL.last_address());
//buf.put(myL.begin(), myL.end());
}
return CurrentDet;
}
示例4: 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);
}
示例5:
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;
}
示例6: 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;
}
示例7:
OrbitalBase::RealType
ThreeBodyGeminal::evaluateLog(ParticleSet& P, PooledData<RealType>& buf) {
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;
//return std::exp(LogValue);
}
示例8: logpsi
TrialWaveFunction::RealType
TrialWaveFunction::updateBuffer(ParticleSet& P, PooledData<RealType>& buf,
bool fromscratch) {
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(int ii=1; it!=it_end; ++it,ii+=TIMER_SKIP)
{
myTimers[ii]->start();
logpsi += (*it)->updateBuffer(P,buf,fromscratch);
PhaseValue += (*it)->PhaseValue;
myTimers[ii]->stop();
}
LogValue=real(logpsi);
buf.put(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
buf.put(&(P.L[0]), &(P.L[0])+NumPtcls);
return LogValue;
}
示例9: updateBuffer
TrialWaveFunction::RealType TrialWaveFunction::updateBuffer(ParticleSet& P
, PooledData<RealType>& buf, bool fromscratch)
{
//TAU_PROFILE("TrialWaveFunction::updateBuffer","(P,..)", TAU_USER);
P.G = 0.0;
P.L = 0.0;
buf.rewind(BufferCursor);
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)->updateBuffer(P,buf,fromscratch);
PhaseValue += (*it)->PhaseValue;
}
convert(logpsi,LogValue);
//LogValue=real(logpsi);
buf.put(PhaseValue);
buf.put(LogValue);
buf.put(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
buf.put(&(P.L[0]), &(P.L[0])+NumPtcls);
return LogValue;
}
示例10: evaluate
DiracDeterminantBase::ValueType DiracDeterminantBase::evaluate(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(CurrentDet);
return CurrentDet;
}
示例11: evaluateLog
AGPDeterminant::ValueType AGPDeterminant::evaluateLog(ParticleSet& P, PooledData<RealType>& buf)
{
if(UseBuffer)
{
buf.put(CurrentDet);
buf.put(psiM.begin(),psiM.end());
buf.put(phiT.begin(),phiT.end());
buf.put(d2psiU.begin(),d2psiU.end());
buf.put(d2psiD.begin(),d2psiD.end());
buf.put(FirstAddressOfdVU,LastAddressOfdVU);
buf.put(FirstAddressOfdVD,LastAddressOfdVD);
buf.put(d2Y.begin(),d2Y.end());
buf.put(FirstAddressOfdY,LastAddressOfdY);
buf.put(FirstAddressOfG,LastAddressOfG);
buf.put(myL.first_address(), myL.last_address());
//buf.put(myL.begin(), myL.end());
}
return evaluateLogAndPhase(CurrentDet,PhaseValue);
//return CurrentDet;
}
示例12: updateBuffer
DiracDeterminantBase::ValueType DiracDeterminantBase::updateBuffer(ParticleSet& P, PooledData<RealType>& buf) {
myG=0.0;
myL=0.0;
ValueType x=evaluate(P,myG,myL);
P.G += myG;
P.L += myL;
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(CurrentDet);
return CurrentDet;
}
示例13: updateBuffer
RNDiracDeterminantBase::RealType RNDiracDeterminantBase::updateBuffer(ParticleSet& P,
PooledData<RealType>& buf, bool fromscratch)
{
myG=0.0;
myL=0.0;
myG_alternate=0.0;
myL_alternate=0.0;
if (fromscratch)
{
evaluateLog(P,myG,myL);
UpdateTimer.start();
}
else
{
if (UpdateMode == ORB_PBYP_RATIO)
Phi->evaluate(P, FirstIndex, LastIndex, psiM_temp,dpsiM, d2psiM);
RealType cp = std::exp(logepsilon -2.0*alternateLogValue);
RealType bp = 1.0/(1+cp);
UpdateTimer.start();
if (NumPtcls==1)
{
ValueType y=psiM(0,0);
GradType rv = y*dpsiM(0,0);
ValueType rv2=dot(rv,rv);
myG_alternate(FirstIndex) += rv;
myL_alternate(FirstIndex) += y*d2psiM(0,0) - rv2;
myG(FirstIndex) += bp*rv;
myL(FirstIndex) += bp*(y*d2psiM(0,0) + (1-2*bp)*rv2);
}
else
{
const ValueType* restrict yptr=psiM.data();
const ValueType* restrict d2yptr=d2psiM.data();
const GradType* restrict dyptr=dpsiM.data();
for (int i=0, iat=FirstIndex; i<NumPtcls; i++, iat++)
{
GradType rv;
ValueType lap=0.0;
for (int j=0; j<NumOrbitals; j++,yptr++)
{
rv += *yptr * *dyptr++;
lap += *yptr * *d2yptr++;
}
ValueType rv2=dot(rv,rv);
myG_alternate(iat) += rv;
myL_alternate(iat) += lap - rv2;
myG(iat) += bp*rv;
myL(iat) += bp*(lap + (1-2*bp)*rv2);
}
}
}
P.G += myG;
P.L += myL;
//copy psiM to psiM_temp
psiM_temp=psiM;
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);
UpdateTimer.stop();
return LogValue;
}
示例14: updateBuffer
DiracDeterminantBase::RealType DiracDeterminantBase::updateBuffer(ParticleSet& P,
PooledData<RealType>& buf, bool fromscratch)
{
myG=0.0;
myL=0.0;
if(fromscratch) {
LogValue=evaluateLog(P,myG,myL);
UpdateTimer.start();
}
else
{
if(UpdateMode == ORB_PBYP_RATIO)
Phi->evaluate(P, FirstIndex, LastIndex, psiM_temp,dpsiM, d2psiM);
UpdateTimer.start();
if(NumPtcls==1) {
// ValueType y=1.0/psiM_temp(0,0);
// psiM(0,0)=y;
// GradType rv = y*dpsiM(0,0);
// myG(FirstIndex) += rv;
// myL(FirstIndex) += y*d2psiM(0,0) - dot(rv,rv);
ValueType y=psiM(0,0);
GradType rv = y*dpsiM(0,0);
myG(FirstIndex) += rv;
myL(FirstIndex) += y*d2psiM(0,0) - dot(rv,rv);
} else {
const ValueType* restrict yptr=psiM.data();
const ValueType* restrict d2yptr=d2psiM.data();
const GradType* restrict dyptr=dpsiM.data();
for(int i=0, iat=FirstIndex; i<NumPtcls; i++, iat++)
{
GradType rv;
ValueType lap=0.0;
for(int j=0; j<NumOrbitals; j++,yptr++) {
rv += *yptr * *dyptr++;
lap += *yptr * *d2yptr++;
}
myG(iat) += rv;
myL(iat) += lap - dot(rv,rv);
}
}
}
P.G += myG;
P.L += myL;
//copy psiM to psiM_temp
psiM_temp=psiM;
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(PhaseValue);
UpdateTimer.stop();
return LogValue;
}