本文整理汇总了C++中IDList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ IDList::end方法的具体用法?C++ IDList::end怎么用?C++ IDList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDList
的用法示例。
在下文中一共展示了IDList::end方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//------------------------------------------------------------------------------
void Solver::HashTable::Fill
(
const IDList& particleIDs
)
{
// clear all buckets
for (unsigned int i = 0; i < mDomain.Dimensions.X*mDomain.Dimensions.Y; i++)
{
mBuckets[i].clear();
}
// fill buckets
IDList::const_iterator i = particleIDs.begin();
IDList::const_iterator e = particleIDs.end();
for (; i != e; i++)
{
unsigned int hash = computeHash
(
Vector2f(&mPositions[2*(*i)]),
mDomain
);
mBuckets[hash].push_back(*i);
}
}
示例2: FindInIDList
// searches IDList idL for std::string s, returns its position, -1 if not found
inline int FindInIDList(IDList& idL,const std::string& s)
{
// int ix=0;
for(IDList::iterator i=idL.begin(); i != idL.end(); ++i)//, ++ix)
if( *i==s)
{
return i - idL.begin();
}
return -1;
}
示例3: Find
int Find( const std::string& name)
{
String_abbref_eq strAbbrefEq_name(name);
// search keyword
IDList::iterator f=std::find_if(listName.begin(),
listName.end(),
strAbbrefEq_name);
if( f == listName.end()) return -1;
// Note: there might be duplicate extra keyword names, return first one
// // continue search (for ambiguity)
// IDList::iterator ff=std::find_if(f+1,
// listName.end(),
// strAbbrefEq_name);
// if( ff != listName.end())
// {
// throw GDLException("Ambiguous keyword abbreviation in _EXTRA: "+name);
// }
return std::distance( listName.begin(),f);
}
示例4: declare
void BaseSemanticWalker::declare(const IDList& ids, Type* type) {
IDList::const_iterator it;
for (it = ids.begin(); it != ids.end(); ++it) {
try {
_symtable->insertSymbol(
Symbol((*it)->getText(),
type,
_symtable->currentScope(),
_symtable->unit(),
(*it)->getLine(),
(*it)->getColumn()));
} catch (RedeclarationException e) {
report((*it)->getLine(), (*it)->getColumn(),
std::string("redeclaração: ") + e.symbol().lexeme());
}
}
}
示例5: printClusters
int printClusters(NodeSet roots, IDList orphanNodes,
string clusterListName, string clusterName,
vector<float> cutoffs)
{
TreeNode *tempNode = 0;
NodeSetIter setIter;
NodeList nodeList, tempList;
NodeListIter nodeIt, tempIt;
IDList OTU;
IDListIter it;
unsigned int size, numOTUs;
FILE *clusterListFile, *clusterFile;
clusterListFile = fopen(clusterListName.c_str(),"wb");
clusterFile = fopen(clusterName.c_str(),"wb");
if(clusterListFile == NULL|| clusterFile == NULL)
{
cout << "Cannot open output files. Skipped" << endl;
return 0;
}
printf("\n");
vector<float>::iterator c;
float distLevel;
for(c = cutoffs.begin(); c != cutoffs.end(); c++)
{
distLevel = *(c);
numOTUs = 0;
nodeList.clear();
// extract the valid nodes for each distance level
for(setIter=roots.begin(); setIter!=roots.end(); ++setIter)
{
tempNode=0;
if(*setIter != 0)
{
if((*setIter)->dist < distLevel || fabs((*setIter)->dist-distLevel) < EPSILON)
{
nodeList.push_front(*setIter);
continue;
}
tempList.push_front(*setIter);
while (tempList.size()!=0)
{
tempIt=tempList.begin();
tempNode=(*tempIt);
tempList.pop_front();
if (tempNode->left->dist < distLevel || fabs(tempNode->left->dist-distLevel) < EPSILON)
nodeList.push_front(tempNode->left);
else
tempList.push_front(tempNode->left);
if (tempNode->right->dist < distLevel || fabs(tempNode->right->dist-distLevel) < EPSILON)
nodeList.push_front(tempNode->right);
else
tempList.push_front(tempNode->right);
}
}
tempList.clear();
}
fprintf(clusterListFile," %.6f ", distLevel);
fprintf(clusterFile," %.6f ", distLevel);
// write the nodeList to file
tempList.clear();
for(nodeIt=nodeList.begin(); nodeIt!=nodeList.end(); ++nodeIt)
{
// clean up and initialize
fprintf(clusterFile,"|");
tempNode=0;
size=0;
OTU.clear();
tempList.push_front(*nodeIt);
while(tempList.size()!=0)
{
tempIt=tempList.begin();
tempNode=(*tempIt);
tempList.pop_front();
if(tempNode->left==0 && tempNode->right==0)
{
OTU.push_back(tempNode->ID);
size+=tempNode->numMembers;
}
if (tempNode->right!=0)
tempList.push_front(tempNode->right);
if(tempNode->left!=0 )
tempList.push_front(tempNode->left);
}
tempList.clear();
// print to clusterFile
//.........这里部分代码省略.........
示例6: addGUID
void UpdateData::addGUID(const IDList& id)
{
m_guidList.insert(id.begin(), id.end());
}