25 #if defined (HAVE_CONFIG_H)
81 #if defined (HAVE_ZLIB)
85 #define READ_PAD(is_small_data_element, l) ((is_small_data_element) ? 4 : (((l)+7)/8)*8)
86 #define PAD(l) (((l) > 0 && (l) <= 4) ? 4 : (((l)+7)/8)*8)
87 #define INT8(l) ((l) == miINT8 || (l) == miUINT8 || (l) == miUTF8)
256 template <
typename T>
262 #define READ_INTEGER_DATA(TYPE, swap, data, size, len, stream) \
267 OCTAVE_LOCAL_BUFFER (TYPE, ptr, len); \
268 std::streamsize n_bytes = size * static_cast<std::streamsize> (len); \
269 stream.read (reinterpret_cast<char *> (ptr), n_bytes); \
271 swap_bytes< size > (ptr, len); \
272 for (octave_idx_type i = 0; i < len; i++) \
324 #undef READ_INTEGER_DATA
373 #define OCTAVE_MAT5_INTEGER_READ(TYP) \
377 std::streampos tmp_pos; \
379 if (read_mat5_tag (is, swap, type, len, is_small_data_element)) \
380 error ("load: reading matrix data for '%s'", retval.c_str ()); \
382 octave_idx_type n = re.numel (); \
383 tmp_pos = is.tellg (); \
384 read_mat5_integer_data (is, re.fortran_vec (), n, swap, \
385 static_cast<enum mat5_data_type> (type)); \
388 error ("load: reading matrix data for '%s'", retval.c_str ()); \
390 is.seekg (tmp_pos + static_cast<std::streamoff> \
391 (READ_PAD (is_small_data_element, len))); \
398 if (read_mat5_tag (is, swap, type, len, is_small_data_element)) \
399 error ("load: reading matrix data for '%s'", \
403 read_mat5_binary_data (is, im.fortran_vec (), n, swap, \
404 static_cast<enum mat5_data_type> (type), flt_fmt); \
407 error ("load: reading imaginary matrix data for '%s'", \
410 ComplexNDArray ctmp (dims); \
412 for (octave_idx_type i = 0; i < n; i++) \
413 ctmp(i) = Complex (re(i).double_value (), im(i)); \
427 bool& is_small_data_element)
432 if (! is.read (reinterpret_cast<char *> (&temp), 4))
438 upper = (temp >> 16) & 0xffff;
439 type = temp & 0xffff;
445 is_small_data_element =
true;
449 if (! is.read (reinterpret_cast<char *> (&temp), 4))
454 is_small_data_element =
false;
463 is.read (reinterpret_cast<char *> (&val), 4);
490 bool isclass =
false;
494 int16_t
number = *(
reinterpret_cast<const int16_t *
>(
"\x00\x01"));
500 if ((number == 1) ^
swap)
507 int32_t element_length;
508 bool is_small_data_element;
509 if (
read_mat5_tag (is, swap, type, element_length, is_small_data_element))
514 #if defined (HAVE_ZLIB)
521 is.read (inbuf, element_length);
527 if (uncompress (reinterpret_cast<Bytef *> (
tmp), &destLen,
528 reinterpret_cast<Bytef *> (inbuf), element_length)
530 error (
"load: error probing size of compressed data element");
536 destLen = tmp[1] + 8;
541 int err = uncompress (reinterpret_cast<Bytef *>
542 (const_cast<char *> (outbuf.c_str ())),
543 &destLen,
reinterpret_cast<Bytef *
> (inbuf),
564 msg =
"stream error";
579 case Z_VERSION_ERROR:
580 msg =
"version error";
584 error (
"load: error uncompressing data element (%s from zlib)",
589 std::istringstream gz_is (outbuf);
606 error (
"load: invalid element type = %d", type);
609 if (element_length == 0)
619 if (
read_mat5_tag (is, swap, type, len, is_small_data_element)
620 || type !=
miUINT32 || len != 8 || is_small_data_element)
621 error (
"load: invalid array flags subelement");
626 imag = (flags & 0x0800) != 0;
628 global = (flags & 0x0400) != 0;
630 logicalvar = (flags & 0x0200) != 0;
643 if (
read_mat5_tag (is, swap, type, dim_len, is_small_data_element)
645 error (
"load: invalid dimensions array subelement");
647 int ndims = dim_len / 4;
657 for (
int i = 0;
i < ndims;
i++)
664 std::streampos tmp_pos = is.tellg ();
665 is.seekg (tmp_pos + static_cast<std::streamoff>
666 (
READ_PAD (is_small_data_element, dim_len) - dim_len));
676 if (
read_mat5_tag (is, swap, type, len, is_small_data_element)
678 error (
"load: invalid array name subelement");
685 std::streampos tmp_pos = is.tellg ();
689 if (! is.read (
name, len))
690 goto data_read_error;
692 is.seekg (tmp_pos + static_cast<std::streamoff>
693 (
READ_PAD (is_small_data_element, len)));
704 Cell cell_array (dims);
716 error (
"load: reading cell data for '%s'", nm.c_str ());
752 std::streampos tmp_pos;
754 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
755 error (
"load: reading sparse row data for '%s'", retval.c_str ());
757 tmp_pos = is.tellg ();
760 static_cast<enum mat5_data_type> (type));
763 error (
"load: reading sparse row data for '%s'", retval.c_str ());
765 is.seekg (tmp_pos + static_cast<std::streamoff>
766 (
READ_PAD (is_small_data_element, len)));
769 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
770 error (
"load: reading sparse column data for '%s'",
773 tmp_pos = is.tellg ();
776 static_cast<enum mat5_data_type> (type));
779 error (
"load: reading sparse column data for '%s'",
782 is.seekg (tmp_pos + static_cast<std::streamoff>
783 (
READ_PAD (is_small_data_element, len)));
786 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
787 error (
"load: reading sparse matrix data for '%s'",
798 tmp_pos = is.tellg ();
800 static_cast<enum mat5_data_type> (type),
804 error (
"load: reading sparse matrix data for '%s'",
807 is.seekg (tmp_pos + static_cast<std::streamoff>
808 (
READ_PAD (is_small_data_element, len)));
815 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
816 error (
"load: reading sparse matrix data for '%s'",
824 error (
"load: reading imaginary sparse matrix data for '%s'",
844 goto data_read_error;
856 if (ftype ==
"simple" || ftype ==
"scopedfunction")
866 if ((fpath.length () >= mroot.length ())
867 && fpath.substr (0, mroot.length ()) == mroot
879 fpath.substr (mroot.length ());
903 std::list<std::string> names;
904 names.push_back (fname +
".oct");
905 names.push_back (fname +
".mex");
906 names.push_back (fname +
".m");
930 warning (
"load: can't find the file %s",
954 warning (
"load: can't find the file %s",
961 else if (ftype ==
"nested")
963 warning (
"load: can't load nested function");
966 else if (ftype ==
"anonymous")
996 p0 != m2.
end (); p0++)
1007 eval_string (fname.substr (4),
true, parse_status);
1009 if (parse_status != 0)
1010 error (
"load: failed to load anonymous function handle");
1016 error (
"load: failed to load anonymous function handle");
1023 error (
"load: invalid function handle type");
1033 for (
int i = 0;
i < n_fields;
i++)
1037 if (
read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element)
1039 error (
"load: invalid field name subelement");
1043 std::streampos tmp_pos = is.tellg ();
1047 if (! is.read (elname, fn_len))
1048 goto data_read_error;
1050 is.seekg (tmp_pos + static_cast<std::streamoff>
1051 (
READ_PAD (is_small_data_element, fn_len)));
1054 elname[fn_len] =
'\0';
1059 std::vector<Cell> elt (n_fields);
1062 elt[
i] =
Cell (dims);
1071 if (field(
i) ==
"MCOS")
1077 goto data_read_error;
1079 elt[
i](j) = fieldtc;
1096 if (
read_mat5_tag (is, swap, type, len, is_small_data_element)
1098 error (
"load: invalid class name");
1103 std::streampos tmp_pos = is.tellg ();
1107 if (! is.read (
name, len))
1108 goto data_read_error;
1110 is.seekg (tmp_pos + static_cast<std::streamoff>
1111 (
READ_PAD (is_small_data_element, len)));
1124 int32_t field_name_length;
1130 if (
read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element)
1132 error (
"load: invalid field name length subelement");
1134 if (! is.read (reinterpret_cast<char *> (&field_name_length), fn_len))
1135 goto data_read_error;
1142 if (
read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element)
1144 error (
"load: invalid field name subelement");
1150 fn_len =
READ_PAD (is_small_data_element, fn_len);
1154 if (! is.read (elname, fn_len))
1155 goto data_read_error;
1157 std::vector<Cell> elt (n_fields);
1160 elt[
i] =
Cell (dims);
1172 elt[
i](j) = fieldtc;
1178 const char *key = elname +
i*field_name_length;
1186 if (classname ==
"inline")
1192 m.
contents (
"args")(0).string_value ());
1198 std::list<std::string> ());
1204 warning (
"load: unable to reconstruct object inheritance");
1216 catch (
const octave::execution_exception&)
1218 goto data_read_error;
1225 warning (
"load: element has been converted to a structure");
1253 out(
i) = in(
i).bool_value ();
1290 std::streampos tmp_pos;
1292 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
1293 error (
"load: reading matrix data for '%s'", retval.c_str ());
1296 tmp_pos = is.tellg ();
1302 error (
"load: reading matrix data for '%s'", retval.c_str ());
1304 is.seekg (tmp_pos + static_cast<std::streamoff>
1305 (
READ_PAD (is_small_data_element, len)));
1313 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
1314 error (
"load: reading matrix data for '%s'", retval.c_str ());
1322 error (
"load: reading imaginary matrix data for '%s'",
1347 std::streampos tmp_pos;
1349 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
1350 error (
"load: reading matrix data for '%s'", retval.c_str ());
1353 tmp_pos = is.tellg ();
1359 error (
"load: reading matrix data for '%s'", retval.c_str ());
1361 is.seekg (tmp_pos + static_cast<std::streamoff>
1362 (
READ_PAD (is_small_data_element, len)));
1373 out (
i) =
static_cast<bool> (re (
i));
1383 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
1384 error (
"load: reading matrix data for '%s'", retval.c_str ());
1392 error (
"load: reading imaginary matrix data for '%s'",
1408 bool found_big_char =
false;
1414 found_big_char =
true;
1419 warning (
"load: can not read non-ASCII portions of UTF characters; replacing unreadable characters with '?'");
1426 bool utf8_multi_byte =
false;
1429 unsigned char a =
static_cast<unsigned char> (re(
i));
1431 utf8_multi_byte =
true;
1434 if (utf8_multi_byte)
1436 warning (
"load: can not read multi-byte encoded UTF8 characters; replacing unreadable characters with '?'");
1440 =
static_cast<unsigned char> (re(
i));
1455 is.seekg (pos + static_cast<std::streamoff> (element_length));
1464 error (
"load: trouble reading binary file '%s'", filename.c_str ());
1467 warning (
"load: skipping over '%s'", retval.c_str ());
1468 is.seekg (pos + static_cast<std::streamoff> (element_length));
1476 int16_t version = 0;
1478 uint64_t subsys_offset;
1480 is.seekg (116, std::ios::beg);
1481 is.read (reinterpret_cast<char *> (&subsys_offset), 8);
1483 is.seekg (124, std::ios::beg);
1484 is.read (reinterpret_cast<char *> (&version), 2);
1485 is.read (reinterpret_cast<char *> (&magic), 2);
1487 if (magic == 0x4d49)
1489 else if (magic == 0x494d)
1494 error (
"load: can't read binary file");
1500 version = ((version >> 8) & 0xff) + ((version & 0xff) << 8);
1502 if (version != 1 && ! quiet)
1503 warning (
"load: found version %d binary MAT file, "
1504 "but only prepared for version 1", version);
1509 if (subsys_offset != 0x2020202020202020ULL && subsys_offset != 0ULL)
1512 is.seekg (subsys_offset, std::ios::beg);
1530 char *ctmp =
const_cast<char *
> (outbuf.c_str ());
1532 ctmp[j-8] = itmp(j).char_value ();
1534 std::istringstream fh_ws (outbuf);
1545 is.seekg (128, std::ios::beg);
1556 if (bytes > 0 && bytes <= 4)
1557 temp = (bytes << 16) + type;
1561 if (! is.write (reinterpret_cast<char *> (&temp), 4))
1566 if (! is.write (reinterpret_cast<char *> (&temp), 4))
1575 #define MAT5_DO_WRITE(TYPE, data, count, stream) \
1578 OCTAVE_LOCAL_BUFFER (TYPE, ptr, count); \
1579 for (octave_idx_type i = 0; i < count; i++) \
1580 ptr[i] = static_cast<TYPE> (data[i]); \
1581 std::streamsize n_bytes = sizeof (TYPE) * static_cast<std::streamsize> (count); \
1582 stream.write (reinterpret_cast<char *> (ptr), n_bytes); \
1592 const double *data = m.
data ();
1598 warning (
"save: some values too large to save as floats --");
1599 warning (
"save: saving as doubles instead");
1605 double max_val, min_val;
1669 os.write (reinterpret_cast<const char *> (data), len);
1673 error (
"unrecognized data format requested");
1677 if (
PAD (len) > len)
1679 static char buf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
1680 os.write (buf,
PAD (len) - len);
1688 const float *data = m.
data ();
1690 float max_val, min_val;
1750 os.write (reinterpret_cast<const char *> (data), len);
1758 error (
"unrecognized data format requested");
1762 if (
PAD (len) > len)
1764 static char buf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
1765 os.write (buf,
PAD (len) - len);
1769 template <
typename T>
1813 os.write (reinterpret_cast<const char *> (m), len);
1815 if (
PAD (len) > len)
1817 static char buf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
1818 os.write (buf,
PAD (len) - len);
1872 false, save_as_floats))
1889 bool too_large_for_float =
false;
1892 double tmp = val[
i];
1897 too_large_for_float =
true;
1902 if (! too_large_for_float)
1947 return 8 + nel *
size;
2003 return PAD ((nel > 0 && nel * size <= 4 ? 4 : 8) + nel * size);
2055 size_t max_namelen = 63;
2056 size_t len = name.length ();
2061 ret +=
PAD (len > max_namelen ? max_namelen : len);
2069 if (chm.
numel () > 2)
2082 ret +=
PAD (nnz *
sizeof (int32_t));
2084 ret +=
PAD ((nc + 1) *
sizeof (int32_t));
2094 ret +=
PAD (nnz *
sizeof (int32_t));
2096 ret +=
PAD ((nc + 1) *
sizeof (int32_t));
2100 #define INT_LEN(nel, size) \
2103 octave_idx_type sz = nel * size; \
2108 else if (cname ==
"int8")
2110 else if (cname ==
"int16")
2112 else if (cname ==
"int32")
2114 else if (cname ==
"int64")
2116 else if (cname ==
"uint8")
2118 else if (cname ==
"uint16")
2120 else if (cname ==
"uint32")
2122 else if (cname ==
"uint64")
2146 for (
int i = 0;
i < nel;
i++)
2173 ret += 8 +
PAD (6 > max_namelen ? max_namelen : 6);
2176 size_t classlen = tc.
class_name ().length ();
2178 ret += 8 +
PAD (classlen > max_namelen ? max_namelen : classlen);
2184 ret += 16 + fieldcnt * (max_namelen + 1);
2194 save_as_floats, mat7_format);
2209 int tmp =
sizeof (int32_t);
2214 tmp_idx[
i] = idx[
i];
2222 warning (
"save: skipping %s: dimension too large for MAT format",
2232 bool mark_as_global,
bool mat7_format,
2238 size_t max_namelen = 63;
2241 int nd = tc.
ndims ();
2246 for (
int i = 0;
i < nd;
i++)
2248 if (
dv(
i) > max_dim_val)
2273 if (nnz > max_dim_val || nc + 1 > max_dim_val)
2281 else if (dv.
numel () > max_dim_val)
2287 #if defined (HAVE_ZLIB)
2289 if (mat7_format && ! compressing)
2293 std::ostringstream buf;
2298 save_as_floats,
true);
2305 uLongf srcLen = buf_str.length ();
2306 uLongf destLen = srcLen * 101 / 100 + 12;
2309 if (compress (reinterpret_cast<Bytef *> (out_buf), &destLen,
2310 reinterpret_cast<const Bytef *> (buf_str.c_str ()),
2313 error (
"save: error compressing data element");
2316 static_cast<octave_idx_type> (destLen));
2318 os.write (out_buf, destLen);
2326 octave_unused_parameter (compressing);
2331 (tc, name, save_as_floats, mat7_format));
2347 else if (cname ==
"int8")
2349 else if (cname ==
"int16")
2351 else if (cname ==
"int32")
2353 else if (cname ==
"int64")
2357 else if (cname ==
"uint16")
2359 else if (cname ==
"uint32")
2361 else if (cname ==
"uint64")
2383 error (
"save: error while writing '%s' to MAT file", name.c_str ());
2386 os.write (reinterpret_cast<char *> (&flags), 4);
2391 os.write (reinterpret_cast<char *> (&nnz_32), 4);
2395 for (
int i = 0;
i < nd;
i++)
2398 os.write (reinterpret_cast<char *> (&n), 4);
2401 if (
PAD (dim_len) > dim_len)
2403 static char buf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
2404 os.write (buf,
PAD (dim_len) - dim_len);
2409 size_t namelen = name.length ();
2411 if (namelen > max_namelen)
2412 namelen = max_namelen;
2414 int paddedlength =
PAD (namelen);
2418 memset (paddedname, 0, paddedlength);
2419 strncpy (paddedname, name.c_str (), namelen);
2420 os.write (paddedname, paddedlength);
2434 const char *
s = chm.
data ();
2437 buf[
i] = *s++ & 0x00FF;
2439 os.write (reinterpret_cast<char *> (buf), len);
2441 if (paddedlength > len)
2443 static char padbuf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
2444 os.write (padbuf, paddedlength - len);
2483 for (
int i = 0;
i < nnz;
i++)
2489 else if (cname ==
"int8")
2495 else if (cname ==
"int16")
2501 else if (cname ==
"int32")
2507 else if (cname ==
"int64")
2513 else if (cname ==
"uint8")
2519 else if (cname ==
"uint16")
2525 else if (cname ==
"uint32")
2531 else if (cname ==
"uint64")
2563 error (
"save: error while writing '%s' to MAT file", name.c_str ());
2587 size_t namelen = classname.length ();
2589 if (namelen > max_namelen)
2590 namelen = max_namelen;
2592 int paddedlength =
PAD (namelen);
2596 memset (paddedname, 0, paddedlength);
2597 strncpy (paddedname, classname.c_str (), namelen);
2598 os.write (paddedname, paddedlength);
2611 m =
tmp(0).map_value ();
2613 catch (
const octave::execution_exception&)
2615 error (
"save: error while writing '%s' to MAT file",
2626 int32_t maxfieldnamelength = max_namelen + 1;
2631 os.write (reinterpret_cast<char *> (&maxfieldnamelength), 4);
2643 memset (buf, 0, max_namelen + 1);
2645 strncpy (buf, key.c_str (), max_namelen);
2646 os.write (buf, max_namelen + 1);
2653 std::vector<const octave_value *> elts (nf);
2670 error (
"save: error while writing '%s' to MAT file",
uint8NDArray uint8_array_value(void) const
string_vector keys(void) const
bool is_object(void) const
ComplexNDArray complex_array_value(bool frc_str_conv=false) const
static std::string system_path(void)
const Cell & contents(const_iterator p) const
bool is_range(void) const
octave_idx_type cols(void) const
#define INT_LEN(nel, size)
octave_idx_type nfields(void) const
charNDArray char_array_value(bool frc_str_conv=false) const
octave_function * load_fcn_from_file(const std::string &file_name, const std::string &dir_name, const std::string &dispatch_type, const std::string &package_name, const std::string &fcn_name, bool autoload)
static void read_int(std::istream &is, bool swap, int32_t &val)
void assign(const std::string &k, const Cell &val)
std::string find_first_of(const std::list< std::string > &names)
int8NDArray int8_array_value(void) const
octave_idx_type numel(void) const
Number of elements in the array.
static std::string dir_sep_chars(void)
identity matrix If supplied two scalar respectively For allows like xample val
int16NDArray int16_array_value(void) const
const octave_value & contents(const_iterator p) const
octave_map map_value(void) const
save_type get_save_type(double, double)
static void set_scope(scope_id scope)
static void read_mat5_binary_data(std::istream &is, double *data, octave_idx_type count, bool swap, mat5_data_type type, octave::mach_info::float_format flt_fmt)
bool is_complex_scalar(void) const
void resize(int n, int fill_value=0)
uint64NDArray uint64_array_value(void) const
void swap_bytes< 8 >(void *ptr)
void error(const char *fmt,...)
int32NDArray int32_array_value(void) const
static scope_id alloc_scope(void)
static octave_value subsys_ov
bool save_mat5_binary_element(std::ostream &os, const octave_value &tc, const std::string &name, bool mark_as_global, bool mat7_format, bool save_as_floats, bool compressing)
octave::mach_info::float_format flt_fmt
octave_idx_type * cidx(void)
octave_idx_type numel(void) const
static std::string find_method(const std::string &class_name, const std::string &meth, std::string &dir_name, const std::string &pack_name="")
octave_value fcn_val(void) const
octave_fcn_handle * fcn_handle_value(bool silent=false) const
std::string read_mat5_binary_element(std::istream &is, const std::string &filename, bool swap, bool &global, octave_value &tc)
void read_floats(std::istream &is, float *data, save_type type, octave_idx_type len, bool swap, octave::mach_info::float_format fmt)
#define MAT5_DO_WRITE(TYPE, data, count, stream)
static void write_mat5_array(std::ostream &os, const NDArray &m, bool save_as_floats)
const_iterator end(void) const
boolNDArray bool_array_value(bool warn=false) const
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
octave_idx_type nnz(void) const
Actual number of nonzero terms.
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
octave_idx_type nzmax(void) const
Amount of storage for nonzero elements.
int64NDArray int64_array_value(void) const
Cell cell_value(void) const
static std::string make_absolute(const std::string &s, const std::string &dot_path=get_current_directory())
bool all_integers(double &max_val, double &min_val) const
FloatNDArray float_array_value(bool frc_str_conv=false) const
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
void swap_bytes< 4 >(void *ptr)
void add_fcn(void(*fcn)(void))
#define READ_INTEGER_DATA(TYPE, swap, data, size, len, stream)
const_iterator begin(void) const
bool reconstruct_parents(void)
octave_value convert_to_str(bool pad=false, bool force=false, char type= '\'') const
bool is_complex_matrix(void) const
std::string key(const_iterator p) const
bool is_sparse_type(void) const
octave_idx_type nfields(void) const
#define READ_PAD(is_small_data_element, l)
bool is_bool_type(void) const
bool is_real_scalar(void) const
std::string string_value(bool force=false) const
void read_doubles(std::istream &is, double *data, save_type type, octave_idx_type len, bool swap, octave::mach_info::float_format fmt)
nd deftypefn *octave_map m
void write_mat5_integer_data(std::ostream &os, const T *m, int size, octave_idx_type nel)
FloatComplexNDArray float_complex_array_value(bool frc_str_conv=false) const
static bool write_mat5_cell_array(std::ostream &os, const Cell &cell, bool mark_as_global, bool save_as_floats)
bool is_string(void) const
void read_mat5_integer_data(std::istream &is, T *m, octave_idx_type count, bool swap, mat5_data_type type)
const T * data(void) const
bool is_inline_function(void) const
bool is_complex_type(void) const
const_iterator end(void) const
static void write_mat5_sparse_index_vector(std::ostream &os, const octave_idx_type *idx, octave_idx_type nel)
static void assign(const std::string &name, const octave_value &value=octave_value(), scope_id scope=xcurrent_scope, context_id context=xdefault_context, bool force_add=false)
static void push(octave_function *f, symbol_table::scope_id scope=symbol_table::current_scope(), symbol_table::context_id context=symbol_table::current_context())
int read_mat5_binary_file_header(std::istream &is, bool &swap, bool quiet, const std::string &filename)
static int write_mat5_tag(std::ostream &is, int type, octave_idx_type bytes)
SparseComplexMatrix sparse_complex_matrix_value(bool frc_str_conv=false) const
const_iterator begin(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
dim_vector dims(void) const
int save_mat5_element_length(const octave_value &tc, const std::string &name, bool save_as_floats, bool mat7_format)
void warning(const char *fmt,...)
octave::unwind_protect frame
static void warn_dim_too_large(const std::string &name)
charNDArray max(char d, const charNDArray &m)
NDArray array_value(bool frc_str_conv=false) const
octave_idx_type * ridx(void)
octave_scalar_map scalar_map_value(void) const
=val(i)}if ode{val(i)}occurs in table i
#define OCTAVE_EXEC_PREFIX
bool is_uint8_type(void) const
static octave_value make_fcn_handle(octave_builtin::fcn ff, const std::string &nm)
bool all_integers(float &max_val, float &min_val) const
#define OCTAVE_MAT5_INTEGER_READ(TYP)
void warn_wrong_type_arg(const char *name, const octave_value &tc)
std::string class_name(void) const
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
octave::sys::file_stat fs(filename)
static int read_mat5_tag(std::istream &is, bool swap, int32_t &type, int32_t &bytes, bool &is_small_data_element)
ColumnVector imag(const ComplexColumnVector &a)
std::complex< float > FloatComplex
OCTAVE_EXPORT octave_value_list error nd deftypefn *const octave_scalar_map err
SparseMatrix sparse_matrix_value(bool frc_str_conv=false) const
OCTINTERP_API octave_value_list eval_string(const std::string &, bool silent, int &parse_status, int nargout)
std::complex< double > Complex
const T * fortran_vec(void) const
octave_fields::const_iterator const_iterator
bool is_single_type(void) const
bool reconstruct_exemplar(void)
ColumnVector real(const ComplexColumnVector &a)
write the output to stdout if nargout is
Vector representing the dimensions (size) of an Array.
uint32NDArray uint32_array_value(void) const
void err_disabled_feature(const std::string &fcn, const std::string &feature, const std::string &pkg)
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
uint16NDArray uint16_array_value(void) const
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
bool too_large_for_float(void) const
static void erase_scope(scope_id scope)
bool is_real_matrix(void) const
int save_mat5_array_length(const double *val, octave_idx_type nel, bool save_as_floats)