23 #if defined (HAVE_CONFIG_H) 97 for (
int i = 1;
i < nel;
i++)
99 if (! (isalnum (key[
i]) || key[
i] ==
'_'))
334 else if (cn ==
"single")
336 else if (cn ==
"char")
338 else if (cn ==
"logical")
340 else if (cn ==
"cell")
342 else if (cn ==
"struct")
344 else if (cn ==
"function_handle")
346 else if (cn ==
"int8")
348 else if (cn ==
"uint8")
350 else if (cn ==
"int16")
352 else if (cn ==
"uint16")
354 else if (cn ==
"int32")
356 else if (cn ==
"uint32")
358 else if (cn ==
"int64")
360 else if (cn ==
"uint64")
432 return *static_cast<bool *> (data);
434 return *static_cast<double *> (data);
436 return *
static_cast<double *
> (data);
540 const char *
p =
tmp.data ();
569 const char *
p =
tmp.data ();
676 ndims (ndims_arg < 2 ? 2 : ndims_arg),
684 else if (ndims_arg < 2)
796 && static_cast<mxLogical *> (
get_data ())[0] != 0);
885 default:
return "unknown";
1066 error (
"invalid type for operation");
1119 double *dpr =
static_cast<double *
> (
pr);
1157 for (
mwIndex j = 0; j < m; j++)
1159 const char *ptr =
str[j];
1161 size_t tmp_len =
strlen (ptr);
1163 for (
size_t i = 0;
i < tmp_len;
i++)
1164 cpr[m*
i+j] = static_cast<mxChar> (ptr[
i]);
1166 for (
size_t i = tmp_len; i < static_cast<size_t>(nc);
i++)
1167 cpr[m*
i+j] = static_cast<mxChar> (
' ');
1183 memcpy (
pr,
val.pr, nbytes);
1186 memcpy (
pi,
val.pi, nbytes);
1213 retval = *(
static_cast<double *
> (
pr));
1217 retval = *(
static_cast<float *
> (
pr));
1225 retval = *(
static_cast<bool *
> (
pr));
1229 retval = *(
static_cast<int8_t *
> (
pr));
1233 retval = *(
static_cast<uint8_t *
> (
pr));
1237 retval = *(
static_cast<int16_t *
> (
pr));
1241 retval = *(
static_cast<uint16_t *
> (
pr));
1245 retval = *(
static_cast<int32_t *
> (
pr));
1249 retval = *(
static_cast<uint32_t *
> (
pr));
1253 retval = *(
static_cast<int64_t *
> (
pr));
1257 retval = *(
static_cast<uint64_t *
> (
pr));
1281 if (! (nel < buflen))
1293 buf[
i] = static_cast<char> (ptr[
i]);
1314 buf[
i] = static_cast<char> (ptr[
i]);
1334 double *ppr =
static_cast<double *
> (
pr);
1342 double *ppi =
static_cast<double *
> (
pi);
1353 double *ptr =
val.fortran_vec ();
1367 float *ppr =
static_cast<float *
> (
pr);
1375 float *ppi =
static_cast<float *
> (
pi);
1386 float *ptr =
val.fortran_vec ();
1404 char *ptr =
val.fortran_vec ();
1407 ptr[
i] = static_cast<char> (ppr[
i]);
1414 retval = int_to_ov<mxLogical, boolNDArray, bool> (
dv);
1418 retval = int_to_ov<int8_t, int8NDArray, octave_int8> (
dv);
1422 retval = int_to_ov<uint8_t, uint8NDArray, octave_uint8> (
dv);
1426 retval = int_to_ov<int16_t, int16NDArray, octave_int16> (
dv);
1430 retval = int_to_ov<uint16_t, uint16NDArray, octave_uint16> (
dv);
1434 retval = int_to_ov<int32_t, int32NDArray, octave_int32> (
dv);
1438 retval = int_to_ov<uint32_t, uint32NDArray, octave_uint32> (
dv);
1442 retval = int_to_ov<int64_t, int64NDArray, octave_int64> (
dv);
1446 retval = int_to_ov<uint64_t, uint64NDArray, octave_uint64> (
dv);
1458 template <
typename ELT_T,
typename ARRAY_T,
typename ARRAY_ELT_T>
1463 error (
"complex integer types are not supported");
1467 ELT_T *ppr =
static_cast<ELT_T *
> (
pr);
1471 ARRAY_ELT_T *ptr =
val.fortran_vec ();
1512 memcpy (
pr,
val.pr, nbytes);
1515 memcpy (
pi,
val.pi, nbytes);
1577 double *ppr =
static_cast<double *
> (
pr);
1578 double *ppi =
static_cast<double *
> (
pi);
1581 static_cast<octave_idx_type> (
nzmax));
1596 double *ppr =
static_cast<double *
> (
pr);
1599 static_cast<octave_idx_type> (
nzmax));
1603 val.xdata (
i) = ppr[
i];
1617 bool *ppr =
static_cast<bool *
> (
pr);
1620 static_cast<octave_idx_type> (
nzmax));
1624 val.xdata (
i) = ppr[
i];
1636 error (
"single precision sparse data type not supported");
1702 * sizeof (char *)))),
1715 data[
i] = (ptr ? ptr->
dup () :
nullptr);
1757 fields =
static_cast<char **
> 1769 new_data =
static_cast<mxArray **
> 1782 new_data[j++] =
nullptr;
1786 new_data[j++] =
data[
k++];
1803 if (key_num >= 0 && key_num <
nfields)
1809 int new_nfields =
nfields - 1;
1811 char **new_fields =
static_cast<char **
> 1818 for (
int i = 0;
i < key_num;
i++)
1824 if (new_nfields > 0)
1835 new_data[j++] =
data[
k++];
1854 return key_num >= 0 && key_num <
nfields 1864 return key_num >= 0 && key_num <
nfields ?
fields[key_num] :
nullptr;
1955 data[
i] = (ptr ? ptr->
dup () :
nullptr);
2106 new_val->
rep =
nullptr;
2126 mex (
const mex&) =
delete;
2135 std::set<void *>::iterator
p =
memlist.begin ();
2143 std::set<mxArray *>::iterator
p =
arraylist.begin ();
2178 void *ptr = std::malloc (n);
2183 error (
"%s: failed to allocate %d bytes of memory",
2207 memset (ptr, 0, n*
t);
2231 v = std::realloc (ptr, n);
2233 std::set<void *>::iterator
p =
memlist.find (ptr);
2278 warning (
"mxFree: skipping memory not allocated by mxMalloc, mxCalloc, or mxRealloc");
2299 std::set<void *>::iterator
p =
memlist.find (ptr);
2317 std::set<mxArray *>::iterator
p =
arraylist.find (ptr);
2358 bool inlist =
false;
2360 std::set<mxArray *>::iterator
p =
arraylist.find (ptr);
2370 warning (
"mex::free_value: skipping memory not allocated by mex::make_value");
2449 static inline void *
2467 static inline void *
2479 if (key_num >= 0 && key_num <
nfields)
2517 return std::numeric_limits<double>::epsilon ();
2549 : std::realloc (ptr, size);
2852 return ptr->
get_m ();
2858 return ptr->
get_n ();
2904 return static_cast<double *
> (ptr->
get_data ());
2992 const mxArray *property_value)
2994 ptr->
set_property (idx, property_name, property_value);
3149 volatile int nargout = nargout_arg;
3158 for (
int i = 0;
i < nout;
i++)
3159 argout[
i] =
nullptr;
3169 argin[
i] =
context.make_value (args(
i));
3182 fcn (tmp_nargout, argout, tmp_nargin, argin);
3195 if (
nargout == 0 && argout[0])
3235 bool execution_error =
false;
3243 catch (
const octave::execution_exception&)
3249 execution_error =
true;
3265 for (
int i = 0;
i < num_to_copy;
i++)
3275 argout[num_to_copy++] =
nullptr;
3277 return execution_error ? 1 : 0;
3290 const char *field_names[] = {
"identifier",
"message",
"case",
"stack"};
3293 std::string msg =
"mexCallMATLABWithTrap: function call <" 3317 bool execution_error =
false;
3325 catch (
const octave::execution_exception&)
3329 execution_error =
true;
3332 if (parse_status || execution_error)
3344 bool execution_error =
false;
3352 catch (
const octave::execution_exception&)
3356 execution_error =
true;
3359 if (parse_status || execution_error)
3361 const char *field_names[] = {
"identifier",
"message",
"case",
"stack"};
3364 std::string msg =
"mexEvalStringWithTrap: eval of <" 3390 if (fmt &&
strlen (fmt) > 0)
3395 sprintf (tmpfmt,
"%s: %s",
fname, fmt);
3397 va_start (args, fmt);
3421 if (fmt &&
strlen (fmt) > 0)
3426 sprintf (tmpfmt,
"%s: %s",
fname, fmt);
3428 va_start (args, fmt);
3439 va_start (args, fmt);
3452 if (!
strcmp (space,
"global"))
3465 bool caller = !
strcmp (space,
"caller");
3466 bool base = !
strcmp (space,
"base");
3489 mexErrMsgTxt (
"mexGetVariable: symbol table does not exist");
3492 if (
val.is_defined ())
3517 if (
name[0] ==
'\0')
3523 if (!
strcmp (space,
"global"))
3536 bool caller = !
strcmp (space,
"caller");
3537 bool base = !
strcmp (space,
"base");
3560 mexErrMsgTxt (
"mexPutVariable: symbol table does not exist");
3585 assert (curr_mex_fcn);
3655 return (ret ? 0 : 1);
OCTINTERP_API octave_value_list feval(const std::string &name, const octave_value_list &args=octave_value_list(), int nargout=0)
const char * get_field_name_by_number(int) const
mxArray_matlab(mxClassID id_arg, const dim_vector &dv)
const char * mexFunctionName(void)
int is_uint16(void) const
int add_field(const char *)
mxArray * get_property(mwIndex idx, const char *pname) const
char * array_to_string(void) const
bool mxIsUint16(const mxArray *ptr)
bool mxIsInt32(const mxArray *ptr)
int is_uint16(void) const
int is_double(void) const
void set_data(void *pr_arg)
void set_property(mwIndex idx, const char *pname, const mxArray *pval)
void set_name(const char *name_arg)
mxArray_number(const mxArray_number &val)
mxArray(const octave_value &ov)
bool mxIsLogicalScalarTrue(const mxArray *ptr)
const mxArray * mexGetVariablePtr(const char *space, const char *name)
int is_complex(void) const
int is_logical(void) const
mxArray * get_field_by_number(mwIndex, int) const
mxArray * mxCreateStructMatrix(mwSize m, mwSize n, int num_keys, const char **keys)
void mexErrMsgIdAndTxt(const char *id, const char *fmt,...)
bool is_uint32_type(void) const
mxArray_matlab(mxClassID id_arg, mwSize ndims_arg, const mwSize *dims_arg)
octave_value as_octave_value(void) const
void * get_data(void) const
bool free_value(mxArray *ptr)
interpreter & __get_interpreter__(const std::string &who)
mxArray_struct(const dim_vector &dv, int num_keys_arg, const char **keys)
void assign(const std::string &name, const octave_value &value, bool force_add)
int is_numeric(void) const
mxArray * as_mxArray(void) const
mxArray * mxCreateSparseLogicalMatrix(mwSize m, mwSize n, mwSize nzmax)
static octave_value as_octave_value(const mxArray *ptr, bool null_is_empty=true)
void set_cell(mwIndex, mxArray *)
char * array_to_string(void) const
mxArray * mxCreateCharArray(mwSize ndims, const mwSize *dims)
void set_field_by_number(mwIndex index, int key_num, mxArray *val)
const char * get_class_name(void) const
mxArray * dup(void) 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)
void * get_data(void) const
bool is_scalar(void) const
mxClassID get_class_id(void) const
mxLogical * mxGetLogicals(const mxArray *ptr)
static void recover_from_exception(void)
int is_logical(void) const
int mexAtExit(void(*f)(void))
int is_function_handle(void) const
mxArray_base * dup(void) const
double * mxGetPr(const mxArray *ptr)
int is_logical_scalar_true(void) const
bool islogical(void) const
void * mxGetData(const mxArray *ptr)
int mexPutVariable(const char *space, const char *name, const mxArray *ptr)
int get_number_of_fields(void) const
void * get_imag_data(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)
bool is_scalar(void) const
void verror_with_id(const char *id, const char *fmt, va_list args)
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 const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE * f
void set_imag_data(void *pi)
void mxSetProperty(mxArray *ptr, mwIndex idx, const char *property_name, const mxArray *property_value)
mwIndex * mxGetJc(const mxArray *ptr)
mwIndex calc_single_subscript(mwSize nsubs, mwIndex *subs) const
mwIndex * get_ir(void) const
bool mxIsInt64(const mxArray *ptr)
mxArray * mutate(void) const
mwSize get_number_of_elements(void) const
std::set< void * > memlist
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)
void * calloc_unmarked(size_t n, size_t t)
int is_numeric(void) const
void error(const char *fmt,...)
#define lo_ieee_finite(x)
static void * maybe_mark_foreign(void *ptr)
virtual mxArray * mutate(void) const
void * get_imag_data(void) const
static void * malloc(size_t n)
double lo_ieee_inf_value(void)
void global_mark(void *ptr)
mxArray_number(mxClassID id_arg, mwSize ndims_arg, const mwSize *dims_arg, mxComplexity flag=mxREAL, bool init=true)
mxArray * mexCallMATLABWithTrap(int nargout, mxArray *argout[], int nargin, mxArray *argin[], const char *fname)
bool mxIsUint8(const mxArray *ptr)
octave_value_list call_mex(octave_mex_function &mex_fcn, const octave_value_list &args, int nargout_arg)
mxArray_number(mxClassID id_arg, const dim_vector &dv, mxComplexity flag=mxREAL)
mxArray_number & operator=(const mxArray_number &)
double get_scalar(void) const
octave_value as_octave_value(void) const
int is_double(void) const
mxArray * mxCreateLogicalScalar(mxLogical val)
int mexPrintf(const char *fmt,...)
virtual int is_logical_scalar(void) const
mxArray * mexGetVariable(const char *space, const char *name)
int is_class(const char *name_arg) const
int is_struct(void) const
int is_sparse(void) const
void mxDestroyArray(mxArray *ptr)
bool is_defined(void) const
char * array_to_string(void) const
static void * maybe_unmark(void *ptr)
bool mxIsInf(const double v)
const mwSize * mxGetDimensions(const mxArray *ptr)
static llvm::LLVMContext & context
void set_property(mwIndex idx, const char *pname, const mxArray *pval)
int mexSet(double handle, const char *property, mxArray *val)
mxArray * get_field_by_number(mwIndex index, int key_num) const
void set_cell(mwIndex, mxArray *)
mxArray_octave_value(const octave_value &ov)
int is_uint16(void) const
double lo_ieee_nan_value(void)
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
char * mxArrayToString(const mxArray *ptr)
int is_single(void) const
mxArray * mark_array(mxArray *ptr)
mxArray * mxGetField(const mxArray *ptr, mwIndex index, const char *key)
char * array_to_string(void) const
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
void set_property(octave_idx_type idx, const std::string &name, const octave_value &pval)
mwIndex * get_ir(void) const
int get_number_of_fields(void) const
mxArray_base * dup(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)
void * get_data(void) const
octave_value as_octave_value(void) const
int is_function_handle(void) const
int is_complex(void) const
bool mxIsUint32(const mxArray *ptr)
bool is_int16_type(void) const
F77_RET_T(F77_CONST_CHAR_ARG_DECL, F77_CONST_CHAR_ARG_DECL, F77_CONST_CHAR_ARG_DECL, const F77_INT &, const F77_INT &, const F77_INT &, F77_INT &, F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, F77_DBLE *, F77_DBLE *, const F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, F77_INT *, F77_INT &F77_CHAR_ARG_LEN_DECL F77_CHAR_ARG_LEN_DECL F77_CHAR_ARG_LEN_DECL)
bool mxIsClass(const mxArray *ptr, const char *name)
void set_nzmax(mwSize nzmax)
mex & operator=(const mex &)=delete
mxArray * mxGetProperty(const mxArray *ptr, mwIndex idx, const char *property_name)
int is_struct(void) const
mxArray * mxCreateString(const char *str)
mwIndex calc_single_subscript(mwSize nsubs, mwIndex *subs) const
int get_string(char *buf, mwSize buflen) const
mwIndex * get_jc(void) const
void remove_field(int key_num)
mwSize * get_dimensions(void) const
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 const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
void mexSetTrapFlag(int flag)
void mxRemoveField(mxArray *ptr, int key_num)
octave_value as_octave_value(void) const
bool is_octave_value(void) const
int add_field(const char *key)
int is_uint64(void) const
bool mxIsNaN(const double v)
octave_value resize(const dim_vector &dv, bool fill=false) const
int set_dimensions(mwSize *dims_arg, mwSize ndims_arg)
mxArray * get_property(mwIndex idx, const char *pname) const
bool mxIsDouble(const mxArray *ptr)
mxArray_cell(mwSize m, mwSize n)
mxArray * make_value(const octave_value &ov)
int get_field_number(const char *key) const
int is_sparse(void) const
charNDArray char_array_value(bool frc_str_conv=false) const
int is_uint32(void) const
bool mxIsLogicalScalar(const mxArray *ptr)
void set_cell(mwIndex idx, mxArray *val)
mxArray * mxCreateUninitNumericMatrix(mwSize m, mwSize n, mxClassID class_id, mxComplexity flag)
int get_string(char *buf, mwSize buflen) const
mxClassID mxGetClassID(const mxArray *ptr)
mwSize mxGetNzmax(const mxArray *ptr)
mwSize get_nzmax(void) const
void set_field_by_number(mwIndex index, int key_num, mxArray *val)
symbol_table & __get_symbol_table__(const std::string &who)
nd deftypefn *std::string name
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
void mark_foreign(void *ptr)
mwSize get_number_of_elements(void) const
mxArray * mxCreateStructArray(mwSize ndims, const mwSize *dims, int num_keys, const char **keys)
int get_string(char *buf, mwSize buflen) const
octave_value as_octave_value(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 xample nargout(@histc)
void * get_data(void) const
bool is_function_handle(void) const
dim_vector dims_to_dim_vector(void) const
int get_field_number(const char *) const
OCTINTERP_API octave_value_list eval_string(const std::string &, bool silent, int &parse_status, int nargout)
octave_idx_type numel(const octave_value_list &idx)
void request_mutation(void) const
void * get_imag_data(void) const
static char * strsave(const char *str)
int mxAddField(mxArray *ptr, const char *key)
double * mxGetPi(const mxArray *ptr)
const char * mxGetClassName(const mxArray *ptr)
mwSize get_nzmax(void) const
bool mxIsNumeric(const mxArray *ptr)
mwSize get_nzmax(void) const
void * mex_get_data(void) const
bool is_uint64_type(void) const
bool is_scalar(void) const
mxArray * mxCreateDoubleScalar(double val)
const mxArray * mexGet(double handle, const char *property)
int is_double(void) const
bool mxIsLogical(const mxArray *ptr)
mxArray * mxCreateCellMatrix(mwSize m, mwSize n)
bool is_single_type(void) const
int mexEvalString(const char *s)
static void * calloc(size_t n, size_t t)
void unmark_array(mxArray *ptr)
mxArray_base * dup(void) const
double scalar_value(bool frc_str_conv=false) const
bool strcmp(const T &str_a, const T &str_b)
True if strings are the same.
bool mislocked(const std::string &nm)
void munlock(const std::string &nm)
dim_vector dims(void) const
int get_string(char *, mwSize) const
int is_uint32(void) const
void * calloc(size_t n, size_t t)
void mxSetData(mxArray *ptr, void *pr)
mxArray_number(mxClassID id_arg, mxLogical val)
int mxGetString(const mxArray *ptr, char *buf, mwSize buflen)
void mxSetPr(mxArray *ptr, double *pr)
mxArray * get_cell(mwIndex) const
octave_idx_type rows(void) const
int is_logical_scalar_true(void) const
void goto_base_frame(void)
mwSize get_number_of_dimensions(void) const
void * realloc(void *ptr, size_t n)
bool issparse(void) const
mwSize get_number_of_elements(void) const
void set_class_name(const char *name_arg)
octave_classdef * classdef_object_value(bool silent=false) const
#define panic_impossible()
bool mutation_needed(void) const
int is_complex(void) const
bool set_property_in_handle(double handle, const std::string &property, const octave_value &arg, const std::string &func)
void set_class_name(const char *name_arg)
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_octave_value & operator=(const mxArray_octave_value &)=delete
mxArray_sparse(const mxArray_sparse &val)
mxArray_cell & operator=(const mxArray_cell &)
mxArray * mexEvalStringWithTrap(const char *s)
void mxSetN(mxArray *ptr, mwSize n)
int set_dimensions(mwSize *dims_arg, mwSize ndims_arg)
void mexMakeMemoryPersistent(void *ptr)
int set_dimensions(mwSize *, mwSize)
mxArray * mxCreateCharMatrixFromStrings(mwSize m, const char **str)
mxArray * mxCreateDoubleMatrix(mwSize m, mwSize n, mxComplexity flag)
mxArray_base * dup(void) const
std::string class_name(void) const
void global_unmark(void *ptr)
double get_scalar(void) const
void * mex_fcn_ptr(void) const
void init(const char **keys)
bool isstruct(void) const
size_t get_element_size(void) const
mxClassID get_class_id(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
int is_logical(void) const
void * get_data(void) const
bool is_int8_type(void) const
T::size_type strlen(const typename T::value_type *str)
mxArray_matlab & operator=(const mxArray_matlab &)
mxArray * mxCreateCellArray(mwSize ndims, const mwSize *dims)
int is_uint64(void) const
int is_uint64(void) const
void * get_data(void) const
mwIndex calc_single_subscript(mwSize nsubs, mwIndex *subs) const
void set_nzmax(mwSize nzmax_arg)
void(* cmex_fptr)(int nlhs, mxArray **plhs, int nrhs, mxArray **prhs)
mwSize * get_dimensions(void) const
octave_value varval(const std::string &name) const
static mxArray * maybe_unmark_array(mxArray *ptr)
const char * function_name(void) const
void unmark_foreign(void *ptr)
int add_field(const char *key)
bool is_int32_type(void) const
void mxSetM(mxArray *ptr, mwSize m)
void maybe_mutate(void) const
~mxArray_octave_value(void)
mxArray_number(mxClassID id_arg, double val)
mxArray_struct & operator=(const mxArray_struct &val)
void atexit(void(*fcn)(void))
int is_sparse(void) const
mxArray_cell(const dim_vector &dv)
void set_imag_data(void *pi_arg)
double get_scalar(void) const
void set_data(void *data_arg)
void set_class_name(const char *)
mex(octave_mex_function *f)
int get_number_of_fields(void) const
octave_function * current(void) const
void mxSetPi(mxArray *ptr, double *pi)
void warning(const char *fmt,...)
mwIndex * get_ir(void) const
octave::unwind_protect frame
octave_value get_property_from_handle(double handle, const std::string &property, const std::string &func)
void set_cell(mwIndex idx, mxArray *val)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
mwIndex * get_ir(void) const
void mexErrMsgTxt(const char *s)
void set_jc(mwIndex *jc_arg)
void set_field_by_number(mwIndex, int, mxArray *)
mxArray_matlab(const mxArray_matlab &val)
mxArray_struct(mwSize m, mwSize n, int num_keys_arg, const char **keys)
int is_complex(void) const
bool mxIsScalar(const mxArray *ptr)
int is_single(void) const
OCTAVE_NORETURN void err_invalid_type(void) const
octave_value get_property(octave_idx_type idx, const std::string &name) const
static char * strsave(const char *s)
void mxSetClassName(mxArray *ptr, const char *name)
bool mxIsChar(const mxArray *ptr)
mxArray * mxCreateLogicalArray(mwSize ndims, const mwSize *dims)
int mxGetNumberOfFields(const mxArray *ptr)
symbol_scope __require_current_scope__(const std::string &who)
octave_value global_varval(const std::string &name) const
F77_RET_T(* fmex_fptr)(F77_INT &nlhs, mxArray **plhs, F77_INT &nrhs, mxArray **prhs)
const char * get_field_name_by_number(int key_num) const
void mexWarnMsgIdAndTxt(const char *id, const char *fmt,...)
int get_number_of_fields(void) const
void set_data(void *data_arg)
octave_idx_type * mex_get_ir(void) const
octave_f77_int_type F77_INT
mxArray_number(const char *str)
static mwSize max_str_len(mwSize m, const char **str)
bool mxIsInt8(const mxArray *ptr)
mxArray_number(mwSize m, const char **str)
mwSize get_nzmax(void) const
mxArray_octave_value(const mxArray_octave_value &arg)
mxArray * mxDuplicateArray(const mxArray *ptr)
mxArray_sparse(mxClassID id_arg, mwSize m, mwSize n, mwSize nzmax_arg, mxComplexity flag=mxREAL)
bool mxIsFromGlobalWS(const mxArray *)
mwIndex * get_jc(void) const
int is_uint32(void) const
bool is_int64_type(void) const
void set_field_by_number(mwIndex, int, mxArray *)
call_stack & __get_call_stack__(const std::string &who)
mwIndex * mxGetIr(const mxArray *ptr)
void set_imag_data(void *)
void * mxRealloc(void *ptr, size_t size)
mxArray * get_cell(mwIndex idx) const
mxArray_matlab(mxClassID id_arg, mwSize m, mwSize n)
int is_single(void) const
mxArray * mxCreateLogicalMatrix(mwSize m, mwSize n)
bool mxIsComplex(const mxArray *ptr)
mxChar * mxGetChars(const mxArray *ptr)
mwSize * get_dimensions(void) const
mxArray * get_field_by_number(mwIndex index, int key_num) const
octave_idx_type length(void) const
const char * get_class_name(void) const
mxArray_struct(mwSize ndims_arg, const mwSize *dims_arg, int num_keys_arg, const char **keys)
void set_imag_data(void *)
mxArray_struct(const mxArray_struct &val)
void mexWarnMsgTxt(const char *s)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
int get_field_number(const char *key) const
octave_mex_function * current_mex_function(void) const
int is_sparse(void) const
void * get_imag_data(void) const
void resize(octave_idx_type n, const octave_value &rfv=octave_value())
void * malloc_unmarked(size_t n)
mwIndex * get_jc(void) const
void add_method(T *obj, void(T::*method)(void))
octave_value int_to_ov(const dim_vector &dv) const
mxArray * mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID class_id, mxComplexity flag)
bool iscomplex(void) const
octave_idx_type nfields(void) const
bool mxIsCell(const mxArray *ptr)
bool is_string(void) const
std::complex< float > FloatComplex
bool is_double_type(void) const
bool mxIsStruct(const mxArray *ptr)
int is_logical_scalar_true(void) const
size_t mxGetM(const mxArray *ptr)
mxArray * get_field_by_number(mwIndex, int) const
static std::set< void * > global_memlist
int get_field_number(const char *) const
mxArray * mxCreateNumericArray(mwSize ndims, const mwSize *dims, mxClassID class_id, mxComplexity flag)
const char * get_field_name_by_number(int key_num) const
void mxSetImagData(mxArray *ptr, void *pi)
mxArray * as_mxArray(void) const
double get_scalar(void) const
OCTAVE_NORETURN void err_invalid_type(void) const
int is_logical_scalar(void) const
int is_function_handle(void) const
std::complex< double > Complex
void mxSetFieldByNumber(mxArray *ptr, mwIndex index, int key_num, mxArray *val)
bool mxIsUint64(const mxArray *ptr)
int is_numeric(void) const
bool is_range(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)
octave_idx_type length(void) const
mxArray_sparse & operator=(const mxArray_sparse &)
mxArray * get_cell(mwIndex idx) const
mwIndex * get_jc(void) const
mxArray * get_cell(mwIndex) const
bool mxIsInt16(const mxArray *ptr)
bool mxIsSingle(const mxArray *ptr)
octave_idx_type * mex_get_jc(void) const
size_t get_element_size(void) const
Vector representing the dimensions (size) of an Array.
void * get_data(void) const
mwSize get_number_of_dimensions(void) const
bool is_uint8_type(void) const
std::string name(void) const
size_t get_element_size(void) const
octave_mex_function * curr_mex_fcn
mxArray_base * dup(void) const
void remove_field(int key_num)
virtual bool is_octave_value(void) const
mwSize get_number_of_dimensions(void) const
int mxGetFieldNumber(const mxArray *ptr, const char *key)
const char * get_name(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
void global_assign(const std::string &name, const octave_value &value=octave_value())
int is_complex(void) const
std::set< void * > foreign_memlist
int add_field(const char *)
mxClassID get_class_id(void) const
bool is_classdef_object(void) const
octave_idx_type nzmax(void) const
bool isnumeric(void) const
static int valid_key(const char *key)
mxArray * mxGetCell(const mxArray *ptr, mwIndex idx)
void * get_imag_data(void) const
octave_value as_octave_value(void) const
void mexMakeArrayPersistent(mxArray *ptr)
std::set< mxArray * > arraylist
static void xfree(void *ptr)
size_t mxGetN(const mxArray *ptr)
int mexCallMATLAB(int nargout, mxArray *argout[], int nargin, mxArray *argin[], const char *fname)
const char * get_class_name(void) const
size_t mxGetNumberOfElements(const mxArray *ptr)
bool mxIsEmpty(const mxArray *ptr)
static mxArray * maybe_mark_array(mxArray *ptr)
bool mxIsFinite(const double v)
const char * get_field_name_by_number(int) const
bool is_uint16_type(void) const
mxArray_number(mxClassID id_arg, mwSize m, mwSize n, mxComplexity flag=mxREAL, bool init=true)
int is_struct(void) const
static mwIndex calc_single_subscript_internal(mwSize ndims, const mwSize *dims, mwSize nsubs, const mwIndex *subs)
mwIndex mxCalcSingleSubscript(const mxArray *ptr, mwSize nsubs, mwIndex *subs)