26 #if defined (HAVE_CONFIG_H)
100 for (
int i = 1; i < nel; i++)
102 if (! (isalnum (key[i]) || key[i] ==
'_'))
134 mwSize n = (nsubs <= ndims ? nsubs : ndims);
337 else if (cn ==
"single")
339 else if (cn ==
"char")
341 else if (cn ==
"logical")
343 else if (cn ==
"cell")
345 else if (cn ==
"struct")
347 else if (cn ==
"function_handle")
349 else if (cn ==
"int8")
351 else if (cn ==
"uint8")
353 else if (cn ==
"int16")
355 else if (cn ==
"uint16")
357 else if (cn ==
"int32")
359 else if (cn ==
"uint32")
361 else if (cn ==
"int64")
363 else if (cn ==
"uint64")
435 return *
static_cast<bool *
> (data);
437 return *
static_cast<double *
> (data);
439 return *
static_cast<double *
> (data);
543 const char *p = tmp.
data ();
545 for (
mwIndex i = 0; i < nel; i++)
572 const char *p = tmp.
data ();
574 for (
mwIndex i = 0; i < nel; i++)
681 ndims (ndims_arg < 2 ? 2 : ndims_arg),
689 else if (ndims_arg < 2)
695 for (
mwIndex i = 0; i < ndims_arg; i++)
696 dims[i] = dims_arg[i];
838 for (
int i = 0; i <
ndims; i++)
839 dims[i] = dims_arg[i];
890 default:
return "unknown";
1054 for (
mwIndex i = 0; i < nd; i++)
1071 error (
"invalid type for operation");
1124 double *dpr =
static_cast<double *
> (
pr);
1139 str ? (
strlen (str) ? 1 : 0) : 0,
1146 for (
mwIndex i = 0; i < nel; i++)
1164 const char *ptr = str[j];
1166 size_t tmp_len =
strlen (ptr);
1168 for (
size_t i = 0; i < tmp_len; i++)
1169 cpr[
m*i+j] =
static_cast<mxChar> (ptr[i]);
1171 for (
size_t i = tmp_len; i < static_cast<size_t> (nc); i++)
1172 cpr[
m*i+j] =
static_cast<mxChar> (
' ');
1188 memcpy (
pr, val.
pr, nbytes);
1191 memcpy (
pi, val.
pi, nbytes);
1218 retval = *(
static_cast<double *
> (
pr));
1222 retval = *(
static_cast<float *
> (
pr));
1230 retval = *(
static_cast<bool *
> (
pr));
1234 retval = *(
static_cast<int8_t *
> (
pr));
1238 retval = *(
static_cast<uint8_t *
> (
pr));
1242 retval = *(
static_cast<int16_t *
> (
pr));
1246 retval = *(
static_cast<uint16_t *
> (
pr));
1250 retval = *(
static_cast<int32_t *
> (
pr));
1254 retval = *(
static_cast<uint32_t *
> (
pr));
1258 retval = *(
static_cast<int64_t *
> (
pr));
1262 retval = *(
static_cast<uint64_t *
> (
pr));
1286 if (! (nel < buflen))
1297 for (
mwIndex i = 0; i < nel; i++)
1298 buf[i] =
static_cast<char> (ptr[i]);
1318 for (
mwIndex i = 0; i < nel; i++)
1319 buf[i] =
static_cast<char> (ptr[i]);
1339 double *ppr =
static_cast<double *
> (
pr);
1347 double *ppi =
static_cast<double *
> (
pi);
1349 for (
mwIndex i = 0; i < nel; i++)
1350 ptr[i] =
Complex (ppr[i], ppi[i]);
1360 for (
mwIndex i = 0; i < nel; i++)
1372 float *ppr =
static_cast<float *
> (
pr);
1380 float *ppi =
static_cast<float *
> (
pi);
1382 for (
mwIndex i = 0; i < nel; i++)
1393 for (
mwIndex i = 0; i < nel; i++)
1411 for (
mwIndex i = 0; i < nel; i++)
1412 ptr[i] =
static_cast<char> (ppr[i]);
1419 retval = int_to_ov<mxLogical, boolNDArray, bool> (dv);
1423 retval = int_to_ov<int8_t, int8NDArray, octave_int8> (dv);
1427 retval = int_to_ov<uint8_t, uint8NDArray, octave_uint8> (dv);
1431 retval = int_to_ov<int16_t, int16NDArray, octave_int16> (dv);
1435 retval = int_to_ov<uint16_t, uint16NDArray, octave_uint16> (dv);
1439 retval = int_to_ov<int32_t, int32NDArray, octave_int32> (dv);
1443 retval = int_to_ov<uint32_t, uint32NDArray, octave_uint32> (dv);
1447 retval = int_to_ov<int64_t, int64NDArray, octave_int64> (dv);
1451 retval = int_to_ov<uint64_t, uint64NDArray, octave_uint64> (dv);
1463 template <
typename ELT_T,
typename ARRAY_T,
typename ARRAY_ELT_T>
1468 error (
"complex integer types are not supported");
1472 ELT_T *ppr =
static_cast<ELT_T *
> (
pr);
1476 ARRAY_ELT_T *ptr = val.fortran_vec ();
1478 for (
mwIndex i = 0; i < nel; i++)
1500 nzmax = (nzmax_arg > 0 ? nzmax_arg : 1);
1520 memcpy (
pr, val.
pr, nbytes);
1523 memcpy (
pi, val.
pi, nbytes);
1574 nzmax = (nzmax_arg > 0 ? nzmax_arg : 1);
1589 double *ppr =
static_cast<double *
> (
pr);
1590 double *ppi =
static_cast<double *
> (
pi);
1608 double *ppr =
static_cast<double *
> (
pr);
1615 val.
xdata (i) = ppr[i];
1629 bool *ppr =
static_cast<bool *
> (
pr);
1636 val.
xdata (i) = ppr[i];
1648 error (
"single precision sparse data type not supported");
1714 * sizeof (char *)))),
1719 for (
int i = 0; i <
nfields; i++)
1727 data[i] = (ptr ? ptr->
dup () :
nullptr);
1740 for (
int i = 0; i <
nfields; i++)
1748 for (
int i = 0; i <
nfields; i++)
1755 for (
mwIndex i = 0; i < ntot; i++)
1769 fields =
static_cast<char **
>
1781 new_data =
static_cast<mxArray **
>
1790 for (
mwIndex i = 0; i < ntot; i++)
1794 new_data[j++] =
nullptr;
1798 new_data[j++] =
data[k++];
1815 if (key_num >= 0 && key_num <
nfields)
1821 int new_nfields =
nfields - 1;
1823 char **new_fields =
static_cast<char **
>
1830 for (
int i = 0; i < key_num; i++)
1831 new_fields[i] =
fields[i];
1833 for (
int i = key_num + 1; i <
nfields; i++)
1834 new_fields[i-1] =
fields[i];
1836 if (new_nfields > 0)
1842 for (
mwIndex i = 0; i < ntot; i++)
1847 new_data[j++] =
data[k++];
1866 return key_num >= 0 && key_num <
nfields
1876 return key_num >= 0 && key_num <
nfields ?
fields[key_num] :
nullptr;
1883 for (
int i = 0; i <
nfields; i++)
1909 for (
int i = 0; i <
nfields; i++)
1919 m.assign (keys[i], c);
1964 for (
mwIndex i = 0; i < nel; i++)
1967 data[i] = (ptr ? ptr->
dup () :
nullptr);
1984 for (
mwIndex i = 0; i < nel; i++)
2011 for (
mwIndex i = 0; i < nel; i++)
2118 new_val->
rep =
nullptr;
2177 std::string nm = fcn->
name ();
2195 error (
"%s: failed to allocate %zd bytes of memory",
2219 memset (ptr, 0,
n*t);
2243 auto p_local =
memlist.find (ptr);
2246 v = std::realloc (ptr,
n);
2250 if (p_local !=
memlist.end ())
2292 warning (
"mxFree: skipping memory not allocated by mxMalloc, mxCalloc, or mxRealloc");
2372 bool inlist =
false;
2384 warning (
"mex::free_value: skipping memory not allocated by mex::make_value");
2463 static inline void *
2481 static inline void *
2493 if (key_num >= 0 && key_num <
nfields)
2531 return std::numeric_limits<double>::epsilon ();
2563 : std::realloc (ptr, size);
2866 return ptr->
get_m ();
2872 return ptr->
get_n ();
2918 return static_cast<double *
> (ptr->
get_data ());
3006 const mxArray *property_value)
3008 ptr->
set_property (idx, property_name, property_value);
3163 volatile int nargout = nargout_arg;
3165 int nargin = args.
length ();
3167 for (
int i = 0; i < nargin; i++)
3170 int nout = (nargout == 0 ? 1 : nargout);
3172 for (
int i = 0; i < nout; i++)
3173 argout[i] =
nullptr;
3182 for (
int i = 0; i < nargin; i++)
3183 argin[i] =
context.make_value (args(i));
3193 F77_INT tmp_nargout = nargout;
3196 fcn (tmp_nargout, argout, tmp_nargin, argin);
3202 fcn (nargout, argout, nargin, argin);
3209 if (nargout == 0 && argout[0])
3217 for (
int i = 0; i < nargout; i++)
3233 mxArray *argin[],
const char *fname)
3246 for (
int i = 0; i < nargin; i++)
3251 bool execution_error =
false;
3260 ([&tw] (
const std::list<octave::octave_lvalue> *lvl)
3269 catch (
const octave::execution_exception&)
3279 execution_error =
true;
3290 int num_to_copy =
retval.length ();
3292 if (nargout <
retval.length ())
3293 num_to_copy = nargout;
3295 for (
int i = 0; i < num_to_copy; i++)
3304 while (num_to_copy < nargout)
3305 argout[num_to_copy++] =
nullptr;
3307 return execution_error ? 1 : 0;
3312 mxArray *argin[],
const char *fname)
3320 const char *field_names[] = {
"identifier",
"message",
"case",
"stack"};
3323 std::string msg =
"mexCallMATLABWithTrap: function call <"
3324 + std::string (fname) +
"> failed";
3349 bool execution_error =
false;
3355 ret = interp.
eval_string (std::string (s),
false, parse_status, 0);
3357 catch (
const octave::execution_exception&)
3361 execution_error =
true;
3364 if (parse_status || execution_error)
3378 bool execution_error =
false;
3384 ret = interp.
eval_string (std::string (s),
false, parse_status, 0);
3386 catch (
const octave::execution_exception&)
3390 execution_error =
true;
3393 if (parse_status || execution_error)
3395 const char *field_names[] = {
"identifier",
"message",
"case",
"stack"};
3398 std::string msg =
"mexEvalStringWithTrap: eval of <"
3399 + std::string (s) +
"> failed";
3415 if (s[
len - 1] ==
'\n')
3417 std::string s_tmp (s,
len - 1);
3434 if (fmt &&
strlen (fmt) > 0)
3439 sprintf (tmpfmt,
"%s: %s", fname, fmt);
3441 va_start (args, fmt);
3460 if (s[
len - 1] ==
'\n')
3462 std::string s_tmp (s,
len - 1);
3463 warning (
"%s\n", s_tmp.c_str ());
3482 if (fmt &&
strlen (fmt) > 0)
3487 sprintf (tmpfmt,
"%s: %s", fname, fmt);
3489 va_start (args, fmt);
3500 va_start (args, fmt);
3515 if (!
strcmp (space,
"global"))
3523 bool caller = !
strcmp (space,
"caller");
3524 bool base = !
strcmp (space,
"base");
3544 mexErrMsgTxt (
"mexGetVariable: symbol table does not exist");
3572 if (
name[0] ==
'\0')
3580 if (!
strcmp (space,
"global"))
3588 bool caller = !
strcmp (space,
"caller");
3589 bool base = !
strcmp (space,
"base");
3609 mexErrMsgTxt (
"mexPutVariable: symbol table does not exist");
3634 assert (curr_mex_fcn);
3704 return (ret ? 0 : 1);
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
const T * data(void) const
Size of the specified dimension.
const T * fortran_vec(void) const
Size of the specified dimension.
octave_idx_type * xridx(void)
octave_idx_type * xcidx(void)
Vector representing the dimensions (size) of an Array.
void resize(int n, int fill_value=0)
mxArray * make_value(const octave_value &ov)
void * calloc(size_t n, size_t t)
mex & operator=(const mex &)=delete
std::set< void * > memlist
const char * function_name(void) const
std::set< mxArray * > arraylist
void unmark_array(mxArray *ptr)
std::set< void * > foreign_memlist
void * calloc_unmarked(size_t n, size_t t)
octave_mex_function * current_mex_function(void) const
void * malloc_unmarked(size_t n)
void global_unmark(void *ptr)
mex(octave_mex_function *f)
bool free_value(mxArray *ptr)
octave_mex_function * curr_mex_fcn
void * realloc(void *ptr, size_t n)
void global_mark(void *ptr)
void mark_foreign(void *ptr)
mxArray * mark_array(mxArray *ptr)
static std::set< void * > global_memlist
void unmark_foreign(void *ptr)
virtual mxArray * mutate(void) const
virtual int is_logical_scalar(void) const
virtual bool is_octave_value(void) const
OCTAVE_NORETURN void err_invalid_type(void) const
virtual octave_value as_octave_value(void) const =0
mxArray_cell & operator=(const mxArray_cell &)
mxArray_cell(const mxArray_cell &val)
void * get_data(void) const
void set_cell(mwIndex idx, mxArray *val)
mxArray_base * dup(void) const
mxArray_cell(mwSize ndims_arg, const mwSize *dims_arg)
octave_value as_octave_value(void) const
mxArray_cell(mwSize m, mwSize n)
mxArray_cell(const dim_vector &dv)
void set_data(void *data_arg)
mxArray * get_cell(mwIndex idx) const
void set_cell(mwIndex, mxArray *)
mxArray * get_field_by_number(mwIndex, int) const
void set_field_by_number(mwIndex, int, mxArray *)
void set_class_name(const char *name_arg)
mxArray_matlab & operator=(const mxArray_matlab &)
int add_field(const char *)
size_t get_element_size(void) const
mxClassID get_class_id(void) const
mxArray_matlab(mxClassID id_arg, const dim_vector &dv)
bool is_scalar(void) const
void * get_imag_data(void) const
mwIndex * get_ir(void) const
int get_number_of_fields(void) const
mwIndex calc_single_subscript(mwSize nsubs, mwIndex *subs) const
mwIndex * get_jc(void) const
int is_numeric(void) const
mxArray_matlab(const mxArray_matlab &val)
void * get_data(void) const
int is_complex(void) const
char * array_to_string(void) const
int is_logical_scalar_true(void) const
mxArray_matlab(mxClassID id_arg, mwSize ndims_arg, const mwSize *dims_arg)
const char * get_field_name_by_number(int) const
int is_double(void) const
int is_logical(void) const
OCTAVE_NORETURN void err_invalid_type(void) const
int is_struct(void) const
mwSize * get_dimensions(void) const
int get_field_number(const char *) const
int set_dimensions(mwSize *dims_arg, mwSize ndims_arg)
mxArray_matlab(mxClassID id_arg=mxUNKNOWN_CLASS)
int is_function_handle(void) const
int is_uint32(void) const
int is_single(void) const
mxArray_matlab(mxClassID id_arg, mwSize m, mwSize n)
mxArray * get_cell(mwIndex) const
mwSize get_number_of_dimensions(void) const
mwSize get_nzmax(void) const
double get_scalar(void) const
int is_sparse(void) const
int is_uint64(void) const
const char * get_class_name(void) const
void set_imag_data(void *)
int get_string(char *, mwSize) const
int is_uint16(void) const
dim_vector dims_to_dim_vector(void) const
mwSize get_number_of_elements(void) const
int get_string(char *buf, mwSize buflen) const
mxArray_number(mxClassID id_arg, mwSize ndims_arg, const mwSize *dims_arg, mxComplexity flag=mxREAL, bool init=true)
void * get_data(void) const
int is_complex(void) const
mxArray_number(mxClassID id_arg, double val)
mxArray_base * dup(void) const
void set_data(void *pr_arg)
mxArray_number(mwSize m, const char **str)
mxArray_number & operator=(const mxArray_number &)
mxArray_number(mxClassID id_arg, mwSize m, mwSize n, mxComplexity flag=mxREAL, bool init=true)
mxArray_number(const char *str)
mxArray_number(mxClassID id_arg, mxLogical val)
octave_value int_to_ov(const dim_vector &dv) const
char * array_to_string(void) const
mxArray_number(const mxArray_number &val)
octave_value as_octave_value(void) const
double get_scalar(void) const
void * get_imag_data(void) const
void set_imag_data(void *pi_arg)
mxArray_number(mxClassID id_arg, const dim_vector &dv, mxComplexity flag=mxREAL)
int is_sparse(void) const
bool mutation_needed(void) const
int set_dimensions(mwSize *, mwSize)
mxClassID get_class_id(void) const
int is_uint16(void) const
const char * get_class_name(void) const
int add_field(const char *)
void * get_data(void) const
octave_value as_octave_value(void) const
mwSize get_number_of_elements(void) const
void set_cell(mwIndex, mxArray *)
size_t get_element_size(void) const
int is_logical(void) const
~mxArray_octave_value(void)
mxArray_octave_value(const mxArray_octave_value &arg)
const char * get_field_name_by_number(int) const
int is_uint64(void) const
mxArray_octave_value(const octave_value &ov)
mxArray_octave_value & operator=(const mxArray_octave_value &)=delete
void set_class_name(const char *)
int is_numeric(void) const
mwSize * get_dimensions(void) const
mxArray * get_cell(mwIndex) const
void set_imag_data(void *)
int get_field_number(const char *) const
void set_property(mwIndex idx, const char *pname, const mxArray *pval)
bool is_scalar(void) const
int get_number_of_fields(void) const
char * array_to_string(void) const
mwIndex calc_single_subscript(mwSize nsubs, mwIndex *subs) const
bool is_octave_value(void) const
void * get_imag_data(void) const
mxArray_base * dup(void) const
mwIndex * get_jc(void) const
mwIndex * get_ir(void) const
int is_complex(void) const
mwSize get_nzmax(void) const
mxArray * get_property(mwIndex idx, const char *pname) const
int is_double(void) const
void request_mutation(void) const
int is_uint32(void) const
int is_single(void) const
int get_string(char *buf, mwSize buflen) const
mxArray * as_mxArray(void) const
double get_scalar(void) const
mwSize get_number_of_dimensions(void) const
void set_field_by_number(mwIndex, int, mxArray *)
int is_logical_scalar_true(void) const
int is_function_handle(void) const
mxArray * get_field_by_number(mwIndex, int) const
mxArray * mutate(void) const
int is_struct(void) const
mwIndex * get_ir(void) const
void set_ir(mwIndex *ir_arg)
void * get_imag_data(void) const
void set_nzmax(mwSize nzmax_arg)
mxArray_sparse(const mxArray_sparse &val)
void * get_data(void) const
mxArray_sparse & operator=(const mxArray_sparse &)
void set_data(void *pr_arg)
void set_jc(mwIndex *jc_arg)
mxArray_sparse(mxClassID id_arg, mwSize m, mwSize n, mwSize nzmax_arg, mxComplexity flag=mxREAL)
int is_complex(void) const
octave_value as_octave_value(void) const
mxArray_base * dup(void) const
void set_imag_data(void *pi_arg)
mwSize get_nzmax(void) const
mwIndex * get_jc(void) const
int is_sparse(void) const
int get_number_of_fields(void) const
octave_value as_octave_value(void) const
void remove_field(int key_num)
mxArray_struct(const mxArray_struct &val)
mxArray_struct & operator=(const mxArray_struct &val)
int get_field_number(const char *key) const
mxArray * get_field_by_number(mwIndex index, int key_num) const
mxArray_struct(const dim_vector &dv, int num_keys_arg, const char **keys)
const char * get_field_name_by_number(int key_num) const
mxArray_struct(mwSize m, mwSize n, int num_keys_arg, const char **keys)
int add_field(const char *key)
mxArray_struct(mwSize ndims_arg, const mwSize *dims_arg, int num_keys_arg, const char **keys)
void init(const char **keys)
void set_data(void *data_arg)
mxArray_base * dup(void) const
void * get_data(void) const
void set_field_by_number(mwIndex index, int key_num, mxArray *val)
mxClassID get_class_id(void) const
int is_single(void) const
mxArray(const octave_value &ov)
void maybe_mutate(void) const
void * get_imag_data(void) const
size_t get_element_size(void) const
static void * malloc(size_t n)
const char * get_class_name(void) const
static void * calloc(size_t n, size_t t)
int is_logical_scalar_true(void) const
int is_uint32(void) const
void set_property(mwIndex idx, const char *pname, const mxArray *pval)
mxArray * get_property(mwIndex idx, const char *pname) const
mxArray * dup(void) const
void * get_data(void) const
mwIndex * get_jc(void) const
mwIndex calc_single_subscript(mwSize nsubs, mwIndex *subs) const
int is_function_handle(void) const
int set_dimensions(mwSize *dims_arg, mwSize ndims_arg)
static char * strsave(const char *str)
int is_uint64(void) const
int is_struct(void) const
int get_field_number(const char *key) const
mxArray * get_field_by_number(mwIndex index, int key_num) const
int add_field(const char *key)
int get_number_of_fields(void) const
int is_sparse(void) const
int is_double(void) const
mwSize get_nzmax(void) const
mwIndex * get_ir(void) const
static octave_value as_octave_value(const mxArray *ptr, bool null_is_empty=true)
bool is_scalar(void) const
void set_nzmax(mwSize nzmax)
int is_logical(void) const
double get_scalar(void) const
mwSize get_number_of_dimensions(void) const
const char * get_name(void) const
int is_numeric(void) const
mwSize get_number_of_elements(void) const
const char * get_field_name_by_number(int key_num) const
int get_string(char *buf, mwSize buflen) const
int is_class(const char *name_arg) const
void set_class_name(const char *name_arg)
int is_complex(void) const
void set_name(const char *name_arg)
int is_uint16(void) const
void set_field_by_number(mwIndex index, int key_num, mxArray *val)
void set_cell(mwIndex idx, mxArray *val)
mxArray * get_cell(mwIndex idx) const
char * array_to_string(void) const
int is_logical_scalar(void) const
octave_value as_octave_value(void) const
mwSize * get_dimensions(void) const
void set_imag_data(void *pi)
void remove_field(int key_num)
void add_method(T *obj, void(T::*method)(Params...), Args &&... args)
void assign(const std::string &name, const octave_value &val=octave_value())
void global_assign(const std::string &name, const octave_value &val=octave_value())
octave_value varval(const std::string &name) const
octave_value global_varval(const std::string &name) const
octave_value_list eval_string(const std::string &eval_str, bool silent, int &parse_status, int nargout)
bool mislocked(bool skip_first=false) const
void recover_from_exception(void)
void mlock(bool skip_first=false) const
void munlock(bool skip_first=false) const
tree_evaluator & get_evaluator(void)
size_t current_call_stack_frame_number(void) const
void set_lvalue_list(const std::list< octave_lvalue > *lst)
const std::list< octave_lvalue > * lvalue_list(void) const
void restore_frame(size_t n)
void goto_base_frame(void)
octave_function * current_function(bool skip_first=false) const
octave_value get_property(octave_idx_type idx, const std::string &name) const
void set_property(octave_idx_type idx, const std::string &name, const octave_value &pval)
std::string name(void) const
void * mex_fcn_ptr(void) const
void atexit(void(*fcn)(void))
void resize(octave_idx_type n, const octave_value &rfv=octave_value())
octave_idx_type length(void) const
bool is_classdef_object(void) const
bool issparse(void) const
void * mex_get_data(void) const
bool is_uint16_type(void) const
mxArray * as_mxArray(void) const
bool is_int8_type(void) const
octave_idx_type rows(void) const
bool isnumeric(void) const
octave_idx_type numel(void) const
bool is_string(void) const
bool is_defined(void) const
charNDArray char_array_value(bool frc_str_conv=false) const
bool is_double_type(void) const
bool is_function_handle(void) const
std::string class_name(void) const
bool is_uint32_type(void) const
bool is_int64_type(void) const
bool isstruct(void) const
double scalar_value(bool frc_str_conv=false) const
octave_idx_type nfields(void) const
bool is_int32_type(void) const
bool is_uint64_type(void) const
octave_idx_type nzmax(void) const
bool is_int16_type(void) const
bool is_range(void) const
octave_classdef * classdef_object_value(bool silent=false) const
octave_idx_type * mex_get_jc(void) const
bool is_single_type(void) const
octave_idx_type * mex_get_ir(void) const
bool is_uint8_type(void) const
bool iscomplex(void) const
bool islogical(void) const
dim_vector dims(void) const
void warning(const char *fmt,...)
void vwarning_with_id(const char *id, const char *fmt, va_list args)
void verror_with_id(const char *id, const char *fmt, va_list args)
void error(const char *fmt,...)
#define panic_impossible()
octave_f77_int_type F77_INT
bool set_property_in_handle(double handle, const std::string &property, const octave_value &arg, const std::string &func)
octave_value get_property_from_handle(double handle, const std::string &property, const std::string &func)
double lo_ieee_inf_value(void)
double lo_ieee_nan_value(void)
#define lo_ieee_finite(x)
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)
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
F77_RET_T const F77_DBLE const F77_DBLE * f
static char * strsave(const char *s)
void mxSetIr(mxArray *ptr, mwIndex *ir)
void mxSetCell(mxArray *ptr, mwIndex idx, mxArray *val)
bool mxIsUint16(const mxArray *ptr)
mxArray * mxCreateCellMatrix(mwSize m, mwSize n)
void mexWarnMsgIdAndTxt(const char *id, const char *fmt,...)
size_t mxGetN(const mxArray *ptr)
void * mxGetData(const mxArray *ptr)
mwIndex mxCalcSingleSubscript(const mxArray *ptr, mwSize nsubs, mwIndex *subs)
bool mxIsFunctionHandle(const mxArray *ptr)
bool mxIsStruct(const mxArray *ptr)
double * mxGetPi(const mxArray *ptr)
int mxGetFieldNumber(const mxArray *ptr, const char *key)
void mexErrMsgTxt(const char *s)
void mxSetField(mxArray *ptr, mwIndex index, const char *key, mxArray *val)
size_t mxGetNumberOfElements(const mxArray *ptr)
void(* cmex_fptr)(int nlhs, mxArray **plhs, int nrhs, mxArray **prhs)
bool mxIsUint32(const mxArray *ptr)
void mxSetProperty(mxArray *ptr, mwIndex idx, const char *property_name, const mxArray *property_value)
bool mxIsComplex(const mxArray *ptr)
std::map< std::string, int > mex_lock_count
int mexAtExit(void(*f)(void))
mxArray * mxCreateUninitNumericArray(mwSize ndims, const mwSize *dims, mxClassID class_id, mxComplexity flag)
size_t mxGetElementSize(const mxArray *ptr)
bool mxIsFinite(const double v)
bool mxIsScalar(const mxArray *ptr)
bool mxIsFromGlobalWS(const mxArray *)
mxArray * mxCreateLogicalArray(mwSize ndims, const mwSize *dims)
void mxSetFieldByNumber(mxArray *ptr, mwIndex index, int key_num, mxArray *val)
const char * mxGetClassName(const mxArray *ptr)
void * mxMalloc(size_t n)
bool mxIsLogicalScalarTrue(const mxArray *ptr)
mxArray * mxCreateLogicalScalar(mxLogical val)
mxClassID mxGetClassID(const mxArray *ptr)
bool mxIsLogical(const mxArray *ptr)
mxArray * mxGetProperty(const mxArray *ptr, mwIndex idx, const char *property_name)
static void * maybe_unmark(void *ptr)
mxArray * mxCreateCellArray(mwSize ndims, const mwSize *dims)
void mexWarnMsgTxt(const char *s)
void mxSetData(mxArray *ptr, void *pr)
const char * mexFunctionName(void)
void * mxCalloc(size_t n, size_t size)
mwIndex * mxGetIr(const mxArray *ptr)
bool mxIsInt64(const mxArray *ptr)
mxArray * mxGetFieldByNumber(const mxArray *ptr, mwIndex index, int key_num)
mxArray * mexCallMATLABWithTrap(int nargout, mxArray *argout[], int nargin, mxArray *argin[], const char *fname)
int mxSetDimensions(mxArray *ptr, const mwSize *dims, mwSize ndims)
octave_value_list call_mex(octave_mex_function &mex_fcn, const octave_value_list &args, int nargout_arg)
int mexPrintf(const char *fmt,...)
bool mxIsChar(const mxArray *ptr)
bool mxIsInf(const double v)
mxArray * mxCreateUninitNumericMatrix(mwSize m, mwSize n, mxClassID class_id, mxComplexity flag)
bool mxIsUint8(const mxArray *ptr)
void mxDestroyArray(mxArray *ptr)
void mxSetNzmax(mxArray *ptr, mwSize nzmax)
bool mxIsSingle(const mxArray *ptr)
void mexErrMsgIdAndTxt(const char *id, const char *fmt,...)
F77_RET_T(* fmex_fptr)(F77_INT &nlhs, mxArray **plhs, F77_INT &nrhs, mxArray **prhs)
int mxAddField(mxArray *ptr, const char *key)
void mexMakeMemoryPersistent(void *ptr)
bool mxIsInt8(const mxArray *ptr)
void mxSetImagData(mxArray *ptr, void *pi)
int mexCallMATLAB(int nargout, mxArray *argout[], int nargin, mxArray *argin[], const char *fname)
bool mxIsNaN(const double v)
void mxSetPr(mxArray *ptr, double *pr)
mxArray * mxCreateSparseLogicalMatrix(mwSize m, mwSize n, mwSize nzmax)
mxArray * mexEvalStringWithTrap(const char *s)
mxArray * mexGetVariable(const char *space, const char *name)
mxArray * mxCreateStructArray(mwSize ndims, const mwSize *dims, int num_keys, const char **keys)
bool mxIsClass(const mxArray *ptr, const char *name)
mxArray * mxCreateStructMatrix(mwSize m, mwSize n, int num_keys, const char **keys)
mxArray * mxCreateDoubleMatrix(mwSize m, mwSize n, mxComplexity flag)
static mwSize max_str_len(mwSize m, const char **str)
int mxGetNumberOfFields(const mxArray *ptr)
mxArray * mxCreateCharArray(mwSize ndims, const mwSize *dims)
mwIndex * mxGetJc(const mxArray *ptr)
int mexPutVariable(const char *space, const char *name, const mxArray *ptr)
void mxSetN(mxArray *ptr, mwSize n)
static mxArray * maybe_mark_array(mxArray *ptr)
bool mxIsInt32(const mxArray *ptr)
mxArray * mxCreateCharMatrixFromStrings(mwSize m, const char **str)
int mexIsGlobal(const mxArray *ptr)
void mxSetJc(mxArray *ptr, mwIndex *jc)
bool mxIsInt16(const mxArray *ptr)
const mwSize * mxGetDimensions(const mxArray *ptr)
int mexEvalString(const char *s)
void mexSetTrapFlag(int flag)
mwSize mxGetNzmax(const mxArray *ptr)
void mxSetClassName(mxArray *ptr, const char *name)
const mxArray * mexGetVariablePtr(const char *space, const char *name)
bool mxIsNumeric(const mxArray *ptr)
mxArray * mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID class_id, mxComplexity flag)
bool mxIsCell(const mxArray *ptr)
static mxArray * maybe_unmark_array(mxArray *ptr)
void mexMakeArrayPersistent(mxArray *ptr)
double mxGetScalar(const mxArray *ptr)
void mxRemoveField(mxArray *ptr, int key_num)
size_t mxGetM(const mxArray *ptr)
mxArray * mxCreateDoubleScalar(double val)
int mxGetString(const mxArray *ptr, char *buf, mwSize buflen)
const char * mxGetFieldNameByNumber(const mxArray *ptr, int key_num)
bool mxIsLogicalScalar(const mxArray *ptr)
mxArray * mxCreateLogicalMatrix(mwSize m, mwSize n)
static void xfree(void *ptr)
mwSize mxGetNumberOfDimensions(const mxArray *ptr)
mxLogical * mxGetLogicals(const mxArray *ptr)
double * mxGetPr(const mxArray *ptr)
int mexSet(double handle, const char *property, mxArray *val)
const mxArray * mexGet(double handle, const char *property)
bool mxIsEmpty(const mxArray *ptr)
mxArray * mxGetField(const mxArray *ptr, mwIndex index, const char *key)
char * mxArrayToString(const mxArray *ptr)
static int valid_key(const char *key)
void * mxGetImagData(const mxArray *ptr)
mxChar * mxGetChars(const mxArray *ptr)
mxArray * mxCreateSparse(mwSize m, mwSize n, mwSize nzmax, mxComplexity flag)
bool mxIsSparse(const mxArray *ptr)
bool mxIsUint64(const mxArray *ptr)
mxArray * mxCreateNumericArray(mwSize ndims, const mwSize *dims, mxClassID class_id, mxComplexity flag)
bool mxIsDouble(const mxArray *ptr)
mxArray * mxGetCell(const mxArray *ptr, mwIndex idx)
void mxSetPi(mxArray *ptr, double *pi)
mxArray * mxCreateString(const char *str)
void mxSetM(mxArray *ptr, mwSize m)
static mwIndex calc_single_subscript_internal(mwSize ndims, const mwSize *dims, mwSize nsubs, const mwIndex *subs)
static void * maybe_mark_foreign(void *ptr)
mxArray * mxDuplicateArray(const mxArray *ptr)
void * mxRealloc(void *ptr, size_t size)
bool strcmp(const T &str_a, const T &str_b)
True if strings are the same.
static llvm::LLVMContext & context
interpreter & __get_interpreter__(const std::string &who)
tree_evaluator & __get_evaluator__(const std::string &who)
octave_value_list feval(const char *name, const octave_value_list &args, int nargout)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
size_t vformat(std::ostream &os, const char *fmt, va_list args)
std::complex< double > Complex
std::complex< float > FloatComplex
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
T::size_type strlen(const typename T::value_type *str)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
octave_value::octave_value(const Array< char > &chm, char type) return retval