本文整理汇总了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" ) {
示例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++;
}
}
示例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;
}
示例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;
}
示例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(); }
}
示例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)
{