Eötvös Quantum Utilities  v4.9.146
Providing the Horsepowers in the Quantum Realm
Functions
EQuUs_MATLAB.cpp File Reference

Helper functions for interlanguage conversions. More...

#include "mex.h"
#include <unistd.h>
#include <string.h>
#include "EQuUs_MATLAB.h"
Include dependency graph for EQuUs_MATLAB.cpp:

Go to the source code of this file.

Functions

void convert2FortranString (char *cstring, int strlength)
 Converts a C string into fortran compatible character array. More...
 
char ** getFieldnames (EQstruct *eq_struct)
 Get all the element names stored in the eq_struct structure prototype. More...
 
void regularizeEQstruct (EQstruct *eq_struct)
 Sort out invalid EQelements from an EQstruct structure prototype. More...
 
void setField (EQelement *eq_element, mxArray *Mstruct)
 Set a field in a MATLAB structure. More...
 
void setField (mxArray *field, const char *fieldname, mxArray *Mstruct)
 Set a field in a MATLAB structure. More...
 

Detailed Description

Helper functions for interlanguage conversions.

Definition in file EQuUs_MATLAB.cpp.

Function Documentation

◆ convert2FortranString()

void convert2FortranString ( char *  cstring,
int  strlength 
)

Converts a C string into fortran compatible character array.

Parameters
cstringThe C string to be converted into fortran compatible character array.
strlengthThe length of the string.

Definition at line 13 of file EQuUs_MATLAB.cpp.

◆ getFieldnames()

char** getFieldnames ( EQstruct eq_struct)

Get all the element names stored in the eq_struct structure prototype.

Parameters
eq_structa pointer to an EQstruct structure prototype.
Returns
Pointer to the fieldnames

Definition at line 30 of file EQuUs_MATLAB.cpp.

◆ regularizeEQstruct()

void regularizeEQstruct ( EQstruct eq_struct)

Sort out invalid EQelements from an EQstruct structure prototype.

Parameters
eq_structa pointer to an EQstruct structure prototype.

Definition at line 58 of file EQuUs_MATLAB.cpp.

Here is the call graph for this function:

◆ setField() [1/2]

void setField ( EQelement eq_element,
mxArray *  Mstruct 
)

Set a field in a MATLAB structure.

Parameters
eq_elementa pointer to an EQelement element prototype.
Mstructpointer to the MATLAB structure object.

Definition at line 109 of file EQuUs_MATLAB.cpp.

Here is the call graph for this function:

◆ setField() [2/2]

void setField ( mxArray *  field,
const char *  fieldname,
mxArray *  Mstruct 
)

Set a field in a MATLAB structure.

If the given field already exists, then converts the given field into a cell format.

Parameters
fielda pointer to an mxArray containing the data.
Mstructpointer to the MATLAB structure object.

Definition at line 197 of file EQuUs_MATLAB.cpp.