68 for (
mwSize i = 0; i < m; i++)
70 mwSize tmp = strlen (str[i]);
84 int nel = strlen (key);
90 for (
int i = 1; i < nel; i++)
92 if (! (isalnum (key[i]) || key[i] ==
'_'))
133 mwSize n = nsubs <= ndims ? nsubs : ndims;
138 retval = dims[n] * retval + subs[n];
321 else if (cn ==
"struct")
323 else if (cn ==
"logical")
325 else if (cn ==
"char")
327 else if (cn ==
"double")
329 else if (cn ==
"single")
331 else if (cn ==
"int8")
333 else if (cn ==
"uint8")
335 else if (cn ==
"int16")
337 else if (cn ==
"uint16")
339 else if (cn ==
"int32")
341 else if (cn ==
"uint32")
343 else if (cn ==
"int64")
345 else if (cn ==
"uint64")
347 else if (cn ==
"function_handle")
476 const char *p = tmp.
data ();
478 for (
mwIndex i = 0; i < nel; i++)
505 const char *p = tmp.
data ();
507 for (
mwIndex i = 0; i < nel; i++)
615 ndims (ndims_arg < 2 ? 2 : ndims_arg),
624 for (
mwIndex i = 0; i < ndims_arg; i++)
625 dims[i] = dims_arg[i];
644 for (
mwIndex i = ndims - 1; i > 1; i--)
715 && static_cast<mxLogical *> (
get_data ())[0] != 0);
777 default:
return "unknown";
961 for (
mwIndex i = 0; i < nd; i++)
978 error (
"invalid type for operation");
1022 double *dpr =
static_cast<double *
> (
pr);
1037 str ? (strlen (str) ? 1 : 0) : 0,
1038 str ? strlen (str) : 0),
1044 for (
mwIndex i = 0; i < nel; i++)
1060 for (
mwIndex j = 0; j < m; j++)
1062 const char *ptr = str[j];
1064 size_t tmp_len = strlen (ptr);
1066 for (
size_t i = 0; i < tmp_len; i++)
1067 cpr[m*i+j] = static_cast<mxChar> (ptr[i]);
1069 for (
size_t i = tmp_len; i < static_cast<size_t>(nc); i++)
1070 cpr[m*i+j] = static_cast<mxChar> (
' ');
1091 retval = *(
static_cast<bool *
> (
pr));
1095 retval = *(
static_cast<mxChar *
> (
pr));
1099 retval = *(
static_cast<float *
> (
pr));
1103 retval = *(
static_cast<double *
> (
pr));
1107 retval = *(
static_cast<int8_t *
> (
pr));
1111 retval = *(
static_cast<uint8_t *
> (
pr));
1115 retval = *(
static_cast<int16_t *
> (
pr));
1119 retval = *(
static_cast<uint16_t *
> (
pr));
1123 retval = *(
static_cast<int32_t *
> (
pr));
1127 retval = *(
static_cast<uint32_t *
> (
pr));
1131 retval = *(
static_cast<int64_t *
> (
pr));
1135 retval = *(
static_cast<uint64_t *
> (
pr));
1159 if (! (nel < buflen))
1170 for (
mwIndex i = 0; i < nel; i++)
1171 buf[i] = static_cast<char> (ptr[i]);
1191 for (
mwIndex i = 0; i < nel; i++)
1192 buf[i] = static_cast<char> (ptr[i]);
1209 retval = int_to_ov<mxLogical, boolNDArray, bool> (dv);
1222 for (
mwIndex i = 0; i < nel; i++)
1223 ptr[i] = static_cast<char> (ppr[i]);
1233 float *ppr =
static_cast<float *
> (
pr);
1241 float *ppi =
static_cast<float *
> (
pi);
1243 for (
mwIndex i = 0; i < nel; i++)
1254 for (
mwIndex i = 0; i < nel; i++)
1266 double *ppr =
static_cast<double *
> (
pr);
1274 double *ppi =
static_cast<double *
> (
pi);
1276 for (
mwIndex i = 0; i < nel; i++)
1277 ptr[i] =
Complex (ppr[i], ppi[i]);
1287 for (
mwIndex i = 0; i < nel; i++)
1296 retval = int_to_ov<int8_t, int8NDArray, octave_int8> (dv);
1300 retval = int_to_ov<uint8_t, uint8NDArray, octave_uint8> (dv);
1304 retval = int_to_ov<int16_t, int16NDArray, octave_int16> (dv);
1308 retval = int_to_ov<uint16_t, uint16NDArray, octave_uint16> (dv);
1312 retval = int_to_ov<int32_t, int32NDArray, octave_int32> (dv);
1316 retval = int_to_ov<uint32_t, uint32NDArray, octave_uint32> (dv);
1320 retval = int_to_ov<int64_t, int64NDArray, octave_int64> (dv);
1324 retval = int_to_ov<uint64_t, uint64NDArray, octave_uint64> (dv);
1336 template <
typename ELT_T,
typename ARRAY_T,
typename ARRAY_ELT_T>
1344 ELT_T *ppr =
static_cast<ELT_T *
> (
pr);
1347 error (
"complex integer types are not supported");
1352 ARRAY_ELT_T *ptr = val.fortran_vec ();
1354 for (
mwIndex i = 0; i < nel; i++)
1373 memcpy (
pr, val.
pr, nbytes);
1376 memcpy (
pi, val.
pi, nbytes);
1449 bool *ppr =
static_cast<bool *
> (
pr);
1452 static_cast<octave_idx_type> (
nzmax));
1456 val.
xdata (i) = ppr[i];
1468 error (
"single precision sparse data type not supported");
1475 double *ppr =
static_cast<double *
> (
pr);
1476 double *ppi =
static_cast<double *
> (
pi);
1479 static_cast<octave_idx_type> (
nzmax));
1494 double *ppr =
static_cast<double *
> (
pr);
1497 static_cast<octave_idx_type> (
nzmax));
1501 val.
xdata (i) = ppr[i];
1539 memcpy (pr, val.
pr, nbytes);
1542 memcpy (pi, val.
pi, nbytes);
1545 memcpy (ir, val.
ir, nzmax * sizeof (
mwIndex));
1600 for (
int i = 0; i <
nfields; i++)
1608 for (
int i = 0; i <
nfields; i++)
1615 for (
mwIndex i = 0; i < ntot; i++)
1629 fields =
static_cast<char **
>
1641 new_data =
static_cast<mxArray **
>
1650 for (
mwIndex i = 0; i < ntot; i++)
1658 new_data[j++] =
data[k++];
1675 if (key_num >= 0 && key_num <
nfields)
1681 int new_nfields =
nfields - 1;
1683 char **new_fields =
static_cast<char **
>
1690 for (
int i = 0; i < key_num; i++)
1691 new_fields[i] =
fields[i];
1693 for (
int i = key_num + 1; i <
nfields; i++)
1694 new_fields[i-1] =
fields[i];
1696 if (new_nfields > 0)
1702 for (
mwIndex i = 0; i < ntot; i++)
1707 new_data[j++] =
data[k++];
1714 nfields = new_nfields;
1726 return key_num >= 0 && key_num <
nfields
1736 return key_num >= 0 && key_num <
nfields ?
fields[key_num] : 0;
1743 for (
int i = 0; i <
nfields; i++)
1745 if (! strcmp (key,
fields[i]))
1769 for (
int i = 0; i <
nfields; i++)
1796 * sizeof (
char *)))),
1801 for (
int i = 0; i <
nfields; i++)
1809 data[i] = ptr ? ptr->
dup () : 0;
1846 for (
mwIndex i = 0; i < nel; i++)
1873 for (
mwIndex i = 0; i < nel; i++)
1890 for (
mwIndex i = 0; i < nel; i++)
1893 data[i] = ptr ? ptr->
dup () : 0;
1936 : rep (new
mxArray_struct (ndims, dims, num_keys, keys)), name (0) { }
2028 std::string nm = fcn->
name ();
2044 for (std::set<void *>::iterator p = context->
memlist.begin ();
2045 p != context->
memlist.end (); p++)
2051 for (std::set<mxArray *>::iterator p = context->
arraylist.begin ();
2067 error (
"%s: failed to allocate %d bytes of memory",
2093 memset (ptr, 0, n*t);
2117 v = gnulib::realloc (ptr, n);
2119 std::set<void *>::iterator p =
memlist.find (ptr);
2164 warning (
"mxFree: skipping memory not allocated by mxMalloc, mxCalloc, or mxRealloc");
2185 std::set<void *>::iterator p =
memlist.find (ptr);
2203 std::set<mxArray *>::iterator p =
arraylist.find (ptr);
2244 bool inlist =
false;
2246 std::set<mxArray *>::iterator p =
arraylist.find (ptr);
2256 warning (
"mex::free_value: skipping memory not allocated by mex::make_value");
2274 void abort (
void) { longjmp (jump, 1); }
2301 if (global_memlist.find (ptr) != global_memlist.end ())
2305 global_memlist.insert (ptr);
2311 std::set<void *>::iterator p = global_memlist.find (ptr);
2313 if (p != global_memlist.end ())
2314 global_memlist.erase (p);
2347 static inline void *
2365 static inline void *
2369 mex_context->
unmark (ptr);
2377 if (key_num >= 0 && key_num <
nfields)
2415 return std::numeric_limits<double>::epsilon ();
2434 return mex_context ? mex_context->
calloc (n, size) : ::calloc (n, size);
2446 return mex_context ? mex_context->
realloc (ptr, size)
2447 : gnulib::realloc (ptr, size);
2454 mex_context->
free (ptr);
2462 return mex_context ? mex_context->
mark_array (ptr) : ptr;
2576 if (! (mex_context && mex_context->
free_value (ptr)))
2729 return ptr->
get_m ();
2735 return ptr->
get_n ();
2781 return static_cast<double *
> (ptr->
get_data ());
3008 volatile int nargout = nargout_arg;
3010 int nargin = args.
length ();
3012 for (
int i = 0; i < nargin; i++)
3015 int nout = nargout == 0 ? 1 : nargout;
3017 for (
int i = 0; i < nout; i++)
3029 for (
int i = 0; i < nargin; i++)
3032 if (setjmp (context.
jump) == 0)
3040 int tmp_nargout = nargout;
3041 int tmp_nargin = nargin;
3043 fcn (tmp_nargout, argout, tmp_nargin, argin);
3049 fcn (nargout, argout, nargin, argin);
3059 if (nargout == 0 && argout[0])
3067 for (
int i = 0; i < nargout; i++)
3082 return mex_context ? mex_context->
function_name () :
"unknown";
3087 mxArray *argin[],
const char *fname)
3099 for (
int i = 0; i < nargin; i++)
3115 mex_context->
abort ();
3118 int num_to_copy = retval.
length ();
3120 if (nargout < retval.
length ())
3121 num_to_copy = nargout;
3123 for (
int i = 0; i < num_to_copy; i++)
3129 argout[i] = mex_context->
make_value (retval (i));
3132 while (num_to_copy < nargout)
3133 argout[num_to_copy++] = 0;
3175 if (s && strlen (s) > 0)
3184 mex_context->
abort ();
3190 if (fmt && strlen (fmt) > 0)
3193 size_t len = strlen (fname) + 2 + strlen (fmt) + 1;
3195 sprintf (tmpfmt,
"%s: %s", fname, fmt);
3197 va_start (args, fmt);
3208 mex_context->
abort ();
3223 if (fmt && strlen (fmt) > 0)
3226 size_t len = strlen (fname) + 2 + strlen (fmt) + 1;
3228 sprintf (tmpfmt,
"%s: %s", fname, fmt);
3230 va_start (args, fmt);
3241 va_start (args, fmt);
3254 if (! strcmp (space,
"global"))
3262 bool caller = ! strcmp (space,
"caller");
3263 bool base = ! strcmp (space,
"base");
3283 mexErrMsgTxt (
"mexGetVariable: symbol table does not exist");
3311 if (name[0] ==
'\0')
3314 if (! name || name[0] ==
'\0')
3317 if (! strcmp (space,
"global"))
3325 bool caller = ! strcmp (space,
"caller");
3326 bool base = ! strcmp (space,
"base");
3346 mexErrMsgTxt (
"mexPutVariable: symbol table does not exist");
3371 assert (curr_mex_fcn);
3420 if (mex_lock_count.find (fname) == mex_lock_count.end ())
3421 mex_lock_count[fname] = 1;
3423 mex_lock_count[fname]++;
3435 return (ret ? 0 : 1);
3445 std::map<std::string,int>::iterator p = mex_lock_count.find (fname);
3447 if (p != mex_lock_count.end ())
3449 int count = --mex_lock_count[fname];
3455 mex_lock_count.erase (p);
mxArray_matlab(mxClassID id_arg, const dim_vector &dv)
const char * mexFunctionName(void)
void * get_data(void) const
int get_string(char *, mwSize) const
int add_field(const char *)
octave_value as_octave_value(void) const
octave_idx_type * xridx(void)
mxArray * get_cell(mwIndex idx) const
int is_complex(void) const
mxArray * get_cell(mwIndex) const
size_t octave_vformat(std::ostream &os, const char *fmt, va_list args)
int mxIsInt16(const mxArray *ptr)
int is_sparse(void) const
void set_data(void *pr_arg)
char * array_to_string(void) const
size_t get_element_size(void) const
bool is_range(void) const
void set_name(const char *name_arg)
mxArray_number(const mxArray_number &val)
mxArray_number(mxClassID id_arg, mwSize ndims_arg, const mwSize *dims_arg, mxComplexity flag=mxREAL)
void * get_data(void) const
mxArray(const octave_value &ov)
const mxArray * mexGetVariablePtr(const char *space, const char *name)
int get_string(char *buf, mwSize buflen) const
dim_vector dims_to_dim_vector(void) const
mex & operator=(const mex &)
mwIndex * get_ir(void) const
charNDArray char_array_value(bool frc_str_conv=false) const
mwIndex * get_ir(void) const
mxArray * mxCreateStructMatrix(mwSize m, mwSize n, int num_keys, const char **keys)
void mexErrMsgIdAndTxt(const char *id, const char *fmt,...)
bool is_real_type(void) const
mxArray_matlab(mxClassID id_arg, mwSize ndims_arg, const mwSize *dims_arg)
F77_RET_T(* fmex_fptr)(int &nlhs, mxArray **plhs, int &nrhs, mxArray **prhs)
const char * get_name(void) const
bool free_value(mxArray *ptr)
int mxIsFinite(const double v)
mxArray_struct(const dim_vector &dv, int num_keys_arg, const char **keys)
mxArray * mxCreateSparseLogicalMatrix(mwSize m, mwSize n, mwSize nzmax)
void set_cell(mwIndex, mxArray *)
octave_idx_type rows(void) const
const char * function_name(void) const
mxArray * mxCreateCharArray(mwSize ndims, const mwSize *dims)
void set_field_by_number(mwIndex index, int key_num, mxArray *val)
const char * get_field_name_by_number(int key_num) const
double mxGetScalar(const mxArray *ptr)
int mexIsGlobal(const mxArray *ptr)
void assign(const std::string &k, const Cell &val)
void mxSetCell(mxArray *ptr, mwIndex idx, mxArray *val)
mxArray_cell(mwSize ndims_arg, const mwSize *dims_arg)
int get_number_of_fields(void) const
mxLogical * mxGetLogicals(const mxArray *ptr)
int mxIsUint16(const mxArray *ptr)
int get_string(char *buf, mwSize buflen) const
int is_numeric(void) const
int is_uint64(void) const
int get_field_number(const char *) const
int mexAtExit(void(*f)(void))
double * mxGetPr(const mxArray *ptr)
mxArray * as_mxArray(void) const
bool is_uint16_type(void) const
void * mxGetData(const mxArray *ptr)
int mexPutVariable(const char *space, const char *name, const mxArray *ptr)
int is_real_type(void) const
mwSize get_number_of_dimensions(void) const
void * mxMalloc(size_t n)
mxClassID get_class_id(void) const
void verror_with_id(const char *id, const char *fmt, va_list args)
int get_field_number(const char *key) const
mxArray_matlab(mxClassID id_arg=mxUNKNOWN_CLASS)
void set_imag_data(void *pi)
octave_value_list call_mex(bool have_fmex, void *f, const octave_value_list &args, int nargout_arg, octave_mex_function *curr_mex_fcn)
double get_scalar(void) const
int is_logical(void) const
mwIndex * mxGetJc(const mxArray *ptr)
int is_logical_scalar_true(void) const
int is_logical_scalar(void) const
const char * get_class_name(void) const
octave_idx_type length(void) const
int is_logical(void) const
bool mutation_needed(void) const
int mxIsCell(const mxArray *ptr)
octave_idx_type nfields(void) const
const char * get_field_name_by_number(int) const
mxArray * dup(void) const
bool is_numeric_type(void) const
bool is_defined(void) const
mwSize get_number_of_dimensions(void) const
std::set< void * > memlist
int is_uint16(void) const
int is_complex(void) const
static char * strsave(const char *s)
size_t mxGetElementSize(const mxArray *ptr)
void mxSetIr(mxArray *ptr, mwIndex *ir)
mwSize mxGetNumberOfDimensions(const mxArray *ptr)
void set_imag_data(void *pi_arg)
void resize(int n, int fill_value=0)
void * mxGetImagData(const mxArray *ptr)
void set_data(void *pr_arg)
void mxSetJc(mxArray *ptr, mwIndex *jc)
octave_value get_property_from_handle(double handle, const std::string &property, const std::string &func)
mxArray * get_cell(mwIndex) const
octave_idx_type * xcidx(void)
mxArray * mutate(void) const
void * calloc_unmarked(size_t n, size_t t)
void error(const char *fmt,...)
#define lo_ieee_finite(x)
static void * maybe_mark_foreign(void *ptr)
static void * malloc(size_t n)
double lo_ieee_inf_value(void)
std::string name(void) const
int mxIsInt32(const mxArray *ptr)
int is_double(void) const
void global_mark(void *ptr)
bool is_int8_type(void) const
octave_value_list feval(const std::string &name, const octave_value_list &args, int nargout)
void * get_data(void) const
int mxIsLogicalScalar(const mxArray *ptr)
int is_struct(void) const
static octave_function * current(void)
mxArray_number(mxClassID id_arg, const dim_vector &dv, mxComplexity flag=mxREAL)
mxArray_number & operator=(const mxArray_number &)
mxArray * mxCreateLogicalScalar(mxLogical val)
int mexPrintf(const char *fmt,...)
mxArray * mexGetVariable(const char *space, const char *name)
void mxDestroyArray(mxArray *ptr)
void * get_data(void) const
static void * maybe_unmark(void *ptr)
int mxIsInt64(const mxArray *ptr)
int mexSet(double handle, const char *property, mxArray *val)
octave_value as_octave_value(void) const
void set_cell(mwIndex, mxArray *)
mxArray_octave_value(const octave_value &ov)
octave_value_list eval_string(const std::string &eval_str, bool silent, int &parse_status, int nargout)
double lo_ieee_nan_value(void)
octave_idx_type nzmax(void) const
int is_complex(void) const
virtual bool is_octave_value(void) const
int mxIsFromGlobalWS(const mxArray *)
int is_single(void) const
bool is_int32_type(void) const
char * mxArrayToString(const mxArray *ptr)
int mxIsChar(const mxArray *ptr)
static void cleanup(void *ptr)
mxArray * mark_array(mxArray *ptr)
mxArray * mxGetField(const mxArray *ptr, mwIndex index, const char *key)
int is_function_handle(void) const
double scalar_value(bool frc_str_conv=false) const
mxArray * get_field_by_number(mwIndex index, int key_num) const
int is_complex(void) const
mwSize * mxGetDimensions(const mxArray *ptr)
mwSize * get_dimensions(void) const
double get_scalar(void) const
void set_ir(mwIndex *ir_arg)
const char * mxGetFieldNameByNumber(const mxArray *ptr, int key_num)
mxArray * mxGetFieldByNumber(const mxArray *ptr, mwIndex index, int key_num)
mwIndex * get_jc(void) const
int is_logical(void) const
int mxIsLogicalScalarTrue(const mxArray *ptr)
void set_nzmax(mwSize nzmax)
static octave_value as_octave_value(const mxArray *ptr)
static octave_value varval(const std::string &name, scope_id scope=xcurrent_scope, context_id context=xdefault_context)
mxArray * mxCreateString(const char *str)
bool is_function_handle(void) const
int is_uint16(void) const
int mxIsFunctionHandle(const mxArray *ptr)
F77_RET_T const double const double double * d
void * get_data(void) const
void remove_field(int key_num)
int mxIsUint8(const mxArray *ptr)
void mexSetTrapFlag(int flag)
void mxRemoveField(mxArray *ptr, int key_num)
void set_global_value(const std::string &nm, const octave_value &val)
int is_double(void) const
int is_sparse(void) const
int mxIsInf(const double v)
int add_field(const char *key)
int is_numeric(void) const
void set_dimensions(mwSize *dims_arg, mwSize ndims_arg)
mwIndex * get_jc(void) const
mwSize get_number_of_elements(void) const
mxArray_cell(mwSize m, mwSize n)
mxArray * make_value(const octave_value &ov)
void set_cell(mwIndex idx, mxArray *val)
mxArray * get_cell(mwIndex idx) const
octave_value int_to_ov(const dim_vector &dv) const
mwIndex calc_single_subscript(mwSize nsubs, mwIndex *subs) const
int get_string(char *buf, mwSize buflen) const
bool is_octave_value(void) const
mwIndex * get_ir(void) const
mxClassID mxGetClassID(const mxArray *ptr)
mwSize mxGetNzmax(const mxArray *ptr)
void set_field_by_number(mwIndex index, int key_num, mxArray *val)
void mark_foreign(void *ptr)
mxArray * mxCreateStructArray(mwSize ndims, const mwSize *dims, int num_keys, const char **keys)
F77_RET_T const double const double * f
void add_fcn(void(*fcn)(void))
bool set_property_in_handle(double handle, const std::string &property, const octave_value &arg, const std::string &func)
int is_uint64(void) const
bool is_sparse_type(void) const
int is_uint32(void) const
mxArray_base * dup(void) const
octave_idx_type numel(const octave_value_list &idx)
bool is_bool_type(void) const
double get_scalar(void) const
octave_idx_type * mex_get_jc(void) const
int mxIsDouble(const mxArray *ptr)
int is_uint32(void) const
static llvm::LLVMContext & context
static char * strsave(const char *str)
mwSize get_nzmax(void) const
int mxAddField(mxArray *ptr, const char *key)
double * mxGetPi(const mxArray *ptr)
const char * mxGetClassName(const mxArray *ptr)
int mxIsInt8(const mxArray *ptr)
const char * get_field_name_by_number(int key_num) const
mwIndex * get_jc(void) const
mxArray * mxCreateDoubleScalar(double val)
const mxArray * mexGet(double handle, const char *property)
int mxIsSingle(const mxArray *ptr)
mxArray * mxCreateCellMatrix(mwSize m, mwSize n)
int mexEvalString(const char *s)
static void * calloc(size_t n, size_t t)
void unmark_array(mxArray *ptr)
char * array_to_string(void) const
mxArray_number(mxClassID id_arg, mwSize m, mwSize n, mxComplexity flag=mxREAL)
int get_number_of_fields(void) const
bool is_string(void) const
int is_complex(void) const
bool is_double_type(void) const
int is_uint16(void) const
int mxIsNaN(const double v)
const T * data(void) const
void * calloc(size_t n, size_t t)
void mxSetData(mxArray *ptr, void *pr)
int mxIsClass(const mxArray *ptr, const char *name)
mxArray_number(mxClassID id_arg, mxLogical val)
void * get_imag_data(void) const
int mxGetString(const mxArray *ptr, char *buf, mwSize buflen)
bool is_complex_type(void) const
void mxSetPr(mxArray *ptr, double *pr)
octave_mex_function * current_mex_function(void) const
mxArray_octave_value & operator=(const mxArray_octave_value &)
mxArray_base * dup(void) const
mwSize get_nzmax(void) const
void * realloc(void *ptr, size_t n)
int is_uint32(void) const
bool is_int64_type(void) const
void set_class_name(const char *name_arg)
#define panic_impossible()
octave_idx_type * mex_get_ir(void) const
void set_class_name(const char *name_arg)
int is_uint64(void) const
virtual octave_value as_octave_value(void) const =0
void mxSetField(mxArray *ptr, mwIndex index, const char *key, mxArray *val)
mxArray * mxCreateSparse(mwSize m, mwSize n, mwSize nzmax, mxComplexity flag)
void mxSetNzmax(mxArray *ptr, mwSize nzmax)
std::map< std::string, int > mex_lock_count
mxArray_sparse(const mxArray_sparse &val)
mxArray_cell & operator=(const mxArray_cell &)
const char * get_class_name(void) const
void * get_imag_data(void) const
void mxSetN(mxArray *ptr, mwSize n)
static void assign(const std::string &name, const octave_value &value=octave_value(), scope_id scope=xcurrent_scope, context_id context=xdefault_context, bool force_add=false)
void mexMakeMemoryPersistent(void *ptr)
mxArray * mxCreateCharMatrixFromStrings(mwSize m, const char **str)
mxArray * mxCreateDoubleMatrix(mwSize m, mwSize n, mxComplexity flag)
mxClassID get_class_id(void) const
void global_unmark(void *ptr)
size_t size(T const (&)[z])
mwSize get_number_of_dimensions(void) const
void init(const char **keys)
mxClassID get_class_id(void) const
static void goto_base_frame(void)
mxArray * get_field_by_number(mwIndex, int) const
int get_number_of_fields(void) const
mxArray_matlab & operator=(const mxArray_matlab &)
mxArray * mxCreateCellArray(mwSize ndims, const mwSize *dims)
dim_vector dims(void) const
void set_dimensions(mwSize *, mwSize)
void set_nzmax(mwSize nzmax_arg)
mwIndex calc_single_subscript(mwSize nsubs, mwIndex *subs) const
void error(const char *msg) const
static mxArray * maybe_unmark_array(mxArray *ptr)
void unmark_foreign(void *ptr)
int add_field(const char *key)
void mxSetM(mxArray *ptr, mwSize m)
~mxArray_octave_value(void)
mxArray_number(mxClassID id_arg, double val)
mwSize get_nzmax(void) const
mxArray_base * dup(void) const
mxArray_struct & operator=(const mxArray_struct &val)
void atexit(void(*fcn)(void))
size_t get_element_size(void) const
mxArray_cell(const dim_vector &dv)
bool is_int16_type(void) const
void set_imag_data(void *pi_arg)
int is_single(void) const
void set_data(void *data_arg)
void set_class_name(const char *)
int mxIsNumeric(const mxArray *ptr)
mex(octave_mex_function *f)
void mxSetPi(mxArray *ptr, double *pi)
void warning(const char *fmt,...)
int mxIsUint64(const mxArray *ptr)
int mxIsStruct(const mxArray *ptr)
void set_cell(mwIndex idx, mxArray *val)
void * get_data(void) const
void mexErrMsgTxt(const char *s)
void set_jc(mwIndex *jc_arg)
mxArray_base * dup(void) const
void set_field_by_number(mwIndex, int, mxArray *)
int get_field_number(const char *key) const
size_t get_element_size(void) const
bool is_empty(void) const
mxArray_matlab(const mxArray_matlab &val)
void * get_imag_data(void) const
mxArray_struct(mwSize m, mwSize n, int num_keys_arg, const char **keys)
void * get_data(void) const
mwSize get_number_of_elements(void) const
int is_logical_scalar_true(void) const
void mxSetClassName(mxArray *ptr, const char *name)
octave_value as_octave_value(void) const
mxArray * mxCreateLogicalArray(mwSize ndims, const mwSize *dims)
int get_field_number(const char *) const
octave_value as_octave_value(void) const
void * mex_get_data(void) const
int is_single(void) const
int is_sparse(void) const
int mxGetNumberOfFields(const mxArray *ptr)
void mexWarnMsgIdAndTxt(const char *id, const char *fmt,...)
void set_data(void *data_arg)
octave_value get_global_value(const std::string &nm, bool silent)
void * get_imag_data(void) const
void * get_imag_data(void) const
mxArray_number(const char *str)
static mwSize max_str_len(mwSize m, const char **str)
mxArray_number(mwSize m, const char **str)
mxArray_octave_value(const mxArray_octave_value &arg)
bool is_uint8_type(void) const
bool mislocked(const std::string &nm)
mxArray * mxDuplicateArray(const mxArray *ptr)
mxArray_sparse(mxClassID id_arg, mwSize m, mwSize n, mwSize nzmax_arg, mxComplexity flag=mxREAL)
double get_scalar(void) const
void set_field_by_number(mwIndex, int, mxArray *)
int is_function_handle(void) const
mwIndex * mxGetIr(const mxArray *ptr)
void set_imag_data(void *)
void * mxRealloc(void *ptr, size_t size)
const char * get_field_name_by_number(int) const
mxArray_matlab(mxClassID id_arg, mwSize m, mwSize n)
octave_value as_octave_value(void) const
virtual int is_logical_scalar(void) const
int is_struct(void) const
int is_struct(void) const
mxArray * mxCreateLogicalMatrix(mwSize m, mwSize n)
mxChar * mxGetChars(const mxArray *ptr)
int mxIsEmpty(const mxArray *ptr)
void set_dimensions(mwSize *dims_arg, mwSize ndims_arg)
mxArray_struct(mwSize ndims_arg, const mwSize *dims_arg, int num_keys_arg, const char **keys)
void set_imag_data(void *)
int is_numeric(void) const
std::string class_name(void) const
mxArray_struct(const mxArray_struct &val)
void mexWarnMsgTxt(const char *s)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
mxArray * get_field_by_number(mwIndex index, int key_num) const
int is_sparse(void) const
mwIndex * get_jc(void) const
bool is_uint64_type(void) const
const char * get_class_name(void) const
void resize(octave_idx_type n, const octave_value &rfv=octave_value())
void * malloc_unmarked(size_t n)
mxArray * mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID class_id, mxComplexity flag)
mwSize * get_dimensions(void) const
int is_function_handle(void) const
std::complex< float > FloatComplex
mxArray * get_field_by_number(mwIndex, int) const
int is_logical_scalar_true(void) const
size_t mxGetM(const mxArray *ptr)
static std::set< void * > global_memlist
mwIndex calc_single_subscript(mwSize nsubs, mwIndex *subs) const
int mxIsLogical(const mxArray *ptr)
mxArray * mxCreateNumericArray(mwSize ndims, const mwSize *dims, mxClassID class_id, mxComplexity flag)
void mxSetImagData(mxArray *ptr, void *pi)
mxArray_base * dup(void) const
std::complex< double > Complex
void mxSetFieldByNumber(mxArray *ptr, mwIndex index, int key_num, mxArray *val)
void mxSetDimensions(mxArray *ptr, const mwSize *dims, mwSize ndims)
const T * fortran_vec(void) const
bool is_single_type(void) const
mxArray_cell(const mxArray_cell &val)
void * mxCalloc(size_t n, size_t size)
void vwarning_with_id(const char *id, const char *fmt, va_list args)
int mxIsUint32(const mxArray *ptr)
mxArray_sparse & operator=(const mxArray_sparse &)
mwIndex * get_ir(void) const
mwSize get_nzmax(void) const
void invalid_type_error(void) const
bool is_uint32_type(void) const
int mxIsSparse(const mxArray *ptr)
mxArray * as_mxArray(void) const
octave_value as_octave_value(void) const
octave_mex_function * curr_mex_fcn
void remove_field(int key_num)
int mxIsComplex(const mxArray *ptr)
int is_class(const char *name_arg) const
char * array_to_string(void) const
int mxGetFieldNumber(const mxArray *ptr, const char *key)
virtual mxArray * mutate(void) const
int is_double(void) const
std::set< void * > foreign_memlist
int add_field(const char *)
static int valid_key(const char *key)
mxArray * mxGetCell(const mxArray *ptr, mwIndex idx)
void munlock(const std::string &nm)
mwSize * get_dimensions(void) const
void mexMakeArrayPersistent(mxArray *ptr)
void(* cmex_fptr)(int nlhs, mxArray **plhs, int nrhs, mxArray **prhs)
std::set< mxArray * > arraylist
static void xfree(void *ptr)
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
size_t mxGetN(const mxArray *ptr)
int mexCallMATLAB(int nargout, mxArray *argout[], int nargin, mxArray *argin[], const char *fname)
size_t mxGetNumberOfElements(const mxArray *ptr)
void request_mutation(void) const
char * array_to_string(void) const
static mxArray * maybe_mark_array(mxArray *ptr)
void maybe_mutate(void) const
mwSize get_number_of_elements(void) const
static mwIndex calc_single_subscript_internal(mwSize ndims, const mwSize *dims, mwSize nsubs, const mwIndex *subs)
int get_number_of_fields(void) const
mwIndex mxCalcSingleSubscript(const mxArray *ptr, mwSize nsubs, mwIndex *subs)