本文整理汇总了C++中ContainerType::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ ContainerType::erase方法的具体用法?C++ ContainerType::erase怎么用?C++ ContainerType::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContainerType
的用法示例。
在下文中一共展示了ContainerType::erase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processResData_ByRotID
void processResData_ByRotID( const std::string& resName, ContainerType& data, RotamerLibrary& _RotLib )
{
// Sort the data to increase efficiency below
std::stable_sort( data.begin(), data.end(), sortPsi);
std::stable_sort( data.begin(), data.end(), sortPhi);
std::stable_sort( data.begin(), data.end(), sortRotID);
ContainerType subdata;
while( true )
{
if( data.size() > 0 && (subdata.size() == 0 || subdata[0].rotID.compare( data.back().rotID,0,4,0 )) )
{
subdata.push_back( data.back() );
data.erase(data.end()-1); // rob the end, not the start (ContainerType<> perfomance reasons!)
}
else
{
ASSERT( data.size() == (36*36), ParseException, "Assumption error!");
ASSERT( data[0].phi == -180.0 && data[0].psi == -180.0, ParseException, "Wrong phi/psi");
for( size_t j = 1; j < data.size(); j++ )
{
ASSERT( data[j].phi == (-180.0+(j/36)*10) && data[j].psi == (-180.0+(j%36)*10), ParseException, "Wrong phi/psi");
}
processData( resName, subdata, _RotLib, 40.0 ); // 40 degree tollerance delta from data[0]
subdata.clear();
if( data.size() == 0 )
{
return;
}
}
}
}
示例2: processResData
// This function is given an entire block of the same residue. The rotamerIDs will of course be different.
void processResData( const std::string& resName, ContainerType& data, RotamerLibrary& _RotLib, bool switchImportMode )
{
// Either there is something fundamental I don't understand, or ...
// The dunbrack library has this really annoying thing whereby the 180 and -180 phi/psi torsions,
// which are by definition the same thing, are both defined!
// We only want one, as both represent the same 10 degree bin!
data.erase(std::remove_if(data.begin(),data.end(),removeParseData),data.end());
if( switchImportMode )
{
processResData_ByRotID(resName,data,_RotLib);
}
else
{
data.erase(std::remove_if(data.begin(),data.end(),removeLowPropensity),data.end());
processResData_ByChis(resName,data,_RotLib);
}
}