AUTh-ARL Core Stack
0.7
|
Tools for input/ouput, logging data etc. More...
Classes | |
class | arl::io::Logger |
Helper class providing logging capabilities. Useful in control loops for logging data and easily parsing to Matlab. More... | |
Functions | |
void | arl::io::read_mat (arma::mat &m, int64_t n_rows, int64_t n_cols, std::istream &in=std::cin, bool binary=false) |
Reads a 2D matrix from stream in. More... | |
void | arl::io::read_mat (arma::mat &m, std::istream &in=std::cin, bool binary=false) |
Reads a 2D matrix from stream in. More... | |
void | arl::io::read_vec (arma::vec &v, std::istream &in=std::cin, bool binary=false) |
Reads a column vector from stream in. More... | |
void | arl::io::read_rowVec (arma::rowvec &v, std::istream &in=std::cin, bool binary=false) |
Reads a row vector from stream in. More... | |
void | arl::io::read_vec_mat (std::vector< arma::mat > &m, std::istream &in=std::cin, bool binary=false) |
Reads a vector of 2D matrices from stream in. More... | |
void | arl::io::write_mat (const arma::mat &m, int n_rows, int n_cols, std::ostream &out=std::cout, bool binary=false) |
Writes a 2D matrix in stream 'fid'. More... | |
void | arl::io::write_mat (const arma::mat &m, std::ostream &out=std::cout, bool binary=false) |
Writes a 2D matrix in stream out. More... | |
void | arl::io::write_vec (arma::vec &v, std::ostream &out=std::cout, bool binary=false) |
Writes a column vector in stream out. More... | |
void | arl::io::write_rowVec (arma::rowvec &v, std::ostream &out=std::cout, bool binary=false) |
Writes a row vector in stream out. More... | |
void | arl::io::write_vec_mat (std::vector< arma::mat > &m, std::ostream &out=std::cout, bool binary=false) |
Writes a vector of 2D matrices in stream out. More... | |
Tools for input/ouput, logging data etc.
void arl::io::read_mat | ( | arma::mat & | m, |
int64_t | n_rows, | ||
int64_t | n_cols, | ||
std::istream & | in = std::cin , |
||
bool | binary = false |
||
) |
Reads a 2D matrix from stream in.
Reads the elements of the matrix row by row.
[out] | m | The 2D matrix |
[in] | n_rows | Number of rows of the matrix |
[in] | n_cols | Number of columns of the matrix |
[in] | in | The input stream (default = std::cin). |
[in] | binary | Flag indicating the format (true for binary, false for text, optional, default = false). |
void arl::io::read_mat | ( | arma::mat & | m, |
std::istream & | in = std::cin , |
||
bool | binary = false |
||
) |
Reads a 2D matrix from stream in.
Reads first the number of rows and columns and then the elements of the matrix row by row.
[out] | m | The 2D matrix |
[in] | in | The input stream (default = std::cin). |
[in] | binary | Flag indicating the format (true for binary, false for text, optional, default = false). |
void arl::io::read_rowVec | ( | arma::rowvec & | v, |
std::istream & | in = std::cin , |
||
bool | binary = false |
||
) |
Reads a row vector from stream in.
Reads the number of columns and then the elements of the vector.
[out] | v | The row vector |
[in] | in | The input stream (default = std::cin). |
[in] | binary | Flag indicating the format (true for binary, false for text, optional, default = false). |
void arl::io::read_vec | ( | arma::vec & | v, |
std::istream & | in = std::cin , |
||
bool | binary = false |
||
) |
Reads a column vector from stream in.
Reads the number of rows and then the elements of the vector.
[out] | v | The column vector |
[in] | in | The input stream (default = std::cin). |
[in] | binary | Flag indicating the format (true for binary, false for text, optional, default = false). |
void arl::io::read_vec_mat | ( | std::vector< arma::mat > & | m, |
std::istream & | in = std::cin , |
||
bool | binary = false |
||
) |
Reads a vector of 2D matrices from stream in.
Reads the number of 2D matrices, the number of rows and cols and the elements of each 2D matrix row by row.
[out] | m | cell array where each cell has a 2D matrix |
[in] | in | The input stream (default = std::cin). |
[in] | binary | Flag indicating the format (true for binary, false for text, optional, default = false). |
void arl::io::write_mat | ( | const arma::mat & | m, |
int | n_rows, | ||
int | n_cols, | ||
std::ostream & | out = std::cout , |
||
bool | binary = false |
||
) |
Writes a 2D matrix in stream 'fid'.
Writes the elements of the matrix row by row.
[in] | m | The 2D matrix |
[in] | n_rows | Number of rows of the matrix |
[in] | n_cols | Number of columns of the matrix |
[in] | out | The output stream (optional, default = 1 for output to screen). |
[in] | binary | Flag indicating the format (true for binary, false for text, optional, default = false). |
void arl::io::write_mat | ( | const arma::mat & | m, |
std::ostream & | out = std::cout , |
||
bool | binary = false |
||
) |
Writes a 2D matrix in stream out.
Writes first the number of rows and columns and then the elements of the matrix row by row.
[in] | m | The 2D matrix |
[in] | out | The output stream (optional, default = 1 for output to screen). |
[in] | binary | Flag indicating the format (true for binary, false for text, optional, default = false). |
void arl::io::write_rowVec | ( | arma::rowvec & | v, |
std::ostream & | out = std::cout , |
||
bool | binary = false |
||
) |
Writes a row vector in stream out.
Writes the number of columns and then the elements of the vector.
[in] | v | The row vector |
[in] | out | The output stream (optional, default = std::cout). |
[in] | binary | Flag indicating the format (true for binary, false for text, optional, default = false). |
void arl::io::write_vec | ( | arma::vec & | v, |
std::ostream & | out = std::cout , |
||
bool | binary = false |
||
) |
Writes a column vector in stream out.
Writes the number of rows and then the elements of the vector.
[out] | v | The column vector. |
[in] | out | The output stream (optional, default = std::cout). |
[in] | binary | Flag indicating the format (true for binary, false for text, optional, default = false). |
void arl::io::write_vec_mat | ( | std::vector< arma::mat > & | m, |
std::ostream & | out = std::cout , |
||
bool | binary = false |
||
) |
Writes a vector of 2D matrices in stream out.
Writes the number of 2D matrices, and thern the number of rows and cols and the elements of each 2D matrix row by row.
[out] | m | std::vector where each entry is a 2D matrix |
[in] | out | The output stream (optional, default = std::cout). |
[in] | binary | Flag indicating the format (true for binary, false for text, optional, default = false). |