6 using namespace Kalman;
47 std::ifstream file(filename, std::ios::in);
49 std::string tmpstring;
63 tmpindex = strstr(tmpline,
"%");
71 a = tmpstring.find(
"=",0);
73 if (a!=std::string::npos)
76 tmpElement.
Name = tmpstring.substr(0,a);
79 b = tmpElement.
Name.find_last_of(
" ");
80 if (b!=std::string::npos)
82 tmpElement.
Name.erase(b);
89 tmpstring = tmpstring.substr(a+1, std::string::npos);
93 tmpvalue.erase(tmpvalue.begin(), tmpvalue.end());
94 for(
unsigned int i=0; i<tmpstring.size(); i++)
96 current = tmpstring[i];
100 tmpvalue.erase(tmpvalue.begin(), tmpvalue.end());
108 if (nbcol>tmpElement.
Cols)
109 tmpElement.
Cols=nbcol;
112 if (nbcol<tmpElement.
Cols)
122 if (nbcol>tmpElement.
Cols)
123 tmpElement.
Cols=nbcol;
141 tmpvalue.append(1,current);
153 std::cerr <<
"MFile::read: Can not open file "<<filename<<std::endl;
173 tmpdouble = atof(tmpstr.c_str());
174 Data.push_back(tmpdouble);
175 tmpstr.erase(tmpstr.begin(), tmpstr.end());
184 std::ofstream file(filename, std::ios::out|std::ios::trunc);
199 file<<
Data[index++]<<
" ";
201 file<<
";"<<std::endl;
204 file<<
"];"<<std::endl<<std::endl;
209 std::cerr <<
"MFile::save: Can not open file "<<filename<<std::endl;
std::vector< double > Data
MFileElement & operator=(const MFileElement &tmp)
std::vector< MFileElement > VectorMFileElement
bool add_double(std::string &tmpstr)