Allows us to handle the MATLAB arrays from the input file in a human-readable format.
More...
#include <input_matrices.h>
|
int | index_from_matrix_name (const std::string &matrix_name) |
| Fetches the index of matrix_name in the tdms_matrix_names::matrixnames array.
|
|
const mxArray * | operator[] (int index) |
| Fetch a (pointer to a) MATLAB input matrix by index reference.
|
|
const mxArray * | operator[] (const std::string &matrix_name) |
| Fetch a (pointer to a) MATLAB input matrix by name.
|
|
void | set_matrix_pointer (int index, mxArray *new_ptr) |
| Set the matrix pointer with the given index.
|
|
void | set_matrix_pointer (const std::string &matrix_name, mxArray *new_ptr) |
| Set the pointer to the named matrix.
|
|
void | set_from_input_file (const char *mat_filename) |
| Open the input mat file, load the matrices, and setup pointers to the matrices.
|
|
void | set_from_input_file (const char *mat_filename, const char *gridfile) |
| Open the input mat file, load the matrices, and setup pointers to the matrices.
|
|
|
void | assign_matrix_pointers (MatrixCollection &expected, MatFileMatrixCollection &actual) |
| Assigns pointers to the matrices in an input file, based on those we are expecting to recieve.
|
|
void | validate_assigned_pointers () |
| Validates that the MATLAB arrays that we are pointing to are of the type that we expect.
|
|
|
const mxArray * | matrix_pointers [NMATRICES] |
|
Allows us to handle the MATLAB arrays from the input file in a human-readable format.
◆ assign_matrix_pointers()
Assigns pointers to the matrices in an input file, based on those we are expecting to recieve.
MatrixCollection is a list of names of matrices we expect to be in the MatFileMatrixCollection, based on whether we are reading from a gridfile, input_file without a gridfile, or an input file that came with a gridfile.
- Parameters
-
expected | The matrices we expect to be able to pull from actual |
actual | The matrices saved in an input file, to be loaded |
◆ index_from_matrix_name()
int InputMatrices::index_from_matrix_name |
( |
const std::string & |
matrix_name | ) |
|
Fetches the index of matrix_name in the tdms_matrix_names::matrixnames array.
- Parameters
-
matrix_name | The matrix name to locate |
- Returns
- int The corresponding index
◆ operator[]() [1/2]
const mxArray * InputMatrices::operator[] |
( |
const std::string & |
matrix_name | ) |
|
|
inline |
Fetch a (pointer to a) MATLAB input matrix by name.
- Parameters
-
matrix_name | Name of the matrix to fetch the pointer to |
- Returns
- const mxArray* Pointer to the corresponding MATLAB array
◆ operator[]() [2/2]
const mxArray * InputMatrices::operator[] |
( |
int |
index | ) |
|
|
inline |
Fetch a (pointer to a) MATLAB input matrix by index reference.
Index-references can be computed through index_from_matrix_name. They are ordered in the same way as the names in tdms_matrix_names::matrixnames.
- Parameters
-
- Returns
- const mxArray* Pointer to the corresponding MATLAB array
◆ set_from_input_file() [1/2]
void InputMatrices::set_from_input_file |
( |
const char * |
mat_filename | ) |
|
Open the input mat file, load the matrices, and setup pointers to the matrices.
- Parameters
-
mat_filename | The MATLAB filename |
◆ set_from_input_file() [2/2]
void InputMatrices::set_from_input_file |
( |
const char * |
mat_filename, |
|
|
const char * |
gridfile |
|
) |
| |
Open the input mat file, load the matrices, and setup pointers to the matrices.
- Parameters
-
mat_filename | The MATLAB filename |
gridfile | The additional gridfile |
◆ set_matrix_pointer() [1/2]
void InputMatrices::set_matrix_pointer |
( |
const std::string & |
matrix_name, |
|
|
mxArray * |
new_ptr |
|
) |
| |
|
inline |
Set the pointer to the named matrix.
- Parameters
-
matrix_name | The name of the matrix that we want to set the pointer to |
new_ptr | The address we want to assign |
◆ set_matrix_pointer() [2/2]
void InputMatrices::set_matrix_pointer |
( |
int |
index, |
|
|
mxArray * |
new_ptr |
|
) |
| |
|
inline |
Set the matrix pointer with the given index.
Not recommended unless you're certain you are setting the correct array pointer! Use the overload which takes the array name as an input if you are uncertain you are setting the correct pointer.
This function mainly sees use during destruction (and output writing) when we just want to iterate over all the matrices that we are dealing with.
- Parameters
-
index | The index in matrix_pointers to set |
new_ptr | The address we want to assign |
◆ input_filename
std::string InputMatrices::input_filename |
Name of the input file from which MATLAB objects were extracted. Akward middle-child between full removal of MATLAB and the slow removal of class dependencies
The documentation for this class was generated from the following files: