Helper code to write calculation results into external files.
More...
#include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <vector>
#include <ctime>
#include <Eigen/Dense>
#include <boost/filesystem.hpp>
#include <boost/property_tree/ptree.hpp>
Go to the source code of this file.
|
void | alma::write_to_csv (const std::string filename, const Eigen::Ref< const Eigen::MatrixXd > &data, char colsep, bool append=false, std::string headermessage="") |
| Save a Matrix of double precision numbers as a csv file. More...
|
|
Eigen::MatrixXd | alma::read_from_csv (const std::string filename, char colsep, std::size_t skipheaderlines=0) |
| Read a csv file into a Matrix. More...
|
|
template<class C > |
C | alma::parseXMLfield (boost::property_tree::ptree::value_type const &v, std::string field) |
| Extract a value from an XML tree.
|
|
template<class C > |
bool | alma::probeXMLfield (boost::property_tree::ptree::value_type const &v, std::string field) |
| Check if an XML field is present.
|
|
Helper code to write calculation results into external files.
◆ read_from_csv()
Eigen::MatrixXd alma::read_from_csv |
( |
const std::string |
filename, |
|
|
char |
colsep, |
|
|
std::size_t |
skipheaderlines = 0 |
|
) |
| |
|
inline |
Read a csv file into a Matrix.
- Parameters
-
[in] | filename | - sourcefile location |
[in] | colsep | - column separation character |
[out] | data | matrix |
◆ write_to_csv()
void alma::write_to_csv |
( |
const std::string |
filename, |
|
|
const Eigen::Ref< const Eigen::MatrixXd > & |
data, |
|
|
char |
colsep, |
|
|
bool |
append = false , |
|
|
std::string |
headermessage = "" |
|
) |
| |
|
inline |
Save a Matrix of double precision numbers as a csv file.
- Parameters
-
[in] | filename | - target file location |
[in] | data | - matrix with data to save |
[in] | colsep | - column separation character |