本文整理汇总了C++中Series::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ Series::resize方法的具体用法?C++ Series::resize怎么用?C++ Series::resize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Series
的用法示例。
在下文中一共展示了Series::resize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readFile
void readFile()
{
ifstream infile;
string sLine, stmp;
int totalLines;
//le arquivo de entrada
infile.open("teste.txt");
totalLines = 0;
while(!infile.eof())
{
if(!infile.eof())
{
getline(infile, sLine);
totalLines++;
}
}
//rewind
infile.clear();
infile.seekg(0, std::ios::beg);
mySeries.resize(totalLines);
//cout <<"total lines:" << totalLines << endl;
int i = 0;
while(!infile.eof())
{
getline(infile, sLine);
istringstream eachLine(sLine);
while(!eachLine.eof())
{
eachLine >> stmp;
mySeries[i].push_back(atof(stmp.c_str()));
}
i++;
}
infile.close();
//le arquivo de treino (templates)
infile.open("treino.txt");
totalLines = 0;
while(!infile.eof())
{
if(!infile.eof())
{
getline(infile, sLine);
totalLines++;
}
}
//rewind
infile.clear();
infile.seekg(0, std::ios::beg);
templateSeries.resize(totalLines);
//cout <<"total lines:" << totalLines << endl;
i = 0;
while(!infile.eof())
{
getline(infile, sLine);
istringstream eachLine(sLine);
while(!eachLine.eof())
{
eachLine >> stmp;
templateSeries[i].push_back(atof(stmp.c_str()));
}
i++;
}
infile.close();
}