SAF
Loading...
Searching...
No Matches
safmex.h File Reference

Main include header for safmex. More...

#include "mex.h"
#include "saf.h"

Go to the source code of this file.

Macros

#define MSG_STR_LENGTH   ( 2048 )
 Warning/error message character length.
 

Enumerations

enum  MEX_DATA_TYPES {
  SM_INT32 = 0 , SM_DOUBLE_REAL , SM_DOUBLE_COMPLEX , SM_DOUBLE_REAL_1D ,
  SM_DOUBLE_COMPLEX_1D , SM_DOUBLE_REAL_1D_OR_2D , SM_DOUBLE_COMPLEX_1D_OR_2D , SM_DOUBLE_REAL_2D ,
  SM_DOUBLE_COMPLEX_2D , SM_DOUBLE_REAL_3D , SM_DOUBLE_COMPLEX_3D
}
 Supported SAF/MEX data conversions. More...
 

Functions

void checkNumInOutArgs (int nInputs, int nOutputs, int nInputs_expected, int nOutputs_expected)
 Helper function to check number of inputs/outputs arguments are as expected.
 
void checkArgDataTypes (mxArray **hData, MEX_DATA_TYPES *dataTypes, int nArgs)
 Helper function to check the format of the input/output arguments are as expected.
 
void MEXdouble2SAFsingle (const mxArray *in, float **out, int *nDims, int **pDims)
 Convert a mex double-precision array into single precision array for SAF.
 
void MEXdouble2SAFsingle_complex (const mxArray *in, float_complex **out, int *nDims, int **pDims)
 Convert a mex double-precision array into single precision array for SAF (complex-valued)
 
void MEXdouble2SAFsingle_int (const mxArray *in, int **out, int *nDims, int **pDims)
 Convert a mex double-precision array into single precision array for SAF (integers)
 
void SAFsingle2MEXdouble (float *in, int nDims, int *dims, mxArray **out)
 Convert a single precision array used by SAF to mex double-precision array.
 
void SAFsingle2MEXdouble_complex (float_complex *in, int nDims, int *dims, mxArray **out)
 Convert a single precision array used by SAF to mex double-precision array (complex valued)
 
void SAFsingle2MEXdouble_int (int *in, int nDims, int *dims, mxArray **out)
 Convert a single precision array used by SAF to mex double-precision array (integers)
 

Variables

char message [MSG_STR_LENGTH]
 Current warning/error message.
 

Detailed Description

Main include header for safmex.

Author
Leo McCormack
Date
06.08.2020

Definition in file safmex.h.

Macro Definition Documentation

◆ MSG_STR_LENGTH

#define MSG_STR_LENGTH   ( 2048 )

Warning/error message character length.

Definition at line 28 of file safmex.h.

Enumeration Type Documentation

◆ MEX_DATA_TYPES

Supported SAF/MEX data conversions.

Enumerator
SM_INT32 

Integer; 1 x 1.

SM_DOUBLE_REAL 

Scalar, real valued; 1 x 1.

SM_DOUBLE_COMPLEX 

Scalar, complex valued; 1 x 1.

SM_DOUBLE_REAL_1D 

Real 1-D vector; N x 1.

SM_DOUBLE_COMPLEX_1D 

Complex 1-D vector; N x 1.

SM_DOUBLE_REAL_1D_OR_2D 

Real 2-D matrix or 1-D vector; N x M | N x 1.

SM_DOUBLE_COMPLEX_1D_OR_2D 

Complex 2-D matrix or 1-D vector; N x M | N x 1.

SM_DOUBLE_REAL_2D 

Real 2-D matrix; N x M.

SM_DOUBLE_COMPLEX_2D 

Complex 2-D matrix; N x M.

SM_DOUBLE_REAL_3D 

Real 3-D matrix; N x M x K.

SM_DOUBLE_COMPLEX_3D 

Complex 3-D matrix; N x M x K.

Definition at line 33 of file safmex.h.

Function Documentation

◆ checkArgDataTypes()

void checkArgDataTypes ( mxArray ** hData,
MEX_DATA_TYPES * dataTypes,
int nArgs )

Helper function to check the format of the input/output arguments are as expected.

Definition at line 64 of file safmex.h.

◆ checkNumInOutArgs()

void checkNumInOutArgs ( int nInputs,
int nOutputs,
int nInputs_expected,
int nOutputs_expected )

Helper function to check number of inputs/outputs arguments are as expected.

Definition at line 51 of file safmex.h.

◆ MEXdouble2SAFsingle()

void MEXdouble2SAFsingle ( const mxArray * in,
float ** out,
int * nDims,
int ** pDims )

Convert a mex double-precision array into single precision array for SAF.

Definition at line 151 of file safmex.h.

◆ MEXdouble2SAFsingle_complex()

void MEXdouble2SAFsingle_complex ( const mxArray * in,
float_complex ** out,
int * nDims,
int ** pDims )

Convert a mex double-precision array into single precision array for SAF (complex-valued)

Definition at line 199 of file safmex.h.

◆ MEXdouble2SAFsingle_int()

void MEXdouble2SAFsingle_int ( const mxArray * in,
int ** out,
int * nDims,
int ** pDims )

Convert a mex double-precision array into single precision array for SAF (integers)

Definition at line 264 of file safmex.h.

◆ SAFsingle2MEXdouble()

void SAFsingle2MEXdouble ( float * in,
int nDims,
int * dims,
mxArray ** out )

Convert a single precision array used by SAF to mex double-precision array.

Definition at line 309 of file safmex.h.

◆ SAFsingle2MEXdouble_complex()

void SAFsingle2MEXdouble_complex ( float_complex * in,
int nDims,
int * dims,
mxArray ** out )

Convert a single precision array used by SAF to mex double-precision array (complex valued)

Definition at line 343 of file safmex.h.

◆ SAFsingle2MEXdouble_int()

void SAFsingle2MEXdouble_int ( int * in,
int nDims,
int * dims,
mxArray ** out )

Convert a single precision array used by SAF to mex double-precision array (integers)

Definition at line 410 of file safmex.h.

Variable Documentation

◆ message

char message[MSG_STR_LENGTH]

Current warning/error message.

Definition at line 29 of file safmex.h.