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


C++ Seq类代码示例

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


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

示例1: EqIgnoreCase

bool Seq::EqIgnoreCase(const Seq &s) const
	{
	const unsigned n = Length();
	if (n != s.Length())
		{
		return false;
		}
	for (unsigned i = 0; i < n; ++i)
		{
		const char c1 = at(i);
		const char c2 = s.at(i);
		if (IsGap(c1))
			{
			if (!IsGap(c2))
				return false;
			}
		else
			{
			if (toupper(c1) != toupper(c2))
				{
				return false;
				}
			}
		}
	return true;
	}
开发者ID:ggrekhov,项目名称:ugene,代码行数:26,代码来源:qscore_seq.cpp

示例2: read_test_data

void CWSInput1WithFeatureModelHandler<RNNDerived, I1Model>::predict(std::istream &is, std::ostream &os)
{
    
    std::vector<Seq> raw_instances;
    std::vector<IndexSeq> sents ;
    std::vector<CWSFeatureDataSeq> cws_feature_seqs;
    read_test_data(is, raw_instances, sents, cws_feature_seqs );
    BOOST_LOG_TRIVIAL(info) << "do prediction on " << raw_instances.size() << " instances .";
    BasicStat stat(true);
    stat.start_time_stat();
    for (unsigned int i = 0; i < raw_instances.size(); ++i)
    {
        Seq &raw_sent = raw_instances.at(i);
        if (0 == raw_sent.size())
        {
            os << "\n";
            continue;
        }
        IndexSeq &sent = sents.at(i) ;
        CWSFeatureDataSeq &cws_feature_seq = cws_feature_seqs.at(i);
        IndexSeq pred_tag_seq;
        dynet::ComputationGraph cg;
        i1m->predict(cg, sent, cws_feature_seq, pred_tag_seq);
        Seq words ;
        CWSTaggingSystem::static_parse_chars_indextag2word_seq(raw_sent, pred_tag_seq, words) ;
        os << words[0] ;
        for( size_t i = 1 ; i < words.size() ; ++i ) os << OutputDelimiter << words[i] ;
        os << "\n";
        stat.total_tags += pred_tag_seq.size() ;
    }
    stat.end_time_stat() ;
    BOOST_LOG_TRIVIAL(info) << stat.get_stat_str("predict done.")  ;
}
开发者ID:memeda,项目名称:sequence-labeling-by-nn,代码行数:33,代码来源:input1_with_feature_modelhandler_0628.hpp

示例3: empty

 operator Seq<U,CA,A>() const 
 {
     Seq<U,CA,A> result;
     result.transfer( result.end(), values_ );
     BOOST_ASSERT( empty() );
     return result;
 }
开发者ID:Mesagoppinmypants,项目名称:NGELinux,代码行数:7,代码来源:ptr_list_of.hpp

示例4: 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

示例5: 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

示例6: EstringOp

unsigned EstringOp(const short es[], const Seq &sIn, MSA &a)
	{
	unsigned uSymbols;
	unsigned uIndels;
	EstringCounts(es, &uSymbols, &uIndels);
	assert(sIn.Length() == uSymbols);

	unsigned uColCount = uSymbols + uIndels;

	a.Clear();
	a.SetSize(1, uColCount);

	a.SetSeqName(0, sIn.GetName());
	a.SetSeqId(0, sIn.GetId());

	unsigned p = 0;
	unsigned uColIndex = 0;
	for (;;)
		{
		int n = *es++;
		if (0 == n)
			break;
		if (n > 0)
			for (int i = 0; i < n; ++i)
				{
				char c = sIn[p++];
				a.SetChar(0, uColIndex++, c);
				}
		else
			for (int i = 0; i < -n; ++i)
				a.SetChar(0, uColIndex++, '-');
		}
	assert(uColIndex == uColCount);
	return uColCount;
	}
开发者ID:Unode,项目名称:ext_apps,代码行数:35,代码来源:estring.cpp

示例7: 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

示例8: Clear

void SeqVect::FromFASTAFile(TextFile &File)
	{
	Clear();

	FILE *f = File.GetStdioFile();
	for (;;)
		{
		char *Label;
		unsigned uLength;
		char *SeqData = GetFastaSeq(f, &uLength, &Label);
		if (0 == SeqData)
			return;
		Seq *ptrSeq = new Seq;

		for (unsigned i = 0; i < uLength; ++i)
			{
			char c = SeqData[i];
			ptrSeq->push_back(c);
			}

		ptrSeq->SetName(Label);
		push_back(ptrSeq);

		delete[] SeqData;
		delete[] Label;
		}
	}
开发者ID:cran,项目名称:muscle,代码行数:27,代码来源:seqvect.cpp

示例9: extract

    static void extract(const jsonpack::value &v, char* json_ptr, Seq &value)
    {
        array_t arr = *v._arr;
        value.clear();

        for(const auto &it : arr)
        {
#ifndef _MSC_VER
            // Initialize before use
            type_t val = {};
#else
            type_t val;
#endif  
            if( json_traits<type_t&>::match_token_type(it) )
            {
                json_traits<type_t&>::extract(it, json_ptr, val);
                value.insert(value.end(), val); //faster way in each container
            }
            else
            {
                throw type_error( "Array item type mismatch" );
            }
        }

    }
开发者ID:kylemanna,项目名称:jsonpack,代码行数:25,代码来源:sequences.hpp

示例10: 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

示例11: 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

示例12: strings

 inline Seq
 strings (std::initializer_list<X> const& con)
 {
   Seq collected;
   for (auto elm : con)
     collected.push_back(elm);
   return collected;
 }
开发者ID:Ichthyostega,项目名称:Lumiera,代码行数:8,代码来源:generic-record-representation-test.cpp

示例13: Length

void SeqVect::ToFASTAFile(TextFile &File) const
	{
	unsigned uSeqCount = Length();
	for (unsigned uSeqIndex = 0; uSeqIndex < uSeqCount; ++uSeqIndex)
		{
		Seq *ptrSeq = at(uSeqIndex);
		ptrSeq->ToFASTAFile(File);
		}
	}
开发者ID:cran,项目名称:muscle,代码行数:9,代码来源:seqvect.cpp

示例14: Subst

static SCORE Subst(const Seq &seqA, const Seq &seqB, unsigned i, unsigned j)
	{
	assert(i < seqA.Length());
	assert(j < seqB.Length());

	unsigned uLetterA = seqA.GetLetter(i);
	unsigned uLetterB = seqB.GetLetter(j);
	return VTML_SP[uLetterA][uLetterB] + g_scoreCenter;
	}
开发者ID:yathit,项目名称:molecular-biology-software,代码行数:9,代码来源:glbalignss.cpp

示例15: string_compare

inline int string_compare(const Seq& s, const C* p)
{
   std::size_t i = 0;
   while((i < s.size()) && (p[i] == s[i]))
   {
      ++i;
   }
   return (i == s.size()) ? -p[i] : s[i] - p[i];
}
开发者ID:3309622938,项目名称:soundcloud-win-sharing,代码行数:9,代码来源:perl_matcher.hpp


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