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


C++ istringstream::eof方法代码示例

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


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

示例1: readConfig

void readConfig( istringstream& iss,
                 int& n_in,
                 int& n_out,
                 int& n_vocab,
                 int& n_project,
                 int& n_order,
                 float& momentum,
                 float& weight_decay,
                 float& alpha,
                 float& lnZ, 
                 string& norm_type, 
                 float& norm_param ) {
    n_in = 0;
    n_out = 0;
    n_vocab = 0;
    n_project = 0;
    n_order = 0;
    momentum = 0.0f;
    weight_decay = 0.0f;
    alpha = 0.0f;
    lnZ = 0.0f;
    norm_type = "none";
    norm_param = 10.0f;

    string token;
    while ( !iss.eof() ) {
        iss >> token;
        if ( token == "vocabulary" ) {
            iss >> n_vocab;
        }
        else if ( token == "projection" ) {
开发者ID:xmb-cipher,项目名称:iNCML-DNNLM,代码行数:31,代码来源:network.cpp

示例2: getPeaks

void TandemNativeParser::getPeaks(
  istringstream& tokenizer, ///< string version of values
  float* array,            ///< store values here
  int maxSize)              ///< array size
{
    // store values
    int curIdx = 0;
    while( !tokenizer.eof() ){
        assert(curIdx < maxSize);
        tokenizer >> array[curIdx];
        curIdx++;
    }
}
开发者ID:lgatto,项目名称:proteowizard,代码行数:13,代码来源:TandemNativeParser.cpp

示例3: ReadFace

bool OBJFile::ReadFace(istringstream& line){
    Face face;
    string vertex;

    while(!line.eof()){
        line >> vertex;
            vector<string> index;
            Split(vertex, index, "/");
            size_t current = strtoul(index[0].c_str(), NULL, 10)-1;
            face.Vertex.push_back(current);
    }
    m_faces.push_back(face);
    return true;

}
开发者ID:naonedier,项目名称:openDlpSlicer,代码行数:15,代码来源:OBJFile.cpp

示例4: loadBodyFromModelLoader

int loadBodyFromModelLoader(::World* world, const char* name, const char *URL, istringstream &strm)
{
    vector<string> argvec;
    while (!strm.eof()){
        string arg;
        strm >> arg;
        argvec.push_back(arg);
    }
    int argc = argvec.size();
    char **argv = new char *[argc];
    for (int i=0; i<argc; i++){
        argv[i] = (char *)argvec[i].c_str();
    }

	int ret = loadBodyFromModelLoader(world, name, URL, argc, argv);

    delete [] argv;

    return ret;
}
开发者ID:YoheiKakiuchi,项目名称:openhrp3-1,代码行数:20,代码来源:ModelLoaderUtil.cpp

示例5: getSequenceName

//********************************************************************************************************************
//this function will jump over commented out sequences, but if the last sequence in a file is commented out it makes a blank seq
Sequence::Sequence(istringstream& fastaString){
	try {
		m = MothurOut::getInstance();
	
		initialize();
        name = getSequenceName(fastaString);
		
		if (!m->control_pressed) { 
			string sequence;
		
			//read comments
			while ((name[0] == '#') && fastaString) { 
				while (!fastaString.eof())	{	char c = fastaString.get(); if (c == 10 || c == 13){	break;	}	} // get rest of line if there's any crap there
				sequence = getCommentString(fastaString);
				
				if (fastaString) {  
					fastaString >> name;  
					name = name.substr(1);	
				}else { 
					name = "";
					break;
				}
			}
			
			//while (!fastaString.eof())	{	char c = fastaString.get();  if (c == 10 || c == 13){ break;	}	} // get rest of line if there's any crap there
            comment = getCommentString(fastaString);
			
			int numAmbig = 0;
			sequence = getSequenceString(fastaString, numAmbig);
			
			setAligned(sequence);	
			//setUnaligned removes any gap characters for us						
			setUnaligned(sequence);	
			
			if ((numAmbig / (float) numBases) > 0.25) { m->mothurOut("[WARNING]: We found more than 25% of the bases in sequence " + name + " to be ambiguous. Mothur is not setup to process protein sequences."); m->mothurOutEndLine(); }
		}
开发者ID:jklynch,项目名称:mothur,代码行数:38,代码来源:sequence.cpp

示例6: loadKmer

}

/** Load k-mer with coverage data.
 * @return the number of k-mer loaded
 */
static size_t loadKmer(ISequenceCollection& g, FastaReader& in)
{
	assert(opt::rank == -1);
	size_t count = 0;
	for (FastaRecord rec; in >> rec;) {
		assert(rec.seq.size() == opt::kmerSize);
		istringstream iss(rec.id);
		float coverage = 1;
		iss >> coverage;
		assert(iss);
		assert(iss.eof());
		g.add(Kmer(rec.seq), max(1, (int)ceilf(coverage)));

		if (++count % 1000000 == 0) {
			logger(1) << "Read " << count << " k-mer. ";
			g.printLoad();
		}
		g.pumpNetwork();
	}
	assert(in.eof());
	return count;
}

/** Load sequence data into the collection. */
void loadSequences(ISequenceCollection* seqCollection, string inFile)
{
开发者ID:Hensonmw,项目名称:abyss,代码行数:31,代码来源:AssemblyAlgorithms.cpp


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