本文整理汇总了C++中Simplex::end方法的典型用法代码示例。如果您正苦于以下问题:C++ Simplex::end方法的具体用法?C++ Simplex::end怎么用?C++ Simplex::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Simplex
的用法示例。
在下文中一共展示了Simplex::end方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintSimplex
static void PrintSimplex(std::ostream &str, const Simplex &simplex)
{
for (typename Simplex::const_iterator i = simplex.begin(); i != simplex.end(); i++)
{
str<<(*i)<<" ";
}
str<<std::endl;
}
示例2: getHashMod
bool SToplex<C,PS,BT>::buildTopSimpMap (const vector<Simplex<C,PS,BT>*>& topsimps, bool makeverlist = true)
{
verlist.clear();
//cout<<" top simp size "<<topsimps.size(); cin.get();
if (topsimps.size()==0 || topsimps.front()==NULL) return false; // no simplices to add
num topd;
Simplex<C,PS,BT>* cursimp;
set<Point<PS>*, ptcomplex<PS> > vertices; // store all vertices
typename PT_SET::const_iterator viter; //
// iterate over top simplices and extract vertices:
typename vector<Simplex<C,PS,BT>*>::const_iterator curtop;
for (curtop = topsimps.begin(); curtop != topsimps.end(); ++curtop)
{
cursimp = *curtop;
topd = cursimp->getDim(); // get top simplex's dimension
// update top dim of toplex!
if (topd > topdim) topdim = topd;
// now extract vertices!
for (viter = cursimp->begin(); viter != cursimp->end(); ++viter)
{
vertices.insert(*viter);
}
if (makeverlist) verlist.insert(vertices.begin(),vertices.end());
}
if (SIMTOPTALK)
{
cout<<"\n built vertex list";
if (MAKEBPS) cin.get();
}
// set number of distinct vertices:
psize = vertices.size();
typename SIMP_MAP::iterator mit;
SIMP_RG* currg;
num hmod = getHashMod();
// now we can compute the hashes using topdim and psize, and hence
// store the top simplices. sweep over them again...
for (curtop = topsimps.begin(); curtop != topsimps.end(); ++curtop)
{
cursimp = *curtop;
mit = mymap.find(cursimp->getDim()); // seek this hash
if(mit == mymap.end()) // not found!
{
currg = new SIMP_RG; // define range, and...
mymap.insert(mymap.end(),make_pair(cursimp->getDim(),currg));
}
else currg = mit->second;
currg->insert(currg->end(),make_pair(cursimp->getHash(hmod),cursimp));
}
if (SIMTOPTALK)
{
cout<<"\n top map size: "<<mymap.size();
if (MAKEBPS) cin.get();
}
//cout<<" top map size: "<<mymap.size(); cin.get();
return true;
}