14 while ( istr >> d) {v.push_back(d);}
17 cout <<
" Error handling \n";
18 if ( istr.bad() ) {
throw runtime_error(
"Schwerer Fehler in istr");}
21 cout <<
" Failed in reading all data.\n";
31 ifstream fin(file_name);
39 cout <<
"\nFile " << file_name <<
" has not been found.\n\n" ;
40 assert( fin.is_open() &&
"File not found." );
46 ofstream fout(file_name);
49 for (
unsigned int k=0; k<v.size(); ++k)
51 fout << v.at(k) << endl;
56 cout <<
"\nFile " << file_name <<
" has not been opened.\n\n" ;
57 assert( fout.is_open() &&
"File not opened." );
void write_vector_to_file(const string &file_name, const vector< double > &v)
void read_vector_from_file(const string &file_name, vector< double > &v)
void fill_vector(istream &istr, vector< double > &v)