cyqlone develop
Fast, parallel and vectorized solver for linear systems with optimal control structure.
Loading...
Searching...
No Matches
matio.hpp File Reference

Detailed Description

Functions for exporting and loading matrices and OCP data to and from .mat files.

Definition in file matio.hpp.

#include <cyqlone/config.hpp>
#include <cyqlone/ocp.hpp>
#include <cyqlone/sparse.hpp>
#include <batmat/matrix/view.hpp>
#include <filesystem>
#include <memory>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  cyqlone

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.