#include <string>
#include <vector>
Go to the source code of this file.
◆ fill_vector()
void fill_vector |
( |
std::istream & |
istr, |
|
|
std::vector< double > & |
v |
|
) |
| |
Fills the double-vector v
with data from an input stream istr
until this input stream ends regularily. The vector is cleared and its memory is automatically allocated.
- Parameters
-
[in] | istr | input stream |
[out] | v | C++ vector with double values |
- Warning
- An exception is thrown in case of wrong data format or corrupted data.
◆ read_vector_from_file()
void read_vector_from_file |
( |
const std::string & |
file_name, |
|
|
std::vector< double > & |
v |
|
) |
| |
This function opens the ASCII-file named file_name
and reads the double data into the C++ vector v
. If the file file_name
does not exist then the code stops with an appropriate message.
- Parameters
-
[in] | file_name | name of the ASCII-file |
[out] | v | C++ vector with double values |
◆ write_vector_to_file()
void write_vector_to_file |
( |
const std::string & |
file_name, |
|
|
const std::vector< double > & |
v |
|
) |
| |
This function opens the ASCII-file named file_name
and rewrites its with the double data from the C++ vector v
. If there are problems in opening/generating file file_name
then the code stops with an appropriate message.
- Parameters
-
[in] | file_name | name of the ASCII-file |
[in] | v | C++ vector with double values |