77 assert (idx.
length () == 1);
79 std::string nm = idx(0).string_value ();
89 "structure has no member '%s'", nm.c_str ());
98 error (
"invalid index for structure array");
105 error (
"invalid index for structure array assignment");
111 error (
"%s cannot be indexed with %c", nm.c_str (), t);
117 error (
"assignment to structure element failed");
127 "%s: invalid structure field name '%s'",
131 "invalid structure field name '%s'",
138 const std::list<octave_value_list>& idx,
149 if (type.length () > 1 && type[1] ==
'.')
151 std::list<octave_value_list>::const_iterator p = idx.begin ();
197 retval = retval(0).next_subsref (nargout, type, idx, skip);
204 const std::list<octave_value_list>& idx,
215 if (type.length () > 1 && type[1] ==
'.')
217 std::list<octave_value_list>::const_iterator p = idx.begin ();
224 const Cell t = tmp.
index (idx.front (), auto_add);
243 const Cell t =
dotref (idx.front (), auto_add);
263 retval = retval.next_subsref (auto_add, type, idx, skip);
279 const std::string& type)
283 if (type.length () > 0 && type[0] ==
'.' && ! val.
is_map ())
293 const std::list<octave_value_list>& idx,
302 if (idx.front ().empty ())
304 error (
"missing index in indexed assignment");
308 if (n > 1 && ! (type.length () == 2 && type[0] ==
'(' && type[1] ==
'.'))
314 if (type.length () > 1 && type[1] ==
'.')
316 std::list<octave_value_list>::const_iterator p = idx.begin ();
321 assert (key_idx.
length () == 1);
323 std::string key = key_idx(0).string_value ();
330 std::list<octave_value_list> next_idx (idx);
335 next_idx.erase (next_idx.begin ());
336 next_idx.erase (next_idx.begin ());
338 std::string next_type = type.substr (2);
352 if (tmpc.
numel () == 1)
372 : tmp.
subsasgn (next_type, next_idx, rhs));
387 assert (key_idx.
length () == 1);
389 std::string key = key_idx(0).string_value ();
396 std::list<octave_value_list> next_idx (idx);
398 next_idx.erase (next_idx.begin ());
400 std::string next_type = type.substr (1);
413 if (tmpc.
numel () == 1)
430 t_rhs = (orig_undefined
432 : tmp.
subsasgn (next_type, next_idx, rhs));
455 if (n > 1 && type[1] ==
'.')
457 std::list<octave_value_list>::const_iterator p = idx.begin ();
461 assert (key_idx.
length () == 1);
463 std::string key = key_idx(0).string_value ();
480 if (! idxf(k).is_magic_colon ())
481 didx(k) = idxf(k).numel ();
483 if (didx.numel () == tmp_cell.
numel ())
484 tmp_cell = tmp_cell.
reshape (didx);
542 error (
"invalid structure assignment");
559 error (
"invalid structure assignment");
569 assert (key_idx.
length () == 1);
571 std::string key = key_idx(0).string_value ();
640 std::string key =
map.
key (p);
663 if (Vstruct_levels_to_print >= 0)
665 bool max_depth_reached = Vstruct_levels_to_print-- == 0;
667 bool print_fieldnames_only
675 os << dv.
str () <<
" struct array containing the fields:";
684 std::string key = key_list[i];
690 if (print_fieldnames_only)
702 if (print_fieldnames_only)
723 if (Vstruct_levels_to_print < 0)
738 return dims.
length () == 2 && dims (0) == 1 && dims (1) == 1;
751 os <<
"# ndims: " << dv.
length () <<
"\n";
753 for (
int i = 0; i < dv.
length (); i++)
757 os <<
"# length: " << nf <<
"\n";
765 std::string key = keys(i);
790 keywords[0] =
"ndims";
791 keywords[1] =
"length";
797 if (kw == keywords[0])
799 int mdims =
std::max (static_cast<int> (len), 2);
801 for (
int i = 0; i < mdims; i++)
810 if (success && len >= 0)
832 error (
"load: internal error loading struct elements");
843 error (
"load: failed to load structure");
854 error (
"load: failed to extract number of elements in structure");
873 int32_t di = - d.
length ();
874 os.write (reinterpret_cast<char *> (&di), 4);
875 for (
int i = 0; i < d.
length (); i++)
878 os.write (reinterpret_cast<char *> (&di), 4);
882 os.write (reinterpret_cast<char *> (&len), 4);
890 std::string key = keys(i);
909 if (! is.read (reinterpret_cast<char *> (&len), 4))
924 for (
int i = 0; i < mdims; i++)
926 if (! is.read (reinterpret_cast<char *> (&di), 4))
933 if (! is.read (reinterpret_cast<char *> (&len), 4))
960 error (
"load: internal error loading struct elements");
971 error (
"load: failed to load structure");
986 #if defined (HAVE_HDF5)
991 data_hid = H5Gcreate (loc_id, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
993 data_hid = H5Gcreate (loc_id, name, 0);
995 if (data_hid < 0)
return false;
1008 std::string key = keys(i);
1012 bool retval2 =
add_hdf5_data (data_hid, val, key,
"",
false,
1019 H5Gclose (data_hid);
1032 bool retval =
false;
1034 #if defined (HAVE_HDF5)
1040 int current_item = 0;
1041 hsize_t num_obj = 0;
1043 hid_t group_id = H5Gopen (loc_id, name, H5P_DEFAULT);
1045 hid_t group_id = H5Gopen (loc_id, name);
1047 H5Gget_num_objs (group_id, &num_obj);
1048 H5Gclose (group_id);
1053 while (current_item < static_cast<int> (num_obj)
1054 && (retval2 = H5Giterate (loc_id, name, ¤t_item,
1063 error (
"load: internal error loading struct elements");
1092 for (
int i = 0; i < nf; i++)
1093 f[i] = kv[i].c_str ();
1103 for (
int i = 0; i < nf; i++)
1110 for (
mwIndex j = i; j < ntot; j += nf)
1111 elts[j] =
new mxArray (p[k++]);
1130 bool retval =
false;
1137 void *here =
reinterpret_cast<void *
>(&sm_ptr);
1153 assert (idx.
length () == 1);
1155 std::string nm = idx(0).string_value ();
1166 "structure has no member '%s'", nm.c_str ());
1173 const std::list<octave_value_list>& idx)
1181 retval =
dotref (idx.front ());
1183 if (idx.size () > 1)
1194 const std::list<octave_value_list>& idx,
1203 retval(0) =
dotref (idx.front ());
1205 if (idx.size () > 1)
1206 retval = retval(0).next_subsref (nargout, type, idx, skip);
1216 const std::list<octave_value_list>& idx,
1225 retval =
dotref (idx.front (), auto_add);
1227 if (idx.size () > 1)
1228 retval = retval.
next_subsref (auto_add, type, idx, skip);
1247 const std::string& type)
1251 if (type.length () > 0 && type[0] ==
'.' && ! val.
is_map ())
1261 const std::list<octave_value_list>& idx,
1266 if (idx.front ().empty ())
1268 error (
"missing index in indexed assignment");
1280 assert (key_idx.
length () == 1);
1282 std::string key = key_idx(0).string_value ();
1291 std::list<octave_value_list> next_idx (idx);
1293 next_idx.erase (next_idx.begin ());
1295 std::string next_type = type.substr (1);
1319 t_rhs = (orig_undefined
1321 : tmp.
subsasgn (next_type, next_idx, rhs));
1337 retval = tmp.
subsasgn (type, idx, rhs);
1359 std::string key =
map.
key (p);
1382 if (Vstruct_levels_to_print >= 0)
1384 bool max_depth_reached = Vstruct_levels_to_print-- == 0;
1386 bool print_fieldnames_only = max_depth_reached;
1394 os <<
"scalar structure containing the fields:";
1405 std::string key = key_list[i];
1409 if (print_fieldnames_only)
1427 os <<
"<structure>";
1434 const std::string& name)
const
1436 bool retval =
false;
1440 if (Vstruct_levels_to_print < 0)
1441 os << name <<
" = ";
1461 os <<
"# ndims: " << dv.
length () <<
"\n";
1463 for (
int i = 0; i < dv.
length (); i++)
1464 os <<
" " << dv (i);
1467 os <<
"# length: " << nf <<
"\n";
1475 std::string key = keys(i);
1482 return ! os.fail ();
1491 bool success =
true;
1514 error (
"load: internal error loading struct elements");
1525 error (
"load: failed to load structure");
1536 error (
"load: failed to extract number of elements in structure");
1551 os.write (reinterpret_cast<char *> (&len), 4);
1559 std::string key = keys(i);
1566 return ! os.fail ();
1576 bool success =
true;
1578 if (! is.read (reinterpret_cast<char *> (&len), 4))
1604 error (
"load: internal error loading struct elements");
1615 error (
"load: failed to load structure");
1629 bool save_as_floats)
1631 #if defined (HAVE_HDF5)
1633 hid_t data_hid = -1;
1636 data_hid = H5Gcreate (loc_id, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
1638 data_hid = H5Gcreate (loc_id, name, 0);
1640 if (data_hid < 0)
return false;
1653 std::string key = keys(i);
1657 bool retval2 =
add_hdf5_data (data_hid, val, key,
"",
false,
1664 H5Gclose (data_hid);
1677 bool retval =
false;
1679 #if defined (HAVE_HDF5)
1685 int current_item = 0;
1686 hsize_t num_obj = 0;
1688 hid_t group_id = H5Gopen (loc_id, name, H5P_DEFAULT);
1690 hid_t group_id = H5Gopen (loc_id, name);
1692 H5Gget_num_objs (group_id, &num_obj);
1693 H5Gclose (group_id);
1698 while (current_item < static_cast<int> (num_obj)
1699 && (retval2 = H5Giterate (loc_id, name, ¤t_item,
1706 error (
"load: internal error loading struct elements");
1735 for (
int i = 0; i < nf; i++)
1736 f[i] = kv[i].c_str ();
1746 for (
int i = 0; i < nf; i++)
1753 for (
mwIndex j = i; j < ntot; j += nf)
1754 elts[j] =
new mxArray (p[k++]);
1781 DEFUN (
struct, args, ,
1783 @deftypefn {Built-in Function} {@var{s} =} struct ()\n\
1784 @deftypefnx {Built-in Function} {@var{s} =} struct (@var{field1}, @var{value1}, @var{field2}, @var{value2}, @dots{})\n\
1785 @deftypefnx {Built-in Function} {@var{s} =} struct (@var{obj})\n\
1787 Create a scalar or array structure and initialize its values.\n\
1789 The @var{field1}, @var{field2}, @dots{} variables are strings specifying the\n\
1790 names of the fields and the @var{value1}, @var{value2}, @dots{} variables\n\
1791 can be of any type.\n\
1793 If the values are cell arrays, create a structure array and initialize its\n\
1794 values. The dimensions of each cell array of values must match. Singleton\n\
1795 cells and non-cell values are repeated so that they fill the entire array. \n\
1796 If the cells are empty, create an empty structure array with the specified\n\
1799 If the argument is an object, return the underlying struct.\n\
1801 Observe that the syntax is optimized for struct @strong{arrays}. Consider\n\
1802 the following examples:\n\
1806 struct (\"foo\", 1)\n\
1807 @result{} scalar structure containing the fields:\n\
1810 struct (\"foo\", @{@})\n\
1811 @result{} 0x0 struct array containing the fields:\n\
1814 struct (\"foo\", @{ @{@} @})\n\
1815 @result{} scalar structure containing the fields:\n\
1818 struct (\"foo\", @{1, 2, 3@})\n\
1819 @result{} 1x3 struct array containing the fields:\n\
1826 The first case is an ordinary scalar struct---one field, one value. The\n\
1827 second produces an empty struct array with one field and no values, since\n\
1828 being passed an empty cell array of struct array values. When the value is\n\
1829 a cell array containing a single entry, this becomes a scalar struct with\n\
1830 that single entry as the value of the field. That single entry happens\n\
1831 to be an empty cell array.\n\
1833 Finally, if the value is a non-scalar cell array, then @code{struct}\n\
1834 produces a struct @strong{array}.\n\
1835 @seealso{cell2struct, fieldnames, getfield, setfield, rmfield, isfield, orderfields, isstruct, structfun}\n\
1840 int nargin = args.
length ();
1850 if (nargin == 1 && args(0).is_map ())
1853 if (nargin == 1 && args(0).is_object ())
1860 if ((nargin == 1 || nargin == 2)
1861 && args(0).is_empty () && args(0).is_real_matrix ())
1867 if (args(1).is_cellstr ())
1868 retval =
octave_map (args(0).dims (), args(1).cellstr_value ());
1870 error (
"struct: expecting cell array of field names as second argument");
1880 for (
int i = 0; i < nargin; i += 2)
1882 if (! args(i).is_string () || i + 1 >= nargin)
1884 error (
"struct: expecting alternating \"field\", VALUE pairs");
1893 int first_dimensioned_value = 0;
1895 for (
int i = 1; i < nargin; i += 2)
1897 if (args(i).is_cell ())
1903 if (! first_dimensioned_value)
1906 first_dimensioned_value = i + 1;
1908 else if (dims != argdims)
1910 error (
"struct: dimensions of parameter %d do not match those of parameter %d",
1911 first_dimensioned_value, i+1);
1922 for (
int i = 0; i < nargin; i+= 2)
1926 std::string key (args(i).string_value ());
1942 if (args(i+1).is_cell ())
1944 const Cell c (args(i+1).cell_value ());
1984 DEFUN (isstruct, args, ,
1986 @deftypefn {Built-in Function} {} isstruct (@var{x})\n\
1987 Return true if @var{x} is a structure or a structure array.\n\
1988 @seealso{ismatrix, iscell, isa}\n\
1993 if (args.length () == 1)
1994 retval = args(0).
is_map ();
2001 DEFUN (__fieldnames__, args, ,
2003 @deftypefn {Built-in Function} {} __fieldnames__ (@var{struct})\n\
2004 @deftypefnx {Built-in Function} {} __fieldnames__ (@var{obj})\n\
2005 Internal function.\n\
2007 Implements @code{fieldnames()} for structures and Octave objects.\n\
2008 @seealso{fieldnames}\n\
2021 retval =
Cell (0, 1);
2023 retval =
Cell (keys);
2028 DEFUN (isfield, args, ,
2030 @deftypefn {Built-in Function} {} isfield (@var{x}, \"@var{name}\")\n\
2031 @deftypefnx {Built-in Function} {} isfield (@var{x}, @var{name})\n\
2032 Return true if the @var{x} is a structure and it includes an element named\n\
2035 If @var{name} is a cell array of strings then a logical array of equal\n\
2036 dimension is returned.\n\
2037 @seealso{fieldnames}\n\
2042 int nargin = args.
length ();
2048 if (args(0).is_map ())
2055 if (args(1).is_string ())
2057 std::string key = args(1).string_value ();
2061 else if (args(1).is_cell ())
2063 Cell c = args(1).cell_value ();
2069 if (c(i).is_string ())
2071 std::string key = c(i).string_value ();
2089 DEFUN (numfields, args, ,
2091 @deftypefn {Built-in Function} {} numfields (@var{s})\n\
2092 Return the number of fields of the structure @var{s}.\n\
2093 @seealso{fieldnames}\n\
2098 int nargin = args.
length ();
2100 if (nargin == 1 && args(0).is_map ())
2102 retval =
static_cast<double> (args(0).nfields ());
2122 DEFUN (cell2struct, args, ,
2124 @deftypefn {Built-in Function} {} cell2struct (@var{cell}, @var{fields})\n\
2125 @deftypefnx {Built-in Function} {} cell2struct (@var{cell}, @var{fields}, @var{dim})\n\
2126 Convert @var{cell} to a structure.\n\
2128 The number of fields in @var{fields} must match the number of elements in\n\
2129 @var{cell} along dimension @var{dim}, that is\n\
2130 @code{numel (@var{fields}) == size (@var{cell}, @var{dim})}. If @var{dim}\n\
2131 is omitted, a value of 1 is assumed.\n\
2135 A = cell2struct (@{\"Peter\", \"Hannah\", \"Robert\";\n\
2137 @{\"Name\",\"Height\"@}, 1);\n\
2147 @seealso{struct2cell, cell2mat, struct}\n\
2152 int nargin = args.
length ();
2154 if (nargin == 2 || nargin == 3)
2156 if (! args(0).is_cell ())
2158 error (
"cell2struct: argument CELL must be of type cell");
2162 if (! (args(1).is_cellstr () || args(1).is_char_matrix ()))
2164 error (
"cell2struct: FIELDS must be a cell array of strings or a character matrix");
2168 const Cell vals = args(0).cell_value ();
2177 if (args(2).is_real_scalar ())
2179 dim = nargin == 2 ? 0 : args(2).int_value () - 1;
2186 error (
"cell2struct: DIM must be a real scalar");
2193 error (
"cell2struct: DIM must be a valid dimension");
2197 ext = vals.
ndims () > dim ? vals.
dims ()(dim) : 1;
2199 if (ext != fields.
numel ())
2201 error (
"cell2struct: number of FIELDS does not match dimension");
2209 assert (ext == rdv(dim));
2212 rdv(0) = rdv(1-dim);
2217 for (
int i = dim + 1; i < nd; i++)
2260 DEFUN (rmfield, args, ,
2262 @deftypefn {Built-in Function} {@var{sout} =} rmfield (@var{s}, \"@var{f}\")\n\
2263 @deftypefnx {Built-in Function} {@var{sout} =} rmfield (@var{s}, @var{f})\n\
2264 Return a @emph{copy} of the structure (array) @var{s} with the field @var{f}\n\
2267 If @var{f} is a cell array of strings or a character array, remove each of\n\
2268 the named fields.\n\
2269 @seealso{orderfields, fieldnames, isfield}\n\
2274 int nargin = args.
length ();
2286 for (
int i = 0; i < fcell.
numel (); i++)
2288 std::string key = fcell(i).string_value ();
2294 error (
"rmfield: structure does not contain field %s",
2326 DEFUN (struct_levels_to_print, args, nargout,
2328 @deftypefn {Built-in Function} {@var{val} =} struct_levels_to_print ()\n\
2329 @deftypefnx {Built-in Function} {@var{old_val} =} struct_levels_to_print (@var{new_val})\n\
2330 @deftypefnx {Built-in Function} {} struct_levels_to_print (@var{new_val}, \"local\")\n\
2331 Query or set the internal variable that specifies the number of\n\
2332 structure levels to display.\n\
2334 When called from inside a function with the @qcode{\"local\"} option, the\n\
2335 variable is changed locally for the function and any subroutines it calls.\n\
2336 The original variable value is restored when exiting the function.\n\
2337 @seealso{print_struct_array_contents}\n\
2344 DEFUN (print_struct_array_contents, args, nargout,
2346 @deftypefn {Built-in Function} {@var{val} =} print_struct_array_contents ()\n\
2347 @deftypefnx {Built-in Function} {@var{old_val} =} print_struct_array_contents (@var{new_val})\n\
2348 @deftypefnx {Built-in Function} {} print_struct_array_contents (@var{new_val}, \"local\")\n\
2349 Query or set the internal variable that specifies whether to print struct\n\
2352 If true, values of struct array elements are printed. This variable does\n\
2353 not affect scalar structures whose elements are always printed. In both\n\
2354 cases, however, printing will be limited to the number of levels specified\n\
2355 by @var{struct_levels_to_print}.\n\
2357 When called from inside a function with the @qcode{\"local\"} option, the\n\
2358 variable is changed locally for the function and any subroutines it calls.\n\
2359 The original variable value is restored when exiting the function.\n\
2360 @seealso{struct_levels_to_print}\n\
void warning_with_id(const char *id, const char *fmt,...)
bool is_object(void) const
#define SET_INTERNAL_VARIABLE_WITH_LIMITS(NM, MINVAL, MAXVAL)
size_t byte_size(void) const
const Cell & contents(const_iterator p) const
octave_idx_type nfields(void) const
dim_vector dims(void) const
std::string str(char sep= 'x') const
octave_refcount< octave_idx_type > count
void delete_elements(const idx_vector &i)
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
void increment_indent_level(void) const
bool fast_elem_insert_self(void *where, builtin_type_t btyp) const
void assign(const std::string &k, const Cell &val)
Cell reshape(const dim_vector &new_dims) const
octave_value fast_elem_extract(octave_idx_type n) const
dim_vector dims(void) const
static const idx_vector colon
OCTINTERP_API void print_usage(void)
octave_idx_type numel(void) const
Number of elements in the array.
void gripe_load(const char *type) const
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
octave_idx_type length(void) const
const octave_value & contents(const_iterator p) const
octave_scalar_map scalar_map_value(void) const
octave_map map_value(void) const
static bool Vprint_struct_array_contents
bool save_ascii(std::ostream &os)
octave_idx_type nfields(void) const
void resize(int n, int fill_value=0)
string_vector map_keys(void) const
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
bool fast_elem_insert(octave_idx_type n, const octave_value &x)
string_vector fieldnames(void) const
#define SET_INTERNAL_VARIABLE(NM)
void indent(std::ostream &os) const
void * get_data(void) const
bool save_ascii(std::ostream &os)
static void gripe_invalid_index_type(const std::string &nm, char t)
void setfield(const std::string &key, const octave_value &val)
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
octave_value to_array(void)
void gripe_save(const char *type) const
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
bool load_binary(std::istream &is, bool swap, oct_mach_info::float_format fmt)
bool load_ascii(std::istream &is)
octave_idx_type numel(void) const
herr_t hdf5_read_next_data(hid_t group_id, const char *name, void *dv)
virtual bool fast_elem_insert_self(void *where, builtin_type_t btyp) const
octave_idx_type numel(void) const
void newline(std::ostream &os) const
const_iterator end(void) const
F77_RET_T const double const double double * d
void gripe_indexed_cs_list(void)
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
Cell cell_value(void) const
Cell cell_value(void) const
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
octave_map map_value(void) const
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
static octave_value numeric_conv(const octave_value &val, const std::string &type)
void swap_bytes< 4 >(void *ptr)
bool load_binary(std::istream &is, bool swap, oct_mach_info::float_format fmt)
bool is_null_value(void) const
F77_RET_T const double const double * f
const_iterator begin(void) const
std::string key(const_iterator p) const
bool isfield(const std::string &name) const
bool valid_identifier(const char *s)
void gripe_nonbraced_cs_list_assignment(void)
octave_idx_type nfields(void) const
Cell dotref(const octave_value_list &idx, bool auto_add=false)
void error_with_id(const char *id, const char *fmt,...)
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
bool add_hdf5_data(hid_t loc_id, const octave_value &tc, const std::string &name, const std::string &doc, bool mark_as_global, bool save_as_floats)
bool save_ascii_data(std::ostream &os, const octave_value &val_arg, const std::string &name, bool mark_as_global, int precision)
bool print_name_tag(std::ostream &os, const std::string &name) const
const T * data(void) const
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
bool fast_elem_insert(octave_idx_type n, const octave_scalar_map &rhs)
const_iterator end(void) const
octave_value_list Fcellstr(const octave_value_list &args, int)
#define panic_impossible()
void rmfield(const std::string &key)
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
std::string read_binary_data(std::istream &is, bool swap, oct_mach_info::float_format fmt, const std::string &filename, bool &global, octave_value &tc, std::string &doc)
dim_vector redim(int n) const
std::string key(const_iterator p) const
octave_idx_type length(void) const
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
const_iterator begin(void) const
dim_vector dims(void) const
static void gripe_failed_assignment(void)
void decrement_indent_level(void) const
mxArray * as_mxArray(void) const
friend class octave_value
void setfield(const std::string &key, const Cell &val)
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
void print(std::ostream &os, bool pr_as_read_syntax=false)
static int Vstruct_levels_to_print
std::string type_name(void) const
charNDArray max(char d, const charNDArray &m)
octave_idx_type length(void) const
Number of elements in the array.
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
octave_value undef_subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
octave_idx_type nfields(void) const
bool print_name_tag(std::ostream &os, const std::string &name) const
octave_value dotref(const octave_value_list &idx, bool auto_add=false)
static void gripe_invalid_index1(void)
static octave_value numeric_conv(const octave_value &val, const std::string &type)
bool save_binary_data(std::ostream &os, const octave_value &tc, const std::string &name, const std::string &doc, bool mark_as_global, bool save_as_floats)
size_t byte_size(void) const
bool save_binary(std::ostream &os, bool &save_as_floats)
const octave_base_value & get_rep(void) const
bool is_cs_list(void) const
void print_with_name(std::ostream &os, const std::string &name) const
Cell index(const octave_value_list &idx, bool resize_ok=false) const
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
const_iterator seek(const std::string &k) const
mxArray * as_mxArray(void) const
bool is_undefined(void) const
static const pair_type keywords[]
bool load_ascii(std::istream &is)
OCTAVE_EMPTY_CPP_ARG std::string type_name(void) const
octave_value_list list_value(void) const
octave_scalar_map checkelem(octave_idx_type n) const
octave_value getfield(const std::string &key) const
octave_idx_type index(const_iterator p) const
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
bool all_scalars(void) const
static void gripe_invalid_index_for_assignment(void)
octave_fields::const_iterator const_iterator
const_iterator seek(const std::string &k) const
string_vector map_keys(void) const
octave_map map_value(void) const
static void maybe_warn_invalid_field_name(const std::string &key, const char *who)
bool save_binary(std::ostream &os, bool &save_as_floats)
octave_value storable_value(void) const
string_vector fieldnames(void) const
void print(std::ostream &os, bool pr_as_read_syntax=false)
bool is_zero_by_zero(void) const
octave_value next_subsref(const std::string &type, const std::list< octave_value_list > &idx, size_t skip=1)
octave_base_value * try_narrowing_conversion(void)
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
static octave_value empty_conv(const std::string &type, const octave_value &rhs=octave_value())
F77_RET_T const double * x
static bool scalar(const dim_vector &dims)
std::string read_ascii_data(std::istream &is, const std::string &filename, bool &global, octave_value &tc, octave_idx_type count)
size_t byte_size(void) const
octave_idx_type numel(void) const