AUTh-ARL Core Stack  0.7
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Input/Output

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...
 

Detailed Description

Tools for input/ouput, logging data etc.

Function Documentation

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.

Parameters
[out]mThe 2D matrix
[in]n_rowsNumber of rows of the matrix
[in]n_colsNumber of columns of the matrix
[in]inThe input stream (default = std::cin).
[in]binaryFlag 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.

Parameters
[out]mThe 2D matrix
[in]inThe input stream (default = std::cin).
[in]binaryFlag indicating the format (true for binary, false for text, optional, default = false).

Here is the call graph for this function:

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.

Parameters
[out]vThe row vector
[in]inThe input stream (default = std::cin).
[in]binaryFlag indicating the format (true for binary, false for text, optional, default = false).

Here is the call graph for this function:

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.

Parameters
[out]vThe column vector
[in]inThe input stream (default = std::cin).
[in]binaryFlag indicating the format (true for binary, false for text, optional, default = false).

Here is the call graph for this function:

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.

Parameters
[out]mcell array where each cell has a 2D matrix
[in]inThe input stream (default = std::cin).
[in]binaryFlag indicating the format (true for binary, false for text, optional, default = false).

Here is the call graph for this function:

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.

Parameters
[in]mThe 2D matrix
[in]n_rowsNumber of rows of the matrix
[in]n_colsNumber of columns of the matrix
[in]outThe output stream (optional, default = 1 for output to screen).
[in]binaryFlag 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.

Parameters
[in]mThe 2D matrix
[in]outThe output stream (optional, default = 1 for output to screen).
[in]binaryFlag indicating the format (true for binary, false for text, optional, default = false).

Here is the call graph for this function:

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.

Parameters
[in]vThe row vector
[in]outThe output stream (optional, default = std::cout).
[in]binaryFlag indicating the format (true for binary, false for text, optional, default = false).

Here is the call graph for this function:

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.

Parameters
[out]vThe column vector.
[in]outThe output stream (optional, default = std::cout).
[in]binaryFlag indicating the format (true for binary, false for text, optional, default = false).

Here is the call graph for this function:

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.

Parameters
[out]mstd::vector where each entry is a 2D matrix
[in]outThe output stream (optional, default = std::cout).
[in]binaryFlag indicating the format (true for binary, false for text, optional, default = false).

Here is the call graph for this function: