Skip to content
Snippets Groups Projects
Commit d93352d2 authored by Martin Beseda's avatar Martin Beseda
Browse files

ENH: Added method for saving DataSet values to the text file.

parent f3df8205
No related branches found
No related tags found
No related merge requests found
......@@ -195,6 +195,22 @@ namespace lib4neuro {
}
}
void DataSet::store_data_text(std::ofstream* file_path) {
for (auto e : this->data) {
/* First part of the pair */
for (unsigned int i = 0; i < e.first.size() - 1; i++) {
*file_path << e.first.at(i) << ",";
}
*file_path << e.first.back() << " ";
/* Second part of the pair */
for (unsigned int i = 0; i < e.second.size() - 1; i++) {
*file_path << e.second.at(i) << ",";
}
*file_path << e.second.back() << std::endl;
}
}
void DataSet::store_data_text(std::string file_path) {
std::ofstream ofs(file_path);
......
......@@ -215,6 +215,12 @@ namespace lib4neuro {
*/
LIB4NEURO_API void store_text(std::string file_path);
/**
*
* @param file_path
*/
LIB4NEURO_API void store_data_text(std::ofstream* file_path);
/**
* Stores the data to the text file in a human readable format
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment