当前位置: 首页>>代码示例>>C++>>正文


C++ Simplex::begin方法代码示例

本文整理汇总了C++中Simplex::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Simplex::begin方法的具体用法?C++ Simplex::begin怎么用?C++ Simplex::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Simplex的用法示例。


在下文中一共展示了Simplex::begin方法的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;
 }
开发者ID:pbrendel,项目名称:AccSub,代码行数:8,代码来源:Utils.hpp

示例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;
}
开发者ID:caja-matematica,项目名称:pyPersistence,代码行数:66,代码来源:SToplex.hpp


注:本文中的Simplex::begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。