23 #if defined (HAVE_CONFIG_H)
94 for (
int i = 1;
i < nel;
i++)
96 if (! (isalnum (key[
i]) || key[i] ==
'_'))
128 mwSize n = nsubs <= ndims ? nsubs : ndims;
133 retval = dims[n] * retval + subs[n];
326 else if (cn ==
"single")
328 else if (cn ==
"char")
330 else if (cn ==
"logical")
332 else if (cn ==
"cell")
334 else if (cn ==
"struct")
336 else if (cn ==
"function_handle")
338 else if (cn ==
"int8")
340 else if (cn ==
"uint8")
342 else if (cn ==
"int16")
344 else if (cn ==
"uint16")
346 else if (cn ==
"int32")
348 else if (cn ==
"uint32")
350 else if (cn ==
"int64")
352 else if (cn ==
"uint64")
391 return *static_cast<bool *> (data);
393 return *static_cast<double *> (data);
395 return *
static_cast<double *
> (data);
499 const char *
p = tmp.
data ();
528 const char *
p = tmp.
data ();
640 ndims (ndims_arg < 2 ? 2 : ndims_arg),
648 else if (ndims_arg < 2)
745 && static_cast<mxLogical *> (
get_data ())[0] != 0);
834 default:
return "unknown";
1024 error (
"invalid type for operation");
1083 double *dpr =
static_cast<double *
> (
pr);
1098 str ? (
strlen (str) ? 1 : 0) : 0,
1123 const char *ptr = str[j];
1125 size_t tmp_len =
strlen (ptr);
1127 for (
size_t i = 0;
i < tmp_len;
i++)
1128 cpr[m*
i+j] = static_cast<mxChar> (ptr[
i]);
1131 cpr[m*i+j] = static_cast<mxChar> (
' ');
1152 retval = *(
static_cast<double *
> (
pr));
1156 retval = *(
static_cast<float *
> (
pr));
1160 retval = *(
static_cast<mxChar *
> (
pr));
1164 retval = *(
static_cast<bool *
> (
pr));
1168 retval = *(
static_cast<int8_t *
> (
pr));
1172 retval = *(
static_cast<uint8_t *
> (
pr));
1176 retval = *(
static_cast<int16_t *
> (
pr));
1180 retval = *(
static_cast<uint16_t *
> (
pr));
1184 retval = *(
static_cast<int32_t *
> (
pr));
1188 retval = *(
static_cast<uint32_t *
> (
pr));
1192 retval = *(
static_cast<int64_t *
> (
pr));
1196 retval = *(
static_cast<uint64_t *
> (
pr));
1220 if (! (nel < buflen))
1232 buf[
i] = static_cast<char> (ptr[
i]);
1253 buf[
i] = static_cast<char> (ptr[
i]);
1273 double *ppr =
static_cast<double *
> (
pr);
1281 double *ppi =
static_cast<double *
> (
pi);
1306 float *ppr =
static_cast<float *
> (
pr);
1314 float *ppi =
static_cast<float *
> (
pi);
1346 ptr[
i] = static_cast<char> (ppr[
i]);
1353 retval = int_to_ov<mxLogical, boolNDArray, bool> (
dv);
1357 retval = int_to_ov<int8_t, int8NDArray, octave_int8> (
dv);
1361 retval = int_to_ov<uint8_t, uint8NDArray, octave_uint8> (
dv);
1365 retval = int_to_ov<int16_t, int16NDArray, octave_int16> (
dv);
1369 retval = int_to_ov<uint16_t, uint16NDArray, octave_uint16> (
dv);
1373 retval = int_to_ov<int32_t, int32NDArray, octave_int32> (
dv);
1377 retval = int_to_ov<uint32_t, uint32NDArray, octave_uint32> (
dv);
1381 retval = int_to_ov<int64_t, int64NDArray, octave_int64> (
dv);
1385 retval = int_to_ov<uint64_t, uint64NDArray, octave_uint64> (
dv);
1397 template <
typename ELT_T,
typename ARRAY_T,
typename ARRAY_ELT_T>
1402 error (
"complex integer types are not supported");
1406 ELT_T *ppr =
static_cast<ELT_T *
> (
pr);
1410 ARRAY_ELT_T *ptr = val.fortran_vec ();
1428 memcpy (
pr, val.
pr, nbytes);
1431 memcpy (
pi, val.
pi, nbytes);
1506 double *ppr =
static_cast<double *
> (
pr);
1507 double *ppi =
static_cast<double *
> (
pi);
1510 static_cast<octave_idx_type> (
nzmax));
1525 double *ppr =
static_cast<double *
> (
pr);
1528 static_cast<octave_idx_type> (
nzmax));
1546 bool *ppr =
static_cast<bool *
> (
pr);
1549 static_cast<octave_idx_type> (
nzmax));
1565 error (
"single precision sparse data type not supported");
1594 memcpy (pr, val.
pr, nbytes);
1597 memcpy (pi, val.
pi, nbytes);
1600 memcpy (ir, val.
ir, nzmax * sizeof (
mwIndex));
1670 for (
mwIndex i = 0; i < ntot; i++)
1684 fields =
static_cast<char **
>
1696 new_data =
static_cast<mxArray **
>
1713 new_data[j++] =
data[k++];
1730 if (key_num >= 0 && key_num <
nfields)
1736 int new_nfields =
nfields - 1;
1738 char **new_fields =
static_cast<char **
>
1745 for (
int i = 0;
i < key_num;
i++)
1751 if (new_nfields > 0)
1762 new_data[j++] =
data[k++];
1769 nfields = new_nfields;
1781 return key_num >= 0 && key_num <
nfields
1791 return key_num >= 0 && key_num <
nfields ?
fields[key_num] : 0;
1851 * sizeof (char *)))),
1864 data[
i] = ptr ? ptr->
dup () : 0;
1948 data[
i] = ptr ? ptr->
dup () : 0;
2073 std::set<void *>::iterator
p =
memlist.begin ();
2081 std::set<mxArray *>::iterator
p =
arraylist.begin ();
2118 error (
"%s: failed to allocate %d bytes of memory",
2142 memset (ptr, 0, n*t);
2166 v = std::realloc (ptr, n);
2168 std::set<void *>::iterator
p =
memlist.find (ptr);
2213 warning (
"mxFree: skipping memory not allocated by mxMalloc, mxCalloc, or mxRealloc");
2234 std::set<void *>::iterator
p =
memlist.find (ptr);
2252 std::set<mxArray *>::iterator
p =
arraylist.find (ptr);
2293 bool inlist =
false;
2295 std::set<mxArray *>::iterator
p =
arraylist.find (ptr);
2305 warning (
"mex::free_value: skipping memory not allocated by mex::make_value");
2344 if (global_memlist.find (ptr) != global_memlist.end ())
2348 global_memlist.insert (ptr);
2354 std::set<void *>::iterator
p = global_memlist.find (ptr);
2356 if (p != global_memlist.end ())
2357 global_memlist.erase (p);
2390 static inline void *
2408 static inline void *
2412 mex_context->
unmark (ptr);
2420 if (key_num >= 0 && key_num <
nfields)
2458 return std::numeric_limits<double>::epsilon ();
2477 return mex_context ? mex_context->
calloc (n, size) : ::calloc (n, size);
2489 return mex_context ? mex_context->
realloc (ptr, size)
2490 : std::realloc (ptr, size);
2497 mex_context->
free (ptr);
2505 return mex_context ? mex_context->
mark_array (ptr) : ptr;
2633 if (! (mex_context && mex_context->
free_value (ptr)))
2793 return ptr->
get_m ();
2799 return ptr->
get_n ();
2845 return static_cast<double *
> (ptr->
get_data ());
3077 volatile int nargout = nargout_arg;
3084 int nout = nargout == 0 ? 1 :
nargout;
3086 for (
int i = 0;
i < nout;
i++)
3108 fcn (tmp_nargout, argout, tmp_nargin, argin);
3114 fcn (nargout, argout, nargin, argin);
3121 if (nargout == 0 && argout[0])
3140 return mex_context ? mex_context->
function_name () :
"unknown";
3161 bool execution_error =
false;
3167 retval =
feval (fname, args, nargout);
3169 catch (
const octave::execution_exception&)
3175 execution_error =
true;
3186 int num_to_copy = retval.
length ();
3188 if (nargout < retval.
length ())
3189 num_to_copy = nargout;
3191 for (
int i = 0; i < num_to_copy; i++)
3200 while (num_to_copy < nargout)
3201 argout[num_to_copy++] = 0;
3203 return execution_error ? 1 : 0;
3216 const char *field_names[] = {
"identifier",
"message",
"case",
"stack"};
3219 std::string msg =
"mexCallMATLABWithTrap: function call <"
3243 bool execution_error =
false;
3251 catch (
const octave::execution_exception&)
3255 execution_error =
true;
3258 if (parse_status || execution_error)
3270 bool execution_error =
false;
3278 catch (
const octave::execution_exception&)
3282 execution_error =
true;
3285 if (parse_status || execution_error)
3287 const char *field_names[] = {
"identifier",
"message",
"case",
"stack"};
3290 std::string msg =
"mexEvalStringWithTrap: eval of <"
3316 if (fmt &&
strlen (fmt) > 0)
3321 sprintf (tmpfmt,
"%s: %s", fname, fmt);
3323 va_start (args, fmt);
3347 if (fmt &&
strlen (fmt) > 0)
3352 sprintf (tmpfmt,
"%s: %s", fname, fmt);
3354 va_start (args, fmt);
3365 va_start (args, fmt);
3378 if (!
strcmp (space,
"global"))
3386 bool caller = !
strcmp (space,
"caller");
3387 bool base = !
strcmp (space,
"base");
3404 mexErrMsgTxt (
"mexGetVariable: symbol table does not exist");
3432 if (name[0] ==
'\0')
3435 if (! name || name[0] ==
'\0')
3438 if (!
strcmp (space,
"global"))
3446 bool caller = !
strcmp (space,
"caller");
3447 bool base = !
strcmp (space,
"base");
3464 mexErrMsgTxt (
"mexPutVariable: symbol table does not exist");
3489 assert (curr_mex_fcn);
3540 if (mex_lock_count.find (fname) == mex_lock_count.end ())
3541 mex_lock_count[fname] = 1;
3543 mex_lock_count[
fname]++;
3555 return (ret ? 0 : 1);
3565 std::map<std::string,int>::iterator
p = mex_lock_count.find (fname);
3567 if (p != mex_lock_count.end ())
3569 int count = --mex_lock_count[
fname];
3575 mex_lock_count.erase (p);
mxArray_matlab(mxClassID id_arg, const dim_vector &dv)
const char * mexFunctionName(void)
bool is_scalar(void) const
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
bool mxIsUint16(const mxArray *ptr)
bool mxIsInt32(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)
void * get_data(void) const
mxArray(const octave_value &ov)
bool mxIsLogicalScalarTrue(const mxArray *ptr)
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)
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 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
mxArray * mxCreateUninitNumericArray(mwSize ndims, const mwSize *dims, mxClassID class_id, mxComplexity flag)
void * mxMalloc(size_t n)
OCTINTERP_API size_t octave_vformat(std::ostream &os, const char *fmt, va_list args)
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
bool mxIsFunctionHandle(const mxArray *ptr)
identity matrix If supplied two scalar respectively For allows like xample val
mxArray_matlab(mxClassID id_arg=mxUNKNOWN_CLASS)
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
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
octave_idx_type nfields(void) const
bool mxIsInt64(const mxArray *ptr)
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)
bool mxIsSparse(const mxArray *ptr)
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)
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)
bool is_scalar(void) const
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 is_double(void) const
void global_mark(void *ptr)
bool is_int8_type(void) const
mxArray_number(mxClassID id_arg, mwSize ndims_arg, const mwSize *dims_arg, mxComplexity flag=mxREAL, bool init=true)
void * get_data(void) const
mxArray * mexCallMATLABWithTrap(int nargout, mxArray *argout[], int nargin, mxArray *argin[], const char *fname)
int is_struct(void) const
static octave_function * current(void)
bool mxIsUint8(const mxArray *ptr)
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)
bool mxIsInf(const double v)
const mwSize * mxGetDimensions(const mxArray *ptr)
int mexSet(double handle, const char *property, mxArray *val)
octave_value as_octave_value(void) const
OCTAVE_NORETURN void err_invalid_type(void) const
void set_cell(mwIndex, mxArray *)
mxArray_octave_value(const octave_value &ov)
double lo_ieee_nan_value(void)
octave_idx_type nzmax(void) const
int is_complex(void) const
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
virtual bool is_octave_value(void) const
int is_single(void) const
bool is_int32_type(void) const
char * mxArrayToString(const mxArray *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 * 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
bool mxIsUint32(const mxArray *ptr)
bool mxIsClass(const mxArray *ptr, const char *name)
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
void * get_data(void) const
void remove_field(int key_num)
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
void mexSetTrapFlag(int flag)
void mxRemoveField(mxArray *ptr, int key_num)
int is_double(void) const
int is_sparse(void) const
int add_field(const char *key)
int is_numeric(void) const
bool mxIsNaN(const double v)
mwIndex * get_jc(void) const
int set_dimensions(mwSize *dims_arg, mwSize ndims_arg)
mwSize get_number_of_elements(void) const
bool mxIsDouble(const mxArray *ptr)
mxArray_cell(mwSize m, mwSize n)
mxArray * make_value(const octave_value &ov)
bool mxIsLogicalScalar(const mxArray *ptr)
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
mxArray * mxCreateUninitNumericMatrix(mwSize m, mwSize n, mxClassID class_id, mxComplexity flag)
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)
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
void mark_foreign(void *ptr)
mxArray * mxCreateStructArray(mwSize ndims, const mwSize *dims, int num_keys, const char **keys)
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
void add_fcn(void(*fcn)(void))
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 is_uint32(void) const
static llvm::LLVMContext & context
static char * strsave(const char *str)
OCTINTERP_API bool mislocked(const std::string &)
mwSize get_nzmax(void) const
int mxAddField(mxArray *ptr, const char *key)
double * mxGetPi(const mxArray *ptr)
const char * mxGetClassName(const mxArray *ptr)
nd deftypefn *octave_map m
bool mxIsNumeric(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)
bool mxIsLogical(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
int get_number_of_fields(void) const
bool is_string(void) const
bool strcmp(const T &str_a, const T &str_b)
True if strings are the same.
int is_complex(void) const
bool is_double_type(void) const
int is_uint16(void) const
const T * data(void) const
void * calloc(size_t n, size_t t)
void mxSetData(mxArray *ptr, void *pr)
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)
int mxSetDimensions(mxArray *ptr, const mwSize *dims, mwSize ndims)
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 &)
bool is_scalar(void) const
const char * get_class_name(void) const
mxArray * mexEvalStringWithTrap(const char *s)
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)
int set_dimensions(mwSize *dims_arg, mwSize ndims_arg)
void mexMakeMemoryPersistent(void *ptr)
int set_dimensions(mwSize *, mwSize)
OCTINTERP_API void munlock(const std::string &)
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)
mwSize get_number_of_dimensions(void) const
void init(const char **keys)
mxClassID get_class_id(void) const
static void goto_base_frame(void)
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
mxArray * get_field_by_number(mwIndex, int) const
int get_number_of_fields(void) const
the exceeded dimensions are set to if fewer subscripts than dimensions are the exceeding dimensions are merged into the final requested dimension For consider the following dims
T::size_type strlen(const typename T::value_type *str)
mxArray_matlab & operator=(const mxArray_matlab &)
mxArray * mxCreateCellArray(mwSize ndims, const mwSize *dims)
dim_vector dims(void) const
void set_nzmax(mwSize nzmax_arg)
mwIndex calc_single_subscript(mwSize nsubs, mwIndex *subs) 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)
OCTINTERP_API void set_global_value(const std::string &nm, const octave_value &val)
~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 *)
mex(octave_mex_function *f)
void mxSetPi(mxArray *ptr, double *pi)
void warning(const char *fmt,...)
octave::unwind_protect frame
void recover_from_exception(void)
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
bool mxIsScalar(const mxArray *ptr)
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
bool mxIsChar(const mxArray *ptr)
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)
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)
bool mxIsInt8(const mxArray *ptr)
OCTINTERP_API octave_value get_global_value(const std::string &nm, bool silent=false)
=val(i)}if ode{val(i)}occurs in table i
mxArray_number(mwSize m, const char **str)
mxArray_octave_value(const mxArray_octave_value &arg)
bool is_uint8_type(void) const
mxArray * mxDuplicateArray(const mxArray *ptr)
mxArray_sparse(mxClassID id_arg, mwSize m, mwSize n, mwSize nzmax_arg, mxComplexity flag=mxREAL)
bool mxIsFromGlobalWS(const mxArray *)
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)
issues an error eealso double
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)
bool mxIsComplex(const mxArray *ptr)
mxChar * mxGetChars(const mxArray *ptr)
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
bool mxIsCell(const mxArray *ptr)
std::complex< float > FloatComplex
mxArray * get_field_by_number(mwIndex, int) const
bool mxIsStruct(const mxArray *ptr)
int is_logical_scalar_true(void) const
size_t mxGetM(const mxArray *ptr)
octave_value get_property_from_handle(double handle, const std::string &property, const std::string &func)
static std::set< void * > global_memlist
mwIndex calc_single_subscript(mwSize nsubs, mwIndex *subs) const
mxArray * mxCreateNumericArray(mwSize ndims, const mwSize *dims, mxClassID class_id, mxComplexity flag)
OCTINTERP_API octave_value_list eval_string(const std::string &, bool silent, int &parse_status, int nargout)
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)
const T * fortran_vec(void) const
bool mxIsUint64(const mxArray *ptr)
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)
mxArray_sparse & operator=(const mxArray_sparse &)
mwIndex * get_ir(void) const
mwSize get_nzmax(void) const
bool mxIsInt16(const mxArray *ptr)
bool is_uint32_type(void) const
bool mxIsSingle(const mxArray *ptr)
Vector representing the dimensions (size) of an Array.
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 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
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
std::set< void * > foreign_memlist
int add_field(const char *)
static int valid_key(const char *key)
mxArray * mxGetCell(const mxArray *ptr, mwIndex idx)
mwSize * get_dimensions(void) const
void mexMakeArrayPersistent(mxArray *ptr)
void(* cmex_fptr)(int nlhs, mxArray **plhs, int nrhs, mxArray **prhs)
std::set< mxArray * > arraylist
bool set_property_in_handle(double handle, const std::string &property, const octave_value &arg, const std::string &func)
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
bool mxIsEmpty(const mxArray *ptr)
static mxArray * maybe_mark_array(mxArray *ptr)
bool mxIsFinite(const double v)
OCTINTERP_API void mlock(void)
void maybe_mutate(void) const
mxArray_number(mxClassID id_arg, mwSize m, mwSize n, mxComplexity flag=mxREAL, bool init=true)
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)