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


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

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


在下文中一共展示了Seq::begin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: variance_func

double variance_func(Seq &sq) {
	
	if (sq.empty())
		return 0;
	
	double av=0;
	double var=0;
	
	
	typename Seq::iterator it = sq.begin(); 
	while(it != sq.end()) {
		
		av+=*(it);
		var+=(*(it))*(*(it));
		it++;
		
	}
	
	
	av=av/sq.size();
	var=var/sq.size();
	var-=av*av;
	
	if(var<1e-7)
		return 0;
	
	return var;
	
}
开发者ID:Aleyasen,项目名称:Alaki,代码行数:29,代码来源:combinatorics.cpp

示例2: size

std::size_t size(const Seq& seq)
{
    std::size_t d = 0;
    for (typename Seq::const_iterator it=seq.begin(); it!=seq.end(); ++it)
        d += boost::asio::buffer_size(*it);
    return d;
}
开发者ID:alexeimoisseev,项目名称:NwSMTP,代码行数:7,代码来源:buffers.cpp

示例3: variance_pf

double variance_pf(Seq &sq) {
	
	
	double av=0;
	double var=0;
	int h=0;
	
	typename Seq::iterator it = sq.begin(); 
	while(it != sq.end()) {
		
		av+=*(it) * h;
		var+=(*(it)) * h * h ;
		it++;
		h++;
	}
	
	
	var-=av*av;
	
	if(var<1e-7)
		return 0;
	
	return var;
	
}
开发者ID:Aleyasen,项目名称:Alaki,代码行数:25,代码来源:combinatorics.cpp

示例4: emit_sep

void emit_sep(
	Seq const &s, std::size_t step, Printer &&p
)
{
	auto iter(s.begin());
	std::size_t c(0);
	auto lc(std::min(s.size(), c + step));

	if (lc) {
		auto xc(c);
		printf("\t\t");
		p(*iter++);
		for (++xc; xc < lc; ++xc) {
			printf(", ");
			p(*iter++);
		}
	}
	c += lc;

	for (; c < s.size(); c += step) {
		printf(",\n");
		lc = std::min(s.size(), c + step);

		if (!lc)
			break;

		auto xc(c);
		printf("\t\t");
		p(*iter++);
		for (++xc; xc < lc; ++xc) {
			printf(", ");
			p(*iter++);
		}
	}
}
开发者ID:oakad,项目名称:ucpf,代码行数:35,代码来源:gen_sbs_0.cpp

示例5: convertMAlignment2SecVect

void convertMAlignment2SecVect(SeqVect& sv, const MultipleSequenceAlignment& ma, bool fixAlpha) {
    sv.Clear();

    MuscleContext *ctx = getMuscleContext();
    ctx->fillUidsVectors(ma->getNumRows());

    unsigned i=0;
    unsigned seq_count = 0;
    foreach(const MultipleSequenceAlignmentRow& row, ma->getMsaRows()) {
        Seq *ptrSeq = new Seq();
        QByteArray name =  row->getName().toLocal8Bit();
        ptrSeq->FromString(row->getCore().constData(), name.constData());
        //stripping gaps, original Seq::StripGaps fails on MSVC9
        Seq::iterator newEnd = std::remove(ptrSeq->begin(), ptrSeq->end(), U2Msa::GAP_CHAR);
        ptrSeq->erase(newEnd, ptrSeq->end());
        if (ptrSeq->Length()!=0) {
            ctx->tmp_uIds[seq_count] = ctx->input_uIds[i];
            sv.push_back(ptrSeq);
            seq_count++; 
        }
        i++;
    }
    if (fixAlpha) {
        sv.FixAlpha();
    }
}
开发者ID:ggrekhov,项目名称:ugene,代码行数:26,代码来源:MuscleUtils.cpp

示例6: purge

template<class Seq> void purge(Seq& c) 
{
	typename Seq::iterator i;
	for(i = c.begin(); i != c.end(); ++i) {
		delete *i;
		*i = 0;
	}
}
开发者ID:johnmichaloski,项目名称:CMSD,代码行数:8,代码来源:MTCAgentCmd.cpp

示例7: purge

/** to purge a STL container of pointers; only pointers owned by the container, ie for which second arg
    corresponding value is true, are deleted.
    \param a STL sequence container
    \param a std::vector<bool>
*/
template<class Seq> void purge(Seq& c, const std::vector<bool>& isAllocatedIn)
{
  typename Seq::iterator i;
  std::vector<bool>::const_iterator it = isAllocatedIn.begin();
  for (i = c.begin(); i != c.end(); ++i)
  {
    if (*it ++) delete *i;
    *i = NULL;
  }
}
开发者ID:bremond,项目名称:siconos,代码行数:15,代码来源:Tools.hpp

示例8: processObjects

void XMLPrintVisitor::processObjects(Seq& list)
{
    if (list.empty()) return;
    // the following line breaks the compilator on Visual2003
    //for_each<XMLPrintVisitor, Seq, typename Seq::value_type>(this, list, &XMLPrintVisitor::processObject<typename Seq::value_type>);
    for (typename Seq::iterator it = list.begin(); it != list.end(); ++it)
    {
        typename Seq::value_type obj = *it;
        this->processObject<typename Seq::value_type>(obj);
    }
}
开发者ID:151706061,项目名称:sofa,代码行数:11,代码来源:XMLPrintVisitor.cpp

示例9: Real

void Contact3D::draw(const Contact3D::Appearance& appearance, const Seq& contacts, const golem::Mat34& pose, golem::DebugRenderer& renderer) {
	if (appearance.pointsShow) {
		Real norm = Real(golem::numeric_const<U8>::MAX);
		if (appearance.pointSize > REAL_ZERO) {
			renderer.setPointSize(appearance.pointSize);
			norm *= golem::Sample<Real>::getNormWeight<golem::Ref1>(contacts);
		}

		for (Contact3D::Seq::const_iterator i = contacts.begin(); i != contacts.end(); ++i)
			i->draw(appearance, pose, renderer, U8(norm*i->weight));
	}
	if (appearance.boundsFrameShow)
		renderer.addAxes(pose, appearance.boundsFrameSize);
}
开发者ID:marekkopicki,项目名称:Golem,代码行数:14,代码来源:Contact3D.cpp

示例10: average_func

double average_func(Seq &sq) {
	
	if (sq.empty())
		return 0;
	
	double av=0;
	typename Seq::iterator it = sq.begin(); 
	while(it != sq.end())
		av+=*(it++);
	
	av=av/sq.size();
	
	return av;
	
}
开发者ID:Aleyasen,项目名称:Alaki,代码行数:15,代码来源:combinatorics.cpp

示例11: average_pf

double average_pf(Seq &sq) {
	
	
	double av=0;
	int h=0;
	
	typename Seq::iterator it = sq.begin(); 
	while(it != sq.end()) {
		
		av+=*(it)*h;
		it++;
		h++;
	
	}
	
	return av;
	
}
开发者ID:Aleyasen,项目名称:Alaki,代码行数:18,代码来源:combinatorics.cpp

示例12: rbpose

void golem::Contact3D::drawPoints(const Seq& contacts, const golem::RGBA& colour, golem::Real normalLen, const golem::Mat34& pose, golem::DebugRenderer& renderer) {
	const RBCoord rbpose(pose);
	const Real norm = Real(golem::numeric_const<U8>::MAX)*golem::Sample<Real>::getNormWeight<golem::Ref1>(contacts);
	for (Contact3D::Seq::const_iterator j = contacts.begin(); j != contacts.end(); ++j) {
		RBCoord frame;
		frame.setInverse(j->local);
		frame.multiply(rbpose, frame);
		
		const RGBA colour(colour._rgba.r, colour._rgba.g, colour._rgba.b, U8(norm*j->weight));
		renderer.addPoint(frame.p, colour);
		
		if (normalLen > REAL_EPS) {
			Vec3 z;
			frame.q.multiply(z, Vec3::axisZ());
			Vec3 p;
			p.multiplyAdd(normalLen, z, frame.p);
			renderer.addLine(frame.p, p, colour);
		}
	}
}
开发者ID:marekkopicki,项目名称:Golem,代码行数:20,代码来源:Contact3D.cpp

示例13: begin

 T* begin(){
     return seq.begin();
 }
开发者ID:githubcai,项目名称:Thinking_In_C,代码行数:3,代码来源:TempTemp.cpp

示例14: f

    void f(const Seq& seq)
    {
	find(seq.begin(), seq.end(), 7);
    }
开发者ID:2075,项目名称:discovering_modern_cpp,代码行数:4,代码来源:namespace_trouble.cpp

示例15: none

bool none(Seq const& s, Pred const& p) {
  for (typename Seq::const_iterator i = s.begin(), e = s.end(); i!=e; ++i)
    if (p(*i)) return false;
  return true;
}
开发者ID:fullstackenviormentss,项目名称:carmel,代码行数:5,代码来源:any_all.hpp


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