本文整理汇总了C++中MultiValue::clearAll方法的典型用法代码示例。如果您正苦于以下问题:C++ MultiValue::clearAll方法的具体用法?C++ MultiValue::clearAll怎么用?C++ MultiValue::clearAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MultiValue
的用法示例。
在下文中一共展示了MultiValue::clearAll方法的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: calculateAllVessels
bool ActionWithVessel::calculateAllVessels( const unsigned& taskCode, MultiValue& myvals, MultiValue& bvals, std::vector<double>& buffer, std::vector<unsigned>& der_list ){
bool keep=false;
for(unsigned j=0;j<functions.size();++j){
// Calculate returns a bool that tells us if this particular
// quantity is contributing more than the tolerance
if( functions[j]->calculate( taskCode, functions[j]->transformDerivatives(taskCode, myvals, bvals), buffer, der_list ) ) keep=true;
if( !actionIsBridged && bvals.getNumberActive()>0 ) bvals.clearAll();
}
return keep;
}