GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
mxArray Class Reference

#include "mxarray.in.h"

Collaboration diagram for mxArray:

Public Member Functions

 mxArray (const char *str)
 
 mxArray (const dim_vector &dv)
 
 mxArray (const dim_vector &dv, int num_keys, const char **keys)
 
 mxArray (const mxArray &)=delete
 
 mxArray (const octave_value &ov)
 
 mxArray (mwSize m, const char **str)
 
 mxArray (mwSize m, mwSize n)
 
 mxArray (mwSize m, mwSize n, int num_keys, const char **keys)
 
 mxArray (mwSize ndims, const mwSize *dims)
 
 mxArray (mwSize ndims, const mwSize *dims, int num_keys, const char **keys)
 
 mxArray (mxClassID id, const dim_vector &dv, mxComplexity flag=mxREAL)
 
 mxArray (mxClassID id, double val)
 
 mxArray (mxClassID id, mwSize m, mwSize n, mwSize nzmax, mxComplexity flag=mxREAL)
 
 mxArray (mxClassID id, mwSize m, mwSize n, mxComplexity flag=mxREAL, bool init=true)
 
 mxArray (mxClassID id, mwSize ndims, const mwSize *dims, mxComplexity flag=mxREAL, bool init=true)
 
 mxArray (mxClassID id, mxLogical val)
 
 ~mxArray (void)
 
int add_field (const char *key)
 
char * array_to_string (void) const
 
octave_value as_octave_value (void) const
 
mwIndex calc_single_subscript (mwSize nsubs, mwIndex *subs) const
 
mxArraydup (void) const
 
mxArrayget_cell (mwIndex idx) const
 
mxClassID get_class_id (void) const
 
const char * get_class_name (void) const
 
void * get_data (void) const
 
mwSizeget_dimensions (void) const
 
size_t get_element_size (void) const
 
mxArrayget_field_by_number (mwIndex index, int key_num) const
 
const char * get_field_name_by_number (int key_num) const
 
int get_field_number (const char *key) const
 
void * get_imag_data (void) const
 
mwIndexget_ir (void) const
 
mwIndexget_jc (void) const
 
mwSize get_m (void) const
 
mwSize get_n (void) const
 
const char * get_name (void) const
 
mwSize get_number_of_dimensions (void) const
 
mwSize get_number_of_elements (void) const
 
int get_number_of_fields (void) const
 
mwSize get_nzmax (void) const
 
mxArrayget_property (mwIndex idx, const char *pname) const
 
double get_scalar (void) const
 
int get_string (char *buf, mwSize buflen) const
 
int is_char (void) const
 
int is_class (const char *name_arg) const
 
int is_complex (void) const
 
int is_double (void) const
 
int is_function_handle (void) const
 
int is_int16 (void) const
 
int is_int32 (void) const
 
int is_int64 (void) const
 
int is_int8 (void) const
 
int is_logical (void) const
 
int is_logical_scalar (void) const
 
int is_logical_scalar_true (void) const
 
int is_numeric (void) const
 
bool is_octave_value (void) const
 
bool is_scalar (void) const
 
int is_single (void) const
 
int is_sparse (void) const
 
int is_struct (void) const
 
int is_uint16 (void) const
 
int is_uint32 (void) const
 
int is_uint64 (void) const
 
int is_uint8 (void) const
 
int iscell (void) const
 
int isempty (void) const
 
mxArraymutate (void) const
 
bool mutation_needed (void) const
 
mxArrayoperator= (const mxArray &)=delete
 
void remove_field (int key_num)
 
void set_cell (mwIndex idx, mxArray *val)
 
void set_class_name (const char *name_arg)
 
void set_data (void *pr)
 
int set_dimensions (mwSize *dims_arg, mwSize ndims_arg)
 
void set_field_by_number (mwIndex index, int key_num, mxArray *val)
 
void set_imag_data (void *pi)
 
void set_ir (mwIndex *ir)
 
void set_jc (mwIndex *jc)
 
void set_m (mwSize m)
 
void set_n (mwSize n)
 
void set_name (const char *name_arg)
 
void set_nzmax (mwSize nzmax)
 
void set_property (mwIndex idx, const char *pname, const mxArray *pval)
 

Static Public Member Functions

static octave_value as_octave_value (const mxArray *ptr, bool null_is_empty=true)
 
static void * calloc (size_t n, size_t t)
 
static void * malloc (size_t n)
 
static char * strsave (const char *str)
 

Private Member Functions

 mxArray (mxArray_base *r, const char *n)
 
void maybe_mutate (void) const
 

Private Attributes

char * name
 
mxArray_baserep
 

Detailed Description

Definition at line 320 of file mxarray.in.h.

Constructor & Destructor Documentation

◆ mxArray() [1/17]

mxArray::mxArray ( const octave_value ov)

Definition at line 2024 of file mex.cc.

Referenced by dup().

◆ mxArray() [2/17]

mxArray::mxArray ( mxClassID  id,
mwSize  ndims,
const mwSize dims,
mxComplexity  flag = mxREAL,
bool  init = true 
)

Definition at line 2027 of file mex.cc.

◆ mxArray() [3/17]

mxArray::mxArray ( mxClassID  id,
const dim_vector dv,
mxComplexity  flag = mxREAL 
)

Definition at line 2031 of file mex.cc.

◆ mxArray() [4/17]

mxArray::mxArray ( mxClassID  id,
mwSize  m,
mwSize  n,
mxComplexity  flag = mxREAL,
bool  init = true 
)

Definition at line 2034 of file mex.cc.

◆ mxArray() [5/17]

mxArray::mxArray ( mxClassID  id,
double  val 
)

Definition at line 2038 of file mex.cc.

◆ mxArray() [6/17]

mxArray::mxArray ( mxClassID  id,
mxLogical  val 
)

Definition at line 2041 of file mex.cc.

◆ mxArray() [7/17]

mxArray::mxArray ( const char *  str)

Definition at line 2044 of file mex.cc.

◆ mxArray() [8/17]

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

Definition at line 2047 of file mex.cc.

◆ mxArray() [9/17]

mxArray::mxArray ( mxClassID  id,
mwSize  m,
mwSize  n,
mwSize  nzmax,
mxComplexity  flag = mxREAL 
)

Definition at line 2050 of file mex.cc.

◆ mxArray() [10/17]

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

Definition at line 2054 of file mex.cc.

◆ mxArray() [11/17]

mxArray::mxArray ( const dim_vector dv,
int  num_keys,
const char **  keys 
)

Definition at line 2058 of file mex.cc.

◆ mxArray() [12/17]

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

Definition at line 2061 of file mex.cc.

◆ mxArray() [13/17]

mxArray::mxArray ( mwSize  ndims,
const mwSize dims 
)

Definition at line 2064 of file mex.cc.

◆ mxArray() [14/17]

mxArray::mxArray ( const dim_vector dv)

Definition at line 2067 of file mex.cc.

◆ mxArray() [15/17]

mxArray::mxArray ( mwSize  m,
mwSize  n 
)

Definition at line 2070 of file mex.cc.

◆ mxArray() [16/17]

mxArray::mxArray ( const mxArray )
delete

◆ ~mxArray()

mxArray::~mxArray ( void  )

Definition at line 2073 of file mex.cc.

References mxFree(), name, and rep.

◆ mxArray() [17/17]

mxArray::mxArray ( mxArray_base r,
const char *  n 
)
inlineprivate

Definition at line 560 of file mxarray.in.h.

Member Function Documentation

◆ add_field()

int mxArray::add_field ( const char *  key)
inline

Definition at line 495 of file mxarray.in.h.

References DO_MUTABLE_METHOD.

Referenced by mxAddField().

◆ array_to_string()

char* mxArray::array_to_string ( void  ) const
inline

Definition at line 517 of file mxarray.in.h.

References mxArray_base::array_to_string(), and rep.

Referenced by mxArrayToString().

◆ as_octave_value() [1/2]

octave_value mxArray::as_octave_value ( const mxArray ptr,
bool  null_is_empty = true 
)
static

Definition at line 2088 of file mex.cc.

References as_octave_value().

Referenced by as_octave_value(), and mxArray_octave_value::set_property().

◆ as_octave_value() [2/2]

octave_value mxArray::as_octave_value ( void  ) const

◆ calc_single_subscript()

mwIndex mxArray::calc_single_subscript ( mwSize  nsubs,
mwIndex subs 
) const
inline

Definition at line 519 of file mxarray.in.h.

References mxArray_base::calc_single_subscript(), and rep.

Referenced by mxCalcSingleSubscript().

◆ calloc()

void * mxArray::calloc ( size_t  n,
size_t  t 
)
static

Definition at line 2458 of file mex.cc.

References mex::calloc_unmarked(), mex_context, and n.

Referenced by mxArray_sparse::mxArray_sparse().

◆ dup()

mxArray* mxArray::dup ( void  ) const
inline

◆ get_cell()

mxArray* mxArray::get_cell ( mwIndex  idx) const
inline

Definition at line 466 of file mxarray.in.h.

References DO_MUTABLE_METHOD.

Referenced by mxGetCell().

◆ get_class_id()

mxClassID mxArray::get_class_id ( void  ) const
inline

Definition at line 453 of file mxarray.in.h.

References mxArray_base::get_class_id(), and rep.

Referenced by mxGetClassID().

◆ get_class_name()

const char* mxArray::get_class_name ( void  ) const
inline

Definition at line 455 of file mxarray.in.h.

References mxArray_base::get_class_name(), and rep.

Referenced by mxGetClassName().

◆ get_data()

void* mxArray::get_data ( void  ) const
inline

Definition at line 474 of file mxarray.in.h.

References DO_MUTABLE_METHOD.

Referenced by mxGetChars(), mxGetData(), mxGetLogicals(), and mxGetPr().

◆ get_dimensions()

mwSize* mxArray::get_dimensions ( void  ) const
inline

Definition at line 430 of file mxarray.in.h.

References mxArray_base::get_dimensions(), and rep.

Referenced by mxGetDimensions().

◆ get_element_size()

size_t mxArray::get_element_size ( void  ) const
inline

Definition at line 522 of file mxarray.in.h.

References mxArray_base::get_element_size(), and rep.

Referenced by mxGetElementSize().

◆ get_field_by_number()

mxArray* mxArray::get_field_by_number ( mwIndex  index,
int  key_num 
) const
inline

Definition at line 500 of file mxarray.in.h.

References DO_MUTABLE_METHOD.

Referenced by mxGetFieldByNumber().

◆ get_field_name_by_number()

const char* mxArray::get_field_name_by_number ( int  key_num) const
inline

Definition at line 508 of file mxarray.in.h.

References DO_MUTABLE_METHOD.

Referenced by mxGetFieldNameByNumber().

◆ get_field_number()

int mxArray::get_field_number ( const char *  key) const
inline

Definition at line 511 of file mxarray.in.h.

References DO_MUTABLE_METHOD.

Referenced by mxGetFieldNumber().

◆ get_imag_data()

void* mxArray::get_imag_data ( void  ) const
inline

Definition at line 476 of file mxarray.in.h.

References DO_MUTABLE_METHOD.

Referenced by mxGetImagData(), and mxGetPi().

◆ get_ir()

mwIndex* mxArray::get_ir ( void  ) const
inline

Definition at line 483 of file mxarray.in.h.

References DO_MUTABLE_METHOD.

Referenced by mxGetIr().

◆ get_jc()

mwIndex* mxArray::get_jc ( void  ) const
inline

Definition at line 485 of file mxarray.in.h.

References DO_MUTABLE_METHOD.

Referenced by mxGetJc().

◆ get_m()

mwSize mxArray::get_m ( void  ) const
inline

Definition at line 426 of file mxarray.in.h.

References mxArray_base::get_m(), and rep.

Referenced by mxGetM().

◆ get_n()

mwSize mxArray::get_n ( void  ) const
inline

Definition at line 428 of file mxarray.in.h.

References mxArray_base::get_n(), and rep.

Referenced by mxGetN().

◆ get_name()

const char* mxArray::get_name ( void  ) const
inline

Definition at line 449 of file mxarray.in.h.

References name.

Referenced by mexPutVariable().

◆ get_number_of_dimensions()

mwSize mxArray::get_number_of_dimensions ( void  ) const
inline

Definition at line 432 of file mxarray.in.h.

References mxArray_base::get_number_of_dimensions(), and rep.

Referenced by mxGetNumberOfDimensions().

◆ get_number_of_elements()

mwSize mxArray::get_number_of_elements ( void  ) const
inline

Definition at line 442 of file mxarray.in.h.

References mxArray_base::get_number_of_elements(), and rep.

Referenced by isempty(), and mxGetNumberOfElements().

◆ get_number_of_fields()

int mxArray::get_number_of_fields ( void  ) const
inline

Definition at line 506 of file mxarray.in.h.

References mxArray_base::get_number_of_fields(), and rep.

Referenced by mxGetNumberOfFields().

◆ get_nzmax()

mwSize mxArray::get_nzmax ( void  ) const
inline

Definition at line 487 of file mxarray.in.h.

References mxArray_base::get_nzmax(), and rep.

Referenced by mxGetNzmax().

◆ get_property()

mxArray* mxArray::get_property ( mwIndex  idx,
const char *  pname 
) const
inline

Definition at line 457 of file mxarray.in.h.

References mxArray_base::get_property(), and rep.

Referenced by mxGetProperty().

◆ get_scalar()

double mxArray::get_scalar ( void  ) const
inline

Definition at line 472 of file mxarray.in.h.

References mxArray_base::get_scalar(), and rep.

Referenced by mxGetScalar().

◆ get_string()

int mxArray::get_string ( char *  buf,
mwSize  buflen 
) const
inline

Definition at line 514 of file mxarray.in.h.

References mxArray_base::get_string(), and rep.

Referenced by mxGetString().

◆ is_char()

int mxArray::is_char ( void  ) const
inline

Definition at line 385 of file mxarray.in.h.

References mxArray_base::is_char(), and rep.

Referenced by mxIsChar().

◆ is_class()

int mxArray::is_class ( const char *  name_arg) const
inline

Definition at line 387 of file mxarray.in.h.

References mxArray_base::is_class(), and rep.

Referenced by mxIsClass().

◆ is_complex()

int mxArray::is_complex ( void  ) const
inline

Definition at line 389 of file mxarray.in.h.

References mxArray_base::is_complex(), and rep.

Referenced by mxIsComplex().

◆ is_double()

int mxArray::is_double ( void  ) const
inline

Definition at line 391 of file mxarray.in.h.

References mxArray_base::is_double(), and rep.

Referenced by mxIsDouble().

◆ is_function_handle()

int mxArray::is_function_handle ( void  ) const
inline

Definition at line 393 of file mxarray.in.h.

References mxArray_base::is_function_handle(), and rep.

Referenced by mxIsFunctionHandle().

◆ is_int16()

int mxArray::is_int16 ( void  ) const
inline

Definition at line 395 of file mxarray.in.h.

References mxArray_base::is_int16(), and rep.

Referenced by mxIsInt16().

◆ is_int32()

int mxArray::is_int32 ( void  ) const
inline

Definition at line 397 of file mxarray.in.h.

References mxArray_base::is_int32(), and rep.

Referenced by mxIsInt32().

◆ is_int64()

int mxArray::is_int64 ( void  ) const
inline

Definition at line 399 of file mxarray.in.h.

References mxArray_base::is_int64(), and rep.

Referenced by mxIsInt64().

◆ is_int8()

int mxArray::is_int8 ( void  ) const
inline

Definition at line 401 of file mxarray.in.h.

References mxArray_base::is_int8(), and rep.

Referenced by mxIsInt8().

◆ is_logical()

int mxArray::is_logical ( void  ) const
inline

Definition at line 403 of file mxarray.in.h.

References mxArray_base::is_logical(), and rep.

Referenced by mxIsLogical().

◆ is_logical_scalar()

int mxArray::is_logical_scalar ( void  ) const
inline

Definition at line 421 of file mxarray.in.h.

References mxArray_base::is_logical_scalar(), and rep.

Referenced by mxIsLogicalScalar().

◆ is_logical_scalar_true()

int mxArray::is_logical_scalar_true ( void  ) const
inline

Definition at line 423 of file mxarray.in.h.

References mxArray_base::is_logical_scalar_true(), and rep.

Referenced by mxIsLogicalScalarTrue().

◆ is_numeric()

int mxArray::is_numeric ( void  ) const
inline

Definition at line 405 of file mxarray.in.h.

References mxArray_base::is_numeric(), and rep.

Referenced by mxIsNumeric().

◆ is_octave_value()

bool mxArray::is_octave_value ( void  ) const
inline

Definition at line 381 of file mxarray.in.h.

References mxArray_base::is_octave_value(), and rep.

◆ is_scalar()

bool mxArray::is_scalar ( void  ) const
inline

Definition at line 447 of file mxarray.in.h.

References mxArray_base::is_scalar(), and rep.

Referenced by mxIsScalar().

◆ is_single()

int mxArray::is_single ( void  ) const
inline

Definition at line 407 of file mxarray.in.h.

References mxArray_base::is_single(), and rep.

Referenced by mxIsSingle().

◆ is_sparse()

int mxArray::is_sparse ( void  ) const
inline

Definition at line 409 of file mxarray.in.h.

References mxArray_base::is_sparse(), and rep.

Referenced by mxIsSparse().

◆ is_struct()

int mxArray::is_struct ( void  ) const
inline

Definition at line 411 of file mxarray.in.h.

References mxArray_base::is_struct(), and rep.

Referenced by mxIsStruct().

◆ is_uint16()

int mxArray::is_uint16 ( void  ) const
inline

Definition at line 413 of file mxarray.in.h.

References mxArray_base::is_uint16(), and rep.

Referenced by mxIsUint16().

◆ is_uint32()

int mxArray::is_uint32 ( void  ) const
inline

Definition at line 415 of file mxarray.in.h.

References mxArray_base::is_uint32(), and rep.

Referenced by mxIsUint32().

◆ is_uint64()

int mxArray::is_uint64 ( void  ) const
inline

Definition at line 417 of file mxarray.in.h.

References mxArray_base::is_uint64(), and rep.

Referenced by mxIsUint64().

◆ is_uint8()

int mxArray::is_uint8 ( void  ) const
inline

Definition at line 419 of file mxarray.in.h.

References mxArray_base::is_uint8(), and rep.

Referenced by mxIsUint8().

◆ iscell()

int mxArray::iscell ( void  ) const
inline

Definition at line 383 of file mxarray.in.h.

References mxArray_base::iscell(), and rep.

Referenced by mxIsCell().

◆ isempty()

int mxArray::isempty ( void  ) const
inline

Definition at line 445 of file mxarray.in.h.

References get_number_of_elements().

Referenced by mxIsEmpty().

◆ malloc()

◆ maybe_mutate()

void mxArray::maybe_mutate ( void  ) const
private

Definition at line 2104 of file mex.cc.

References mxArray_base::is_octave_value(), mxArray_base::mutate(), and rep.

◆ mutate()

mxArray* mxArray::mutate ( void  ) const
inline

Definition at line 526 of file mxarray.in.h.

References mxArray_base::mutate(), and rep.

◆ mutation_needed()

bool mxArray::mutation_needed ( void  ) const
inline

Definition at line 524 of file mxarray.in.h.

References mxArray_base::mutation_needed(), and rep.

◆ operator=()

mxArray& mxArray::operator= ( const mxArray )
delete

◆ remove_field()

void mxArray::remove_field ( int  key_num)
inline

Definition at line 497 of file mxarray.in.h.

References DO_VOID_MUTABLE_METHOD.

Referenced by mxRemoveField().

◆ set_cell()

void mxArray::set_cell ( mwIndex  idx,
mxArray val 
)
inline

Definition at line 469 of file mxarray.in.h.

References DO_VOID_MUTABLE_METHOD.

Referenced by mxSetCell().

◆ set_class_name()

void mxArray::set_class_name ( const char *  name_arg)
inline

Definition at line 463 of file mxarray.in.h.

References DO_VOID_MUTABLE_METHOD.

Referenced by mxSetClassName().

◆ set_data()

void mxArray::set_data ( void *  pr)
inline

Definition at line 479 of file mxarray.in.h.

References DO_VOID_MUTABLE_METHOD.

Referenced by mxSetData(), and mxSetPr().

◆ set_dimensions()

int mxArray::set_dimensions ( mwSize dims_arg,
mwSize  ndims_arg 
)
inline

Definition at line 439 of file mxarray.in.h.

References DO_MUTABLE_METHOD.

Referenced by mxSetDimensions().

◆ set_field_by_number()

void mxArray::set_field_by_number ( mwIndex  index,
int  key_num,
mxArray val 
)
inline

Definition at line 503 of file mxarray.in.h.

References DO_VOID_MUTABLE_METHOD.

Referenced by mxSetFieldByNumber().

◆ set_imag_data()

void mxArray::set_imag_data ( void *  pi)
inline

Definition at line 481 of file mxarray.in.h.

References DO_VOID_MUTABLE_METHOD, and octave::math::pi.

Referenced by mxSetImagData(), and mxSetPi().

◆ set_ir()

void mxArray::set_ir ( mwIndex ir)
inline

Definition at line 489 of file mxarray.in.h.

References DO_VOID_MUTABLE_METHOD.

Referenced by mxSetIr().

◆ set_jc()

void mxArray::set_jc ( mwIndex jc)
inline

Definition at line 491 of file mxarray.in.h.

References DO_VOID_MUTABLE_METHOD.

Referenced by mxSetJc().

◆ set_m()

void mxArray::set_m ( mwSize  m)
inline

Definition at line 435 of file mxarray.in.h.

References DO_VOID_MUTABLE_METHOD, and m.

Referenced by mxSetM().

◆ set_n()

void mxArray::set_n ( mwSize  n)
inline

Definition at line 437 of file mxarray.in.h.

References DO_VOID_MUTABLE_METHOD, and n.

Referenced by mxSetN().

◆ set_name()

void mxArray::set_name ( const char *  name_arg)

Definition at line 2081 of file mex.cc.

References mxFree(), name, and strsave().

◆ set_nzmax()

void mxArray::set_nzmax ( mwSize  nzmax)
inline

Definition at line 493 of file mxarray.in.h.

References DO_VOID_MUTABLE_METHOD.

Referenced by mxSetNzmax().

◆ set_property()

void mxArray::set_property ( mwIndex  idx,
const char *  pname,
const mxArray pval 
)
inline

Definition at line 460 of file mxarray.in.h.

References rep, and mxArray_base::set_property().

Referenced by mxSetProperty().

◆ strsave()

static char* mxArray::strsave ( const char *  str)
inlinestatic

Member Data Documentation

◆ name

char* mxArray::name
private

Definition at line 558 of file mxarray.in.h.

Referenced by ~mxArray(), dup(), get_name(), and set_name().

◆ rep


The documentation for this class was generated from the following files: