Classes | |
class | GenericContainer |
The GenericContainer class provides a flexible container for storing heterogeneous data types. More... | |
class | LuaInterpreter |
A class implementing a simple Lua interpreter. More... | |
class | mat_type |
Generic matrix storage type. More... |
Typedefs | |
using | ostream_type = std::basic_ostream<char> |
Alias for a character-based output stream. | |
using | istream_type = std::basic_istream<char> |
Alias for a character-based input stream. | |
using | mat_int_type = mat_type<int_type> |
using | mat_long_type = mat_type<long_type> |
using | mat_real_type = mat_type<real_type> |
using | mat_complex_type = mat_type<complex_type> |
using | TypeAllowed |
Enum class representing types allowed for the GenericContainer. |
Functions | |
string_view | to_string (GC_type s) |
Converts the GC_type enum value to a string representation. | |
string | to_string (complex_type const &v) |
template<typename TYPE> | |
ostream_type & | operator<< (ostream_type &s, vector< TYPE > const &v) |
Overload of the operator<< for printing a vector of elements of a generic type. | |
template<typename TYPE> | |
ostream_type & | operator<< (ostream_type &s, mat_type< TYPE > const &mat) |
Overload of the operator<< for printing a matrix of elements of a generic type. | |
void | write_table (vec_string_type const &headers, vector_type const &data, ostream_type &stream, char delimiter='\t') |
void | writeTable (vec_string_type const &headers, vector_type const &data, ostream_type &stream, char delimiter='\t') |
void | write_table (vec_string_type const &headers, mat_real_type const &data, ostream_type &stream, char delimiter='\t') |
void | writeTable (vec_string_type const &headers, mat_real_type const &data, ostream_type &stream, char delimiter='\t') |
void | write_table_formatted (vec_string_type const &headers, vector_type const &data, ostream_type &stream) |
void | writeTableFormatted (vec_string_type const &headers, vector_type const &data, ostream_type &stream) |
void | write_table_formatted (vec_string_type const &headers, mat_real_type const &data, ostream_type &stream) |
void | writeTableFormatted (vec_string_type const &headers, mat_real_type const &data, ostream_type &stream) |
void | string_escape (ostream_type &stream, string const &s) |
bool | file_JSON_to_GC (string const &file_name, GenericContainer &gc) |
bool | JSON_to_GC (istream_type &stream, GenericContainer &gc) |
bool | JSON_to_GC (string const &DATA, GenericContainer &gc) |
void | GC_to_JSON (GenericContainer const &gc, std::string &res) |
void | GC_to_JSON (GenericContainer const &gc, ostream_type &stream) |
void | Lua_global_to_GC (void *void_L, char const *global_var, GenericContainer &gc) |
Convert a Lua global variable to a GenericContainer. | |
void | Lua_GC_to_global (void *void_L, GenericContainer const &gc, char const *global_var) |
Convert a GenericContainer to a Lua global variable. | |
void | mxArray_to_GenericContainer (mxArray const *mx, GenericContainer &gc) |
void | mxSparse_to_GenericContainer (mxArray const *mx, GenericContainer &gc) |
void | GenericContainer_to_mxArray (GenericContainer const &gc, mxArray *&mx) |
void | mexPrint (GenericContainer const &gc) |
void | to_mxArray (bool const &val, mxArray *&mx) |
void | to_mxArray (int_type const &val, mxArray *&mx) |
void | to_mxArray (long_type const &val, mxArray *&mx) |
void | to_mxArray (real_type const &val, mxArray *&mx) |
void | to_mxArray (complex_type const &val, mxArray *&mx) |
void | to_mxArray (string_view val, mxArray *&mx) |
void | to_mxArray (vec_bool_type const &val, mxArray *&mx) |
void | to_mxArray (vec_int_type const &val, mxArray *&mx) |
void | to_mxArray (vec_long_type const &val, mxArray *&mx) |
void | to_mxArray (vec_real_type const &val, mxArray *&mx) |
void | to_mxArray (vec_complex_type const &val, mxArray *&mx) |
void | to_mxArray (vec_string_type const &val, mxArray *&mx) |
void | to_mxArray (mat_int_type const &val, mxArray *&mx) |
void | to_mxArray (mat_long_type const &val, mxArray *&mx) |
void | to_mxArray (mat_real_type const &val, mxArray *&mx) |
void | to_mxArray (mat_complex_type const &val, mxArray *&mx) |
bool | file_TOML_to_GC (string_view file_name, GenericContainer &gc) |
bool | TOML_to_GC (istream_type &stream, GenericContainer &gc) |
bool | TOML_to_GC (string const &DATA, GenericContainer &gc) |
void | GC_to_TOML (GenericContainer const &gc, std::string &res) |
void | GC_to_TOML (GenericContainer const &gc, ostream_type &stream) |
bool | file_YAML_to_GC (string_view file_name, GenericContainer &gc) |
bool | YAML_to_GC (istream_type &stream, GenericContainer &gc) |
bool | YAML_to_GC (string const &DATA, GenericContainer &gc) |
void | GC_to_YAML (GenericContainer const &gc, std::string &res) |
void | GC_to_YAML (GenericContainer const &gc, ostream_type &stream) |
Variables | |
unsigned | stream_number_precision {12} |
Namespace for the Generic Container
using GC_namespace::istream_type = std::basic_istream<char> |
Alias for a character-based input stream.
This alias represents a basic_istream specialized for char types, which is typically used for standard input operations like cin or file input streams.
using GC_namespace::mat_complex_type = mat_type<complex_type> |
using GC_namespace::mat_int_type = mat_type<int_type> |
using GC_namespace::mat_long_type = mat_type<long_type> |
using GC_namespace::mat_real_type = mat_type<real_type> |
using GC_namespace::ostream_type = std::basic_ostream<char> |
Alias for a character-based output stream.
This alias represents a basic_ostream specialized for char types, which is typically used for standard output operations like cout or file output streams.
Enum class representing types allowed for the GenericContainer.
This enum class defines the types that are allowed to be used in the GenericContainer. The types are categorized as simple types, vector types, matrix types, and complex types.
void GC_namespace::GenericContainer_to_mxArray | ( | GenericContainer const & | gc, |
mxArray *& | mx ) |
Convert GenericContainer to an mxArray
void GC_namespace::mexPrint | ( | GenericContainer const & | gc | ) |
Print the contents of GenericContainer to teh MATLAB console
void GC_namespace::mxArray_to_GenericContainer | ( | mxArray const * | mx, |
GenericContainer & | gc ) |
Convert an mxArray to a GenericContainer
void GC_namespace::mxSparse_to_GenericContainer | ( | mxArray const * | mx, |
GenericContainer & | gc ) |
Convert an mxArray containing a sparse matrix to a GenericContainer. The GenericContainer will constain a map with the sparse matrix in compressed column format (https://en.wikipedia.org/wiki/Sparse_matrix)
ostream_type & GC_namespace::operator<< | ( | ostream_type & | s, |
mat_type< TYPE > const & | mat ) |
Overload of the operator<< for printing a matrix of elements of a generic type.
This function allows the printing of a mat_type object, which represents a matrix containing elements of type TYPE. The matrix is typically printed in a row-by-row format.
TYPE | The type of the elements contained in the matrix. |
s | The output stream to write to (e.g., cout or a ostringstream). |
mat | The mat_type object to print, representing the matrix. |
ostream_type & GC_namespace::operator<< | ( | ostream_type & | s, |
vector< TYPE > const & | v ) |
Overload of the operator<< for printing a vector of elements of a generic type.
This function allows the printing of a vector containing elements of type TYPE. The elements are typically printed in a comma-separated format inside square brackets.
TYPE | The type of the elements contained in the vector. |
s | The output stream to write to (e.g., cout or a ostringstream). |
v | The vector object to print. |
void GC_namespace::string_escape | ( | ostream_type & | stream, |
string const & | s ) |
Utrility to write sctring escaping non printable
void GC_namespace::to_mxArray | ( | bool const & | val, |
mxArray *& | mx ) |
Convert a boolean to a mxArray
void GC_namespace::to_mxArray | ( | complex_type const & | val, |
mxArray *& | mx ) |
Convert a complex number to a mxArray
void GC_namespace::to_mxArray | ( | int_type const & | val, |
mxArray *& | mx ) |
Convert an integer to a mxArray
void GC_namespace::to_mxArray | ( | long_type const & | val, |
mxArray *& | mx ) |
Convert a long integer to a mxArray
void GC_namespace::to_mxArray | ( | mat_complex_type const & | val, |
mxArray *& | mx ) |
Convert a matrix of complex number to a mxArray
void GC_namespace::to_mxArray | ( | mat_int_type const & | val, |
mxArray *& | mx ) |
Convert a matrix of integer to a mxArray
void GC_namespace::to_mxArray | ( | mat_long_type const & | val, |
mxArray *& | mx ) |
Convert a matrix of long integer to a mxArray
void GC_namespace::to_mxArray | ( | mat_real_type const & | val, |
mxArray *& | mx ) |
Convert a matrix of real number to a mxArray
void GC_namespace::to_mxArray | ( | real_type const & | val, |
mxArray *& | mx ) |
Convert a real number to a mxArray
void GC_namespace::to_mxArray | ( | string_view | val, |
mxArray *& | mx ) |
Convert a string integer to a mxArray
void GC_namespace::to_mxArray | ( | vec_bool_type const & | val, |
mxArray *& | mx ) |
Convert a vector of boolean to a mxArray
void GC_namespace::to_mxArray | ( | vec_complex_type const & | val, |
mxArray *& | mx ) |
Convert a vector of complex number to a mxArray
void GC_namespace::to_mxArray | ( | vec_int_type const & | val, |
mxArray *& | mx ) |
Convert a vector of integer to a mxArray
void GC_namespace::to_mxArray | ( | vec_long_type const & | val, |
mxArray *& | mx ) |
Convert a vector of long integer to a mxArray
void GC_namespace::to_mxArray | ( | vec_real_type const & | val, |
mxArray *& | mx ) |
Convert a vector of real number to a mxArray
void GC_namespace::to_mxArray | ( | vec_string_type const & | val, |
mxArray *& | mx ) |
Convert a vector of string to a mxArray. The data will be a cell array.
string GC_namespace::to_string | ( | complex_type const & | v | ) |
string_view GC_namespace::to_string | ( | GC_type | s | ) |
Converts the GC_type enum value to a string representation.
This function takes a GC_type enum value and returns a corresponding string representation for easier debugging and logging.
s | The GC_type enum value to convert. |
void GC_namespace::write_table | ( | vec_string_type const & | headers, |
mat_real_type const & | data, | ||
ostream_type & | stream, | ||
char | delimiter = '\t' ) |
Write data as a table
[in] | headers | vector of string with the header of the table |
[in] | data | matrix of real_type with the columns of the table |
[in] | stream | output stream |
[in] | delimiter | delimiter character between columns |
void GC_namespace::write_table | ( | vec_string_type const & | headers, |
vector_type const & | data, | ||
ostream_type & | stream, | ||
char | delimiter = '\t' ) |
Write data as a table
[in] | headers | vector of string with the header of the table |
[in] | data | vector of GenericContainer with the columns of the table |
[in] | stream | output stream |
[in] | delimiter | delimiter character between columns |
void GC_namespace::write_table_formatted | ( | vec_string_type const & | headers, |
mat_real_type const & | data, | ||
ostream_type & | stream ) |
Write data as a table
[in] | headers | vector of string with the header of the table |
[in] | data | matrix of real_type with the columns of the table |
[in] | stream | output stream |
void GC_namespace::write_table_formatted | ( | vec_string_type const & | headers, |
vector_type const & | data, | ||
ostream_type & | stream ) |
Write data as a table
[in] | headers | vector of string with the header of the table |
[in] | data | matrix of real_type with the columns of the table |
[in] | stream | output stream |
|
inline |
|
inline |
|
inline |
|
inline |
unsigned GC_namespace::stream_number_precision {12} |
precision used in printing number