|
cyqlone
develop
Fast, parallel and vectorized solver for linear systems with optimal control structure.
|
Functions for exporting and loading matrices and OCP data to and from .mat files.
Files | |
| file | matio.hpp |
| Functions for exporting and loading matrices and OCP data to and from .mat files. | |
Typedefs | |
| using | cyqlone::mat_t = ::_mat_t |
| Incomplete matio struct type. | |
| using | cyqlone::MatFilePtr = std::unique_ptr<mat_t, int (*)(mat_t *)> |
| Owning handle to a matio file. The file will be closed when the handle goes out of scope. | |
Enumerations | |
| enum class | cyqlone::MatioOpenMode { cyqlone::MatioOpenMode::Read , cyqlone::MatioOpenMode::Write } |
Functions | |
| MatFilePtr | cyqlone::open_mat (const std::filesystem::path &filename, MatioOpenMode mode=MatioOpenMode::Read) |
| Opens a .mat file for reading or writing. | |
| MatFilePtr | cyqlone::create_mat (const std::filesystem::path &filename) |
| Create and open a new .mat file for writing. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, float value) |
| Add a value to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, double value) |
| Add a value to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, short value) |
| Add a value to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, int value) |
| Add a value to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, long value) |
| Add a value to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, long long value) |
| Add a value to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, unsigned short value) |
| Add a value to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, unsigned int value) |
| Add a value to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, unsigned long value) |
| Add a value to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, unsigned long long value) |
| Add a value to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, guanaqo::MatrixView< const double, index_t > data) |
| Add a matrix to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, guanaqo::MatrixView< const float, index_t > data) |
| Add a matrix to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, batmat::matrix::View< const double, index_t > data) |
| Add a batch of matrices to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, batmat::matrix::View< const float, index_t > data) |
| Add a batch of matrices to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, std::span< const float > data) |
| Add a vector to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, std::span< const double > data) |
| Add a vector to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, std::span< const unsigned short > data) |
| Add a vector to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, std::span< const unsigned int > data) |
| Add a vector to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, std::span< const unsigned long > data) |
| Add a vector to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, std::span< const unsigned long long > data) |
| Add a vector to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, std::span< const short > data) |
| Add a vector to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, std::span< const int > data) |
| Add a vector to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, std::span< const long > data) |
| Add a vector to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, std::span< const long long > data) |
| Add a vector to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, const SparseMatrix &matrix) |
| Add a sparse matrix to an open .mat file. | |
| void | cyqlone::add_to_mat (mat_t *mat, const std::string &varname, const LinearOCPStorage &ocp) |
| Add the data from a LinearOCPStorage to an open .mat file. | |
| void | cyqlone::read_from_mat (mat_t *mat, const std::string &varname, LinearOCPStorage &ocp) |
| Load a LinearOCPStorage from a .mat file. | |
| void | cyqlone::read_from_mat (mat_t *mat, const std::string &varname, std::vector< float > &data) |
| Load a vector from an open .mat file. | |
| void | cyqlone::read_from_mat (mat_t *mat, const std::string &varname, std::vector< double > &data) |
| Load a vector from an open .mat file. | |
| void | cyqlone::read_from_mat (mat_t *mat, const std::string &varname, std::span< float > data) |
| Load a vector from an open .mat file. | |
| void | cyqlone::read_from_mat (mat_t *mat, const std::string &varname, std::span< double > data) |
| Load a vector from an open .mat file. | |
| void | cyqlone::ocp_dump_mat (const std::filesystem::path &filename, const LinearOCPStorage &ocp) |
| Dump the data from a LinearOCPStorage to a new .mat file. | |
| using cyqlone::mat_t = ::_mat_t |
| typedef std::unique_ptr< mat_t, decltype(&Mat_Close)> cyqlone::MatFilePtr = std::unique_ptr<mat_t, int (*)(mat_t *)> |
#include <cyqlone/matio.hpp>
Owning handle to a matio file. The file will be closed when the handle goes out of scope.
|
strong |
| MatFilePtr cyqlone::open_mat | ( | const std::filesystem::path & | filename, |
| MatioOpenMode | mode = MatioOpenMode::Read ) |
#include <cyqlone/matio.hpp>
Opens a .mat file for reading or writing.
| runtime_error | if the file cannot be opened. |
| MatFilePtr cyqlone::create_mat | ( | const std::filesystem::path & | filename | ) |
#include <cyqlone/matio.hpp>
Create and open a new .mat file for writing.
| runtime_error | if the file cannot be opened. |
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| float | value ) |
#include <cyqlone/matio.hpp>
Add a value to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| double | value ) |
#include <cyqlone/matio.hpp>
Add a value to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| short | value ) |
#include <cyqlone/matio.hpp>
Add a value to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| int | value ) |
#include <cyqlone/matio.hpp>
Add a value to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| long | value ) |
#include <cyqlone/matio.hpp>
Add a value to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| long long | value ) |
#include <cyqlone/matio.hpp>
Add a value to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| unsigned short | value ) |
#include <cyqlone/matio.hpp>
Add a value to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| unsigned int | value ) |
#include <cyqlone/matio.hpp>
Add a value to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| unsigned long | value ) |
#include <cyqlone/matio.hpp>
Add a value to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| unsigned long long | value ) |
#include <cyqlone/matio.hpp>
Add a value to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| guanaqo::MatrixView< const double, index_t > | data ) |
#include <cyqlone/matio.hpp>
Add a matrix to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| guanaqo::MatrixView< const float, index_t > | data ) |
#include <cyqlone/matio.hpp>
Add a matrix to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| batmat::matrix::View< const double, index_t > | data ) |
#include <cyqlone/matio.hpp>
Add a batch of matrices to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| batmat::matrix::View< const float, index_t > | data ) |
#include <cyqlone/matio.hpp>
Add a batch of matrices to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| std::span< const float > | data ) |
#include <cyqlone/matio.hpp>
Add a vector to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| std::span< const double > | data ) |
#include <cyqlone/matio.hpp>
Add a vector to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| std::span< const unsigned short > | data ) |
#include <cyqlone/matio.hpp>
Add a vector to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| std::span< const unsigned int > | data ) |
#include <cyqlone/matio.hpp>
Add a vector to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| std::span< const unsigned long > | data ) |
#include <cyqlone/matio.hpp>
Add a vector to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| std::span< const unsigned long long > | data ) |
#include <cyqlone/matio.hpp>
Add a vector to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| std::span< const short > | data ) |
#include <cyqlone/matio.hpp>
Add a vector to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| std::span< const int > | data ) |
#include <cyqlone/matio.hpp>
Add a vector to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| std::span< const long > | data ) |
#include <cyqlone/matio.hpp>
Add a vector to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| std::span< const long long > | data ) |
#include <cyqlone/matio.hpp>
Add a vector to an open .mat file.
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| const SparseMatrix & | matrix ) |
#include <cyqlone/matio.hpp>
Add a sparse matrix to an open .mat file.
On the Python side, you can use the following code to load the sparse matrix:
| void cyqlone::add_to_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| const LinearOCPStorage & | ocp ) |
#include <cyqlone/matio.hpp>
Add the data from a LinearOCPStorage to an open .mat file.
| void cyqlone::read_from_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| LinearOCPStorage & | ocp ) |
#include <cyqlone/matio.hpp>
Load a LinearOCPStorage from a .mat file.
| void cyqlone::read_from_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| std::vector< float > & | data ) |
#include <cyqlone/matio.hpp>
Load a vector from an open .mat file.
| void cyqlone::read_from_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| std::vector< double > & | data ) |
#include <cyqlone/matio.hpp>
Load a vector from an open .mat file.
| void cyqlone::read_from_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| std::span< float > | data ) |
#include <cyqlone/matio.hpp>
Load a vector from an open .mat file.
| void cyqlone::read_from_mat | ( | mat_t * | mat, |
| const std::string & | varname, | ||
| std::span< double > | data ) |
#include <cyqlone/matio.hpp>
Load a vector from an open .mat file.
| void cyqlone::ocp_dump_mat | ( | const std::filesystem::path & | filename, |
| const LinearOCPStorage & | ocp ) |
#include <cyqlone/matio.hpp>
Dump the data from a LinearOCPStorage to a new .mat file.