本文整理汇总了C++中MultiValue::emptyActiveMembers方法的典型用法代码示例。如果您正苦于以下问题:C++ MultiValue::emptyActiveMembers方法的具体用法?C++ MultiValue::emptyActiveMembers怎么用?C++ MultiValue::emptyActiveMembers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MultiValue
的用法示例。
在下文中一共展示了MultiValue::emptyActiveMembers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: retrieveDerivatives
void StoreDataVessel::retrieveDerivatives( const unsigned& myelem, const bool& normed, MultiValue& myvals ){
plumed_dbg_assert( myvals.getNumberOfValues()==vecsize && myvals.getNumberOfDerivatives()==getAction()->getNumberOfDerivatives() );
myvals.clearAll();
if( getAction()->lowmem ){
recalculateStoredQuantity( myelem, myvals );
if( normed ) getAction()->normalizeVectorDerivatives( myvals );
} else {
unsigned jelem = getAction()->getPositionInCurrentTaskList( myelem );
// Retrieve the derivatives for elements 0 and 1 - weight and norm
for(unsigned icomp=0;icomp<vecsize;++icomp){
unsigned ibuf = jelem * ( vecsize*nspace ) + icomp*nspace + 1;
unsigned kder = getNumberOfStoredValues() + jelem * ( nspace - 1 );
for(unsigned j=0;j<active_der[jelem];++j){
myvals.addDerivative( icomp, active_der[kder], local_buffer[ibuf] );
kder++; ibuf++;
}
}
if( normed ) getAction()->normalizeVectorDerivatives( myvals );
// Now ensure appropriate parts of list are activated
myvals.emptyActiveMembers();
unsigned kder = getNumberOfStoredValues() + jelem * ( nspace - 1 );
for(unsigned j=0;j<active_der[jelem];++j){ myvals.putIndexInActiveArray( active_der[kder] ); kder++; }
myvals.sortActiveList();
}
}
示例2: transformBridgedDerivatives
void ManyRestraintsBase::transformBridgedDerivatives( const unsigned& current, MultiValue& invals, MultiValue& outvals ) const {
outvals.setValue( 0, invals.get(0) );
// Get the potential
double dval=0, val=calcPotential( invals.get(1), dval );
outvals.setValue( 1, val );
for(unsigned i=0; i<invals.getNumberActive(); ++i) {
unsigned jder=invals.getActiveIndex(i);
outvals.addDerivative( 1, jder, dval*invals.getDerivative( 1, jder ) );
}
// Now update the outvals derivatives lists
outvals.emptyActiveMembers();
for(unsigned j=0; j<invals.getNumberActive(); ++j) outvals.updateIndex( invals.getActiveIndex(j) );
outvals.completeUpdate();
return;
}