GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
mex.cc File Reference
#include <cstdarg>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <limits>
#include <map>
#include <set>
#include <string>
#include "f77-fcn.h"
#include "lo-ieee.h"
#include "oct-locbuf.h"
#include "quit.h"
#include "Cell.h"
#include "call-stack.h"
#include "error.h"
#include "interpreter-private.h"
#include "interpreter.h"
#include "mxarray.h"
#include "mexproto.h"
#include "oct-map.h"
#include "ovl.h"
#include "ov.h"
#include "ov-mex-fcn.h"
#include "ov-usr-fcn.h"
#include "pager.h"
#include "parse.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
#include "graphics.h"
Include dependency graph for mex.cc:

Go to the source code of this file.

Classes

class  mex
 
class  mxArray_cell
 
class  mxArray_matlab
 
class  mxArray_number
 
class  mxArray_octave_value
 
class  mxArray_sparse
 
class  mxArray_struct
 

Typedefs

typedef void(* cmex_fptr) (int nlhs, mxArray **plhs, int nrhs, mxArray **prhs)
 
typedef F77_RET_T(* fmex_fptr) (F77_INT &nlhs, mxArray **plhs, F77_INT &nrhs, mxArray **prhs)
 

Functions

static mwIndex calc_single_subscript_internal (mwSize ndims, const mwSize *dims, mwSize nsubs, const mwIndex *subs)
 
octave_value_list call_mex (octave_mex_function &mex_fcn, const octave_value_list &args, int nargout_arg)
 
static mwSize max_str_len (mwSize m, const char **str)
 
static mxArraymaybe_mark_array (mxArray *ptr)
 
static void * maybe_mark_foreign (void *ptr)
 
static void * maybe_unmark (void *ptr)
 
static mxArraymaybe_unmark_array (mxArray *ptr)
 
int mexAtExit (void(*f)(void))
 
int mexCallMATLAB (int nargout, mxArray *argout[], int nargin, mxArray *argin[], const char *fname)
 
mxArraymexCallMATLABWithTrap (int nargout, mxArray *argout[], int nargin, mxArray *argin[], const char *fname)
 
void mexErrMsgIdAndTxt (const char *id, const char *fmt,...)
 
void mexErrMsgTxt (const char *s)
 
int mexEvalString (const char *s)
 
mxArraymexEvalStringWithTrap (const char *s)
 
const char * mexFunctionName (void)
 
const mxArraymexGet (double handle, const char *property)
 
mxArraymexGetVariable (const char *space, const char *name)
 
const mxArraymexGetVariablePtr (const char *space, const char *name)
 
int mexIsGlobal (const mxArray *ptr)
 
int mexIsLocked (void)
 
void mexLock (void)
 
void mexMakeArrayPersistent (mxArray *ptr)
 
void mexMakeMemoryPersistent (void *ptr)
 
int mexPrintf (const char *fmt,...)
 
int mexPutVariable (const char *space, const char *name, const mxArray *ptr)
 
int mexSet (double handle, const char *property, mxArray *val)
 
void mexSetTrapFlag (int flag)
 
void mexUnlock (void)
 
void mexWarnMsgIdAndTxt (const char *id, const char *fmt,...)
 
void mexWarnMsgTxt (const char *s)
 
int mxAddField (mxArray *ptr, const char *key)
 
char * mxArrayToString (const mxArray *ptr)
 
mwIndex mxCalcSingleSubscript (const mxArray *ptr, mwSize nsubs, mwIndex *subs)
 
void * mxCalloc (size_t n, size_t size)
 
mxArraymxCreateCellArray (mwSize ndims, const mwSize *dims)
 
mxArraymxCreateCellMatrix (mwSize m, mwSize n)
 
mxArraymxCreateCharArray (mwSize ndims, const mwSize *dims)
 
mxArraymxCreateCharMatrixFromStrings (mwSize m, const char **str)
 
mxArraymxCreateDoubleMatrix (mwSize m, mwSize n, mxComplexity flag)
 
mxArraymxCreateDoubleScalar (double val)
 
mxArraymxCreateLogicalArray (mwSize ndims, const mwSize *dims)
 
mxArraymxCreateLogicalMatrix (mwSize m, mwSize n)
 
mxArraymxCreateLogicalScalar (mxLogical val)
 
mxArraymxCreateNumericArray (mwSize ndims, const mwSize *dims, mxClassID class_id, mxComplexity flag)
 
mxArraymxCreateNumericMatrix (mwSize m, mwSize n, mxClassID class_id, mxComplexity flag)
 
mxArraymxCreateSparse (mwSize m, mwSize n, mwSize nzmax, mxComplexity flag)
 
mxArraymxCreateSparseLogicalMatrix (mwSize m, mwSize n, mwSize nzmax)
 
mxArraymxCreateString (const char *str)
 
mxArraymxCreateStructArray (mwSize ndims, const mwSize *dims, int num_keys, const char **keys)
 
mxArraymxCreateStructMatrix (mwSize m, mwSize n, int num_keys, const char **keys)
 
mxArraymxCreateUninitNumericArray (mwSize ndims, const mwSize *dims, mxClassID class_id, mxComplexity flag)
 
mxArraymxCreateUninitNumericMatrix (mwSize m, mwSize n, mxClassID class_id, mxComplexity flag)
 
void mxDestroyArray (mxArray *ptr)
 
mxArraymxDuplicateArray (const mxArray *ptr)
 
void mxFree (void *ptr)
 
mxArraymxGetCell (const mxArray *ptr, mwIndex idx)
 
mxCharmxGetChars (const mxArray *ptr)
 
mxClassID mxGetClassID (const mxArray *ptr)
 
const char * mxGetClassName (const mxArray *ptr)
 
void * mxGetData (const mxArray *ptr)
 
const mwSizemxGetDimensions (const mxArray *ptr)
 
size_t mxGetElementSize (const mxArray *ptr)
 
double mxGetEps (void)
 
mxArraymxGetField (const mxArray *ptr, mwIndex index, const char *key)
 
mxArraymxGetFieldByNumber (const mxArray *ptr, mwIndex index, int key_num)
 
const char * mxGetFieldNameByNumber (const mxArray *ptr, int key_num)
 
int mxGetFieldNumber (const mxArray *ptr, const char *key)
 
void * mxGetImagData (const mxArray *ptr)
 
double mxGetInf (void)
 
mwIndexmxGetIr (const mxArray *ptr)
 
mwIndexmxGetJc (const mxArray *ptr)
 
mxLogicalmxGetLogicals (const mxArray *ptr)
 
size_t mxGetM (const mxArray *ptr)
 
size_t mxGetN (const mxArray *ptr)
 
double mxGetNaN (void)
 
mwSize mxGetNumberOfDimensions (const mxArray *ptr)
 
size_t mxGetNumberOfElements (const mxArray *ptr)
 
int mxGetNumberOfFields (const mxArray *ptr)
 
mwSize mxGetNzmax (const mxArray *ptr)
 
doublemxGetPi (const mxArray *ptr)
 
doublemxGetPr (const mxArray *ptr)
 
mxArraymxGetProperty (const mxArray *ptr, mwIndex idx, const char *property_name)
 
double mxGetScalar (const mxArray *ptr)
 
int mxGetString (const mxArray *ptr, char *buf, mwSize buflen)
 
bool mxIsCell (const mxArray *ptr)
 
bool mxIsChar (const mxArray *ptr)
 
bool mxIsClass (const mxArray *ptr, const char *name)
 
bool mxIsComplex (const mxArray *ptr)
 
bool mxIsDouble (const mxArray *ptr)
 
bool mxIsEmpty (const mxArray *ptr)
 
bool mxIsFinite (const double v)
 
bool mxIsFromGlobalWS (const mxArray *)
 
bool mxIsFunctionHandle (const mxArray *ptr)
 
bool mxIsInf (const double v)
 
bool mxIsInt16 (const mxArray *ptr)
 
bool mxIsInt32 (const mxArray *ptr)
 
bool mxIsInt64 (const mxArray *ptr)
 
bool mxIsInt8 (const mxArray *ptr)
 
bool mxIsLogical (const mxArray *ptr)
 
bool mxIsLogicalScalar (const mxArray *ptr)
 
bool mxIsLogicalScalarTrue (const mxArray *ptr)
 
bool mxIsNaN (const double v)
 
bool mxIsNumeric (const mxArray *ptr)
 
bool mxIsScalar (const mxArray *ptr)
 
bool mxIsSingle (const mxArray *ptr)
 
bool mxIsSparse (const mxArray *ptr)
 
bool mxIsStruct (const mxArray *ptr)
 
bool mxIsUint16 (const mxArray *ptr)
 
bool mxIsUint32 (const mxArray *ptr)
 
bool mxIsUint64 (const mxArray *ptr)
 
bool mxIsUint8 (const mxArray *ptr)
 
void * mxMalloc (size_t n)
 
void * mxRealloc (void *ptr, size_t size)
 
void mxRemoveField (mxArray *ptr, int key_num)
 
void mxSetCell (mxArray *ptr, mwIndex idx, mxArray *val)
 
void mxSetClassName (mxArray *ptr, const char *name)
 
void mxSetData (mxArray *ptr, void *pr)
 
int mxSetDimensions (mxArray *ptr, const mwSize *dims, mwSize ndims)
 
void mxSetField (mxArray *ptr, mwIndex index, const char *key, mxArray *val)
 
void mxSetFieldByNumber (mxArray *ptr, mwIndex index, int key_num, mxArray *val)
 
void mxSetImagData (mxArray *ptr, void *pi)
 
void mxSetIr (mxArray *ptr, mwIndex *ir)
 
void mxSetJc (mxArray *ptr, mwIndex *jc)
 
void mxSetM (mxArray *ptr, mwSize m)
 
void mxSetN (mxArray *ptr, mwSize n)
 
void mxSetNzmax (mxArray *ptr, mwSize nzmax)
 
void mxSetPi (mxArray *ptr, double *pi)
 
void mxSetPr (mxArray *ptr, double *pr)
 
void mxSetProperty (mxArray *ptr, mwIndex idx, const char *property_name, const mxArray *property_value)
 
static int valid_key (const char *key)
 
static void xfree (void *ptr)
 

Variables

mexmex_context = nullptr
 
std::map< std::string, int > mex_lock_count
 

Typedef Documentation

◆ cmex_fptr

typedef void(* cmex_fptr) (int nlhs, mxArray **plhs, int nrhs, mxArray **prhs)

Definition at line 3136 of file mex.cc.

◆ fmex_fptr

typedef F77_RET_T(* fmex_fptr) (F77_INT &nlhs, mxArray **plhs, F77_INT &nrhs, mxArray **prhs)

Definition at line 3137 of file mex.cc.

Function Documentation

◆ calc_single_subscript_internal()

static mwIndex calc_single_subscript_internal ( mwSize  ndims,
const mwSize dims,
mwSize  nsubs,
const mwIndex subs 
)
static

◆ call_mex()

◆ max_str_len()

static mwSize max_str_len ( mwSize  m,
const char **  str 
)
static

Definition at line 71 of file mex.cc.

References i, str, strlen(), and tmp.

◆ maybe_mark_array()

◆ maybe_mark_foreign()

static void * maybe_mark_foreign ( void *  ptr)
inlinestatic

◆ maybe_unmark()

static void* maybe_unmark ( void *  ptr)
inlinestatic

◆ maybe_unmark_array()

static mxArray* maybe_unmark_array ( mxArray ptr)
inlinestatic

◆ mexAtExit()

int mexAtExit ( void(*)(void)  f)

Definition at line 3579 of file mex.cc.

References octave_mex_function::atexit(), mex::current_mex_function(), f, and mex_context.

◆ mexCallMATLAB()

int mexCallMATLAB ( int  nargout,
mxArray argout[],
int  nargin,
mxArray argin[],
const char *  fname 
)

◆ mexCallMATLABWithTrap()

mxArray* mexCallMATLABWithTrap ( int  nargout,
mxArray argout[],
int  nargin,
mxArray argin[],
const char *  fname 
)

◆ mexErrMsgIdAndTxt()

void mexErrMsgIdAndTxt ( const char *  id,
const char *  fmt,
  ... 
)

Definition at line 3388 of file mex.cc.

References error(), fname, mexFunctionName(), OCTAVE_LOCAL_BUFFER, strlen(), and verror_with_id().

◆ mexErrMsgTxt()

void mexErrMsgTxt ( const char *  s)

Definition at line 3375 of file mex.cc.

References error(), mexFunctionName(), s, and strlen().

Referenced by mexGetVariable(), mexPutVariable(), and mxIsFromGlobalWS().

◆ mexEvalString()

int mexEvalString ( const char *  s)

◆ mexEvalStringWithTrap()

◆ mexFunctionName()

const char* mexFunctionName ( void  )

◆ mexGet()

const mxArray* mexGet ( double  handle,
const char *  property 
)

◆ mexGetVariable()

◆ mexGetVariablePtr()

const mxArray* mexGetVariablePtr ( const char *  space,
const char *  name 
)

Definition at line 3503 of file mex.cc.

References mexGetVariable(), and name.

◆ mexIsGlobal()

int mexIsGlobal ( const mxArray ptr)

Definition at line 3607 of file mex.cc.

References mxIsFromGlobalWS().

◆ mexIsLocked()

int mexIsLocked ( void  )

◆ mexLock()

void mexLock ( void  )

◆ mexMakeArrayPersistent()

void mexMakeArrayPersistent ( mxArray ptr)

Definition at line 3567 of file mex.cc.

References maybe_unmark_array().

◆ mexMakeMemoryPersistent()

void mexMakeMemoryPersistent ( void *  ptr)

Definition at line 3573 of file mex.cc.

References maybe_unmark().

◆ mexPrintf()

int mexPrintf ( const char *  fmt,
  ... 
)

Definition at line 3435 of file mex.cc.

References octave_stdout, octave_vformat(), and retval.

◆ mexPutVariable()

◆ mexSet()

int mexSet ( double  handle,
const char *  property,
mxArray val 
)

Definition at line 3650 of file mex.cc.

References mxArray::as_octave_value(), handle, set_property_in_handle(), and val.

◆ mexSetTrapFlag()

void mexSetTrapFlag ( int  flag)

Definition at line 3305 of file mex.cc.

References mex_context, and mex::trap_feval_error.

Referenced by mexCallMATLABWithTrap().

◆ mexUnlock()

void mexUnlock ( void  )

◆ mexWarnMsgIdAndTxt()

void mexWarnMsgIdAndTxt ( const char *  id,
const char *  fmt,
  ... 
)

Definition at line 3416 of file mex.cc.

References fname, mexFunctionName(), OCTAVE_LOCAL_BUFFER, strlen(), and vwarning_with_id().

◆ mexWarnMsgTxt()

void mexWarnMsgTxt ( const char *  s)

Definition at line 3410 of file mex.cc.

References s, and warning().

◆ mxAddField()

int mxAddField ( mxArray ptr,
const char *  key 
)

Definition at line 3055 of file mex.cc.

References mxArray::add_field().

◆ mxArrayToString()

char* mxArrayToString ( const mxArray ptr)

Definition at line 3117 of file mex.cc.

References mxArray::array_to_string().

◆ mxCalcSingleSubscript()

mwIndex mxCalcSingleSubscript ( const mxArray ptr,
mwSize  nsubs,
mwIndex subs 
)

Definition at line 3123 of file mex.cc.

References mxArray::calc_single_subscript(), and subs.

◆ mxCalloc()

void* mxCalloc ( size_t  n,
size_t  size 
)

Definition at line 2534 of file mex.cc.

References mex::calloc(), and mex_context.

◆ mxCreateCellArray()

mxArray* mxCreateCellArray ( mwSize  ndims,
const mwSize dims 
)

Definition at line 2569 of file mex.cc.

References dims, and maybe_mark_array().

◆ mxCreateCellMatrix()

mxArray* mxCreateCellMatrix ( mwSize  m,
mwSize  n 
)

Definition at line 2575 of file mex.cc.

References maybe_mark_array().

Referenced by mexCallMATLABWithTrap(), and mexEvalStringWithTrap().

◆ mxCreateCharArray()

mxArray* mxCreateCharArray ( mwSize  ndims,
const mwSize dims 
)

Definition at line 2581 of file mex.cc.

References dims, maybe_mark_array(), and mxCHAR_CLASS.

◆ mxCreateCharMatrixFromStrings()

mxArray* mxCreateCharMatrixFromStrings ( mwSize  m,
const char **  str 
)

Definition at line 2587 of file mex.cc.

References maybe_mark_array(), and str.

◆ mxCreateDoubleMatrix()

mxArray* mxCreateDoubleMatrix ( mwSize  m,
mwSize  n,
mxComplexity  flag 
)

Definition at line 2593 of file mex.cc.

References maybe_mark_array(), and mxDOUBLE_CLASS.

◆ mxCreateDoubleScalar()

mxArray* mxCreateDoubleScalar ( double  val)

Definition at line 2599 of file mex.cc.

References maybe_mark_array(), mxDOUBLE_CLASS, and val.

◆ mxCreateLogicalArray()

mxArray* mxCreateLogicalArray ( mwSize  ndims,
const mwSize dims 
)

Definition at line 2605 of file mex.cc.

References dims, maybe_mark_array(), and mxLOGICAL_CLASS.

◆ mxCreateLogicalMatrix()

mxArray* mxCreateLogicalMatrix ( mwSize  m,
mwSize  n 
)

Definition at line 2611 of file mex.cc.

References maybe_mark_array(), and mxLOGICAL_CLASS.

◆ mxCreateLogicalScalar()

mxArray* mxCreateLogicalScalar ( mxLogical  val)

Definition at line 2617 of file mex.cc.

References maybe_mark_array(), mxLOGICAL_CLASS, and val.

◆ mxCreateNumericArray()

mxArray* mxCreateNumericArray ( mwSize  ndims,
const mwSize dims,
mxClassID  class_id,
mxComplexity  flag 
)

Definition at line 2623 of file mex.cc.

References dims, and maybe_mark_array().

◆ mxCreateNumericMatrix()

mxArray* mxCreateNumericMatrix ( mwSize  m,
mwSize  n,
mxClassID  class_id,
mxComplexity  flag 
)

Definition at line 2630 of file mex.cc.

References maybe_mark_array().

◆ mxCreateSparse()

mxArray* mxCreateSparse ( mwSize  m,
mwSize  n,
mwSize  nzmax,
mxComplexity  flag 
)

Definition at line 2651 of file mex.cc.

References maybe_mark_array(), and mxDOUBLE_CLASS.

◆ mxCreateSparseLogicalMatrix()

mxArray* mxCreateSparseLogicalMatrix ( mwSize  m,
mwSize  n,
mwSize  nzmax 
)

Definition at line 2657 of file mex.cc.

References maybe_mark_array(), and mxLOGICAL_CLASS.

◆ mxCreateString()

mxArray* mxCreateString ( const char *  str)

Definition at line 2663 of file mex.cc.

References maybe_mark_array(), and str.

Referenced by mexCallMATLABWithTrap(), and mexEvalStringWithTrap().

◆ mxCreateStructArray()

mxArray* mxCreateStructArray ( mwSize  ndims,
const mwSize dims,
int  num_keys,
const char **  keys 
)

Definition at line 2669 of file mex.cc.

References dims, and maybe_mark_array().

◆ mxCreateStructMatrix()

mxArray* mxCreateStructMatrix ( mwSize  m,
mwSize  n,
int  num_keys,
const char **  keys 
)

Definition at line 2676 of file mex.cc.

References maybe_mark_array().

Referenced by mexCallMATLABWithTrap(), and mexEvalStringWithTrap().

◆ mxCreateUninitNumericArray()

mxArray* mxCreateUninitNumericArray ( mwSize  ndims,
const mwSize dims,
mxClassID  class_id,
mxComplexity  flag 
)

Definition at line 2637 of file mex.cc.

References dims, and maybe_mark_array().

◆ mxCreateUninitNumericMatrix()

mxArray* mxCreateUninitNumericMatrix ( mwSize  m,
mwSize  n,
mxClassID  class_id,
mxComplexity  flag 
)

Definition at line 2644 of file mex.cc.

References maybe_mark_array().

◆ mxDestroyArray()

void mxDestroyArray ( mxArray ptr)

Definition at line 2690 of file mex.cc.

References mex::free_value(), and mex_context.

◆ mxDuplicateArray()

mxArray* mxDuplicateArray ( const mxArray ptr)

Definition at line 2683 of file mex.cc.

References mxArray::dup(), and maybe_mark_array().

◆ mxFree()

◆ mxGetCell()

mxArray* mxGetCell ( const mxArray ptr,
mwIndex  idx 
)

Definition at line 3005 of file mex.cc.

References mxArray::get_cell().

◆ mxGetChars()

mxChar* mxGetChars ( const mxArray ptr)

Definition at line 2920 of file mex.cc.

References mxArray::get_data(), and mxIsChar().

◆ mxGetClassID()

mxClassID mxGetClassID ( const mxArray ptr)

Definition at line 2973 of file mex.cc.

References mxArray::get_class_id().

◆ mxGetClassName()

const char* mxGetClassName ( const mxArray ptr)

Definition at line 2979 of file mex.cc.

References mxArray::get_class_name().

◆ mxGetData()

void* mxGetData ( const mxArray ptr)

Definition at line 2935 of file mex.cc.

References mxArray::get_data().

◆ mxGetDimensions()

const mwSize* mxGetDimensions ( const mxArray ptr)

Definition at line 2862 of file mex.cc.

References mxArray::get_dimensions().

◆ mxGetElementSize()

size_t mxGetElementSize ( const mxArray ptr)

Definition at line 3129 of file mex.cc.

References mxArray::get_element_size().

◆ mxGetEps()

double mxGetEps ( void  )

Definition at line 2515 of file mex.cc.

◆ mxGetField()

mxArray* mxGetField ( const mxArray ptr,
mwIndex  index,
const char *  key 
)

Definition at line 3067 of file mex.cc.

References mxGetFieldByNumber(), and mxGetFieldNumber().

◆ mxGetFieldByNumber()

mxArray* mxGetFieldByNumber ( const mxArray ptr,
mwIndex  index,
int  key_num 
)

Definition at line 3074 of file mex.cc.

References mxArray::get_field_by_number().

Referenced by mxGetField().

◆ mxGetFieldNameByNumber()

const char* mxGetFieldNameByNumber ( const mxArray ptr,
int  key_num 
)

Definition at line 3099 of file mex.cc.

References mxArray::get_field_name_by_number().

◆ mxGetFieldNumber()

int mxGetFieldNumber ( const mxArray ptr,
const char *  key 
)

Definition at line 3105 of file mex.cc.

References mxArray::get_field_number().

Referenced by mxGetField(), and mxSetField().

◆ mxGetImagData()

void* mxGetImagData ( const mxArray ptr)

Definition at line 2941 of file mex.cc.

References mxArray::get_imag_data().

◆ mxGetInf()

double mxGetInf ( void  )

Definition at line 2521 of file mex.cc.

References lo_ieee_inf_value().

◆ mxGetIr()

mwIndex* mxGetIr ( const mxArray ptr)

Definition at line 3018 of file mex.cc.

References mxArray::get_ir().

◆ mxGetJc()

mwIndex* mxGetJc ( const mxArray ptr)

Definition at line 3024 of file mex.cc.

References mxArray::get_jc().

◆ mxGetLogicals()

mxLogical* mxGetLogicals ( const mxArray ptr)

Definition at line 2929 of file mex.cc.

References mxArray::get_data().

◆ mxGetM()

size_t mxGetM ( const mxArray ptr)

Definition at line 2850 of file mex.cc.

References mxArray::get_m().

◆ mxGetN()

size_t mxGetN ( const mxArray ptr)

Definition at line 2856 of file mex.cc.

References mxArray::get_n().

◆ mxGetNaN()

double mxGetNaN ( void  )

Definition at line 2527 of file mex.cc.

References lo_ieee_nan_value().

◆ mxGetNumberOfDimensions()

mwSize mxGetNumberOfDimensions ( const mxArray ptr)

Definition at line 2868 of file mex.cc.

References mxArray::get_number_of_dimensions().

◆ mxGetNumberOfElements()

size_t mxGetNumberOfElements ( const mxArray ptr)

Definition at line 2874 of file mex.cc.

References mxArray::get_number_of_elements().

◆ mxGetNumberOfFields()

int mxGetNumberOfFields ( const mxArray ptr)

Definition at line 3093 of file mex.cc.

References mxArray::get_number_of_fields().

◆ mxGetNzmax()

mwSize mxGetNzmax ( const mxArray ptr)

Definition at line 3030 of file mex.cc.

References mxArray::get_nzmax().

◆ mxGetPi()

double* mxGetPi ( const mxArray ptr)

Definition at line 2908 of file mex.cc.

References mxArray::get_imag_data().

◆ mxGetPr()

double* mxGetPr ( const mxArray ptr)

Definition at line 2902 of file mex.cc.

References mxArray::get_data().

◆ mxGetProperty()

mxArray* mxGetProperty ( const mxArray ptr,
mwIndex  idx,
const char *  property_name 
)

Definition at line 2998 of file mex.cc.

References mxArray::get_property().

◆ mxGetScalar()

double mxGetScalar ( const mxArray ptr)

Definition at line 2914 of file mex.cc.

References mxArray::get_scalar().

◆ mxGetString()

int mxGetString ( const mxArray ptr,
char *  buf,
mwSize  buflen 
)

Definition at line 3111 of file mex.cc.

References mxArray::get_string().

◆ mxIsCell()

bool mxIsCell ( const mxArray ptr)

Definition at line 2698 of file mex.cc.

References mxArray::iscell().

◆ mxIsChar()

bool mxIsChar ( const mxArray ptr)

Definition at line 2704 of file mex.cc.

References mxArray::is_char().

Referenced by mxGetChars().

◆ mxIsClass()

bool mxIsClass ( const mxArray ptr,
const char *  name 
)

Definition at line 2710 of file mex.cc.

References mxArray::is_class(), and name.

◆ mxIsComplex()

bool mxIsComplex ( const mxArray ptr)

Definition at line 2716 of file mex.cc.

References mxArray::is_complex().

◆ mxIsDouble()

bool mxIsDouble ( const mxArray ptr)

Definition at line 2722 of file mex.cc.

References mxArray::is_double().

◆ mxIsEmpty()

bool mxIsEmpty ( const mxArray ptr)

Definition at line 2827 of file mex.cc.

References mxArray::isempty().

◆ mxIsFinite()

bool mxIsFinite ( const double  v)

Definition at line 2497 of file mex.cc.

References lo_ieee_finite.

◆ mxIsFromGlobalWS()

bool mxIsFromGlobalWS ( const mxArray )

Definition at line 2841 of file mex.cc.

References mexErrMsgTxt().

Referenced by mexIsGlobal().

◆ mxIsFunctionHandle()

bool mxIsFunctionHandle ( const mxArray ptr)

Definition at line 2728 of file mex.cc.

References mxArray::is_function_handle().

◆ mxIsInf()

bool mxIsInf ( const double  v)

Definition at line 2503 of file mex.cc.

References lo_ieee_isinf.

◆ mxIsInt16()

bool mxIsInt16 ( const mxArray ptr)

Definition at line 2734 of file mex.cc.

References mxArray::is_int16().

◆ mxIsInt32()

bool mxIsInt32 ( const mxArray ptr)

Definition at line 2740 of file mex.cc.

References mxArray::is_int32().

◆ mxIsInt64()

bool mxIsInt64 ( const mxArray ptr)

Definition at line 2746 of file mex.cc.

References mxArray::is_int64().

◆ mxIsInt8()

bool mxIsInt8 ( const mxArray ptr)

Definition at line 2752 of file mex.cc.

References mxArray::is_int8().

◆ mxIsLogical()

bool mxIsLogical ( const mxArray ptr)

Definition at line 2758 of file mex.cc.

References mxArray::is_logical().

◆ mxIsLogicalScalar()

bool mxIsLogicalScalar ( const mxArray ptr)

Definition at line 2813 of file mex.cc.

References mxArray::is_logical_scalar().

◆ mxIsLogicalScalarTrue()

bool mxIsLogicalScalarTrue ( const mxArray ptr)

Definition at line 2820 of file mex.cc.

References mxArray::is_logical_scalar_true().

◆ mxIsNaN()

bool mxIsNaN ( const double  v)

Definition at line 2509 of file mex.cc.

References lo_ieee_isnan.

◆ mxIsNumeric()

bool mxIsNumeric ( const mxArray ptr)

Definition at line 2764 of file mex.cc.

References mxArray::is_numeric().

◆ mxIsScalar()

bool mxIsScalar ( const mxArray ptr)

Definition at line 2833 of file mex.cc.

References mxArray::is_scalar().

◆ mxIsSingle()

bool mxIsSingle ( const mxArray ptr)

Definition at line 2770 of file mex.cc.

References mxArray::is_single().

◆ mxIsSparse()

bool mxIsSparse ( const mxArray ptr)

Definition at line 2776 of file mex.cc.

References mxArray::is_sparse().

◆ mxIsStruct()

bool mxIsStruct ( const mxArray ptr)

Definition at line 2782 of file mex.cc.

References mxArray::is_struct().

◆ mxIsUint16()

bool mxIsUint16 ( const mxArray ptr)

Definition at line 2788 of file mex.cc.

References mxArray::is_uint16().

◆ mxIsUint32()

bool mxIsUint32 ( const mxArray ptr)

Definition at line 2794 of file mex.cc.

References mxArray::is_uint32().

◆ mxIsUint64()

bool mxIsUint64 ( const mxArray ptr)

Definition at line 2800 of file mex.cc.

References mxArray::is_uint64().

◆ mxIsUint8()

bool mxIsUint8 ( const mxArray ptr)

Definition at line 2806 of file mex.cc.

References mxArray::is_uint8().

◆ mxMalloc()

void* mxMalloc ( size_t  n)

Definition at line 2540 of file mex.cc.

References mex::malloc(), and mex_context.

◆ mxRealloc()

void* mxRealloc ( void *  ptr,
size_t  size 
)

Definition at line 2546 of file mex.cc.

References mex_context, and mex::realloc().

Referenced by mxArray_struct::add_field().

◆ mxRemoveField()

void mxRemoveField ( mxArray ptr,
int  key_num 
)

Definition at line 3061 of file mex.cc.

References mxArray::remove_field().

◆ mxSetCell()

void mxSetCell ( mxArray ptr,
mwIndex  idx,
mxArray val 
)

Definition at line 3011 of file mex.cc.

References mxArray::set_cell(), and val.

◆ mxSetClassName()

void mxSetClassName ( mxArray ptr,
const char *  name 
)

Definition at line 2985 of file mex.cc.

References name, and mxArray::set_class_name().

◆ mxSetData()

void mxSetData ( mxArray ptr,
void *  pr 
)

Definition at line 2960 of file mex.cc.

References maybe_unmark(), and mxArray::set_data().

◆ mxSetDimensions()

int mxSetDimensions ( mxArray ptr,
const mwSize dims,
mwSize  ndims 
)

Definition at line 2893 of file mex.cc.

References dims, maybe_unmark(), and mxArray::set_dimensions().

◆ mxSetField()

void mxSetField ( mxArray ptr,
mwIndex  index,
const char *  key,
mxArray val 
)

Definition at line 3080 of file mex.cc.

References mxGetFieldNumber(), mxSetFieldByNumber(), and val.

◆ mxSetFieldByNumber()

void mxSetFieldByNumber ( mxArray ptr,
mwIndex  index,
int  key_num,
mxArray val 
)

Definition at line 3087 of file mex.cc.

References mxArray::set_field_by_number(), and val.

Referenced by mexCallMATLABWithTrap(), mexEvalStringWithTrap(), and mxSetField().

◆ mxSetImagData()

void mxSetImagData ( mxArray ptr,
void *  pi 
)

Definition at line 2966 of file mex.cc.

References maybe_unmark(), octave::math::pi, and mxArray::set_imag_data().

◆ mxSetIr()

void mxSetIr ( mxArray ptr,
mwIndex ir 
)

Definition at line 3036 of file mex.cc.

References maybe_unmark(), and mxArray::set_ir().

◆ mxSetJc()

void mxSetJc ( mxArray ptr,
mwIndex jc 
)

Definition at line 3042 of file mex.cc.

References maybe_unmark(), and mxArray::set_jc().

◆ mxSetM()

void mxSetM ( mxArray ptr,
mwSize  m 
)

Definition at line 2881 of file mex.cc.

References mxArray::set_m().

◆ mxSetN()

void mxSetN ( mxArray ptr,
mwSize  n 
)

Definition at line 2887 of file mex.cc.

References mxArray::set_n().

◆ mxSetNzmax()

void mxSetNzmax ( mxArray ptr,
mwSize  nzmax 
)

Definition at line 3048 of file mex.cc.

References mxArray::set_nzmax().

◆ mxSetPi()

void mxSetPi ( mxArray ptr,
double pi 
)

Definition at line 2954 of file mex.cc.

References maybe_unmark(), octave::math::pi, and mxArray::set_imag_data().

◆ mxSetPr()

void mxSetPr ( mxArray ptr,
double pr 
)

Definition at line 2948 of file mex.cc.

References maybe_unmark(), and mxArray::set_data().

◆ mxSetProperty()

void mxSetProperty ( mxArray ptr,
mwIndex  idx,
const char *  property_name,
const mxArray property_value 
)

Definition at line 2991 of file mex.cc.

References mxArray::set_property().

◆ valid_key()

static int valid_key ( const char *  key)
static

Definition at line 87 of file mex.cc.

References i, retval, and strlen().

Referenced by mxArray_struct::add_field().

◆ xfree()

static void xfree ( void *  ptr)
static

Definition at line 65 of file mex.cc.

Referenced by mex::free(), mxFree(), and mex::~mex().

Variable Documentation

◆ mex_context

◆ mex_lock_count

std::map<std::string,int> mex_lock_count

Definition at line 3629 of file mex.cc.

Referenced by mexLock(), and mexUnlock().