84 #define READ_PAD(is_small_data_element, l) ((is_small_data_element) ? 4 : (((l)+7)/8)*8)
85 #define PAD(l) (((l) > 0 && (l) <= 4) ? 4 : (((l)+7)/8)*8)
86 #define INT8(l) ((l) == miINT8 || (l) == miUINT8 || (l) == miUTF8)
261 #define READ_INTEGER_DATA(TYPE, swap, data, size, len, stream) \
266 OCTAVE_LOCAL_BUFFER (TYPE, ptr, len); \
267 std::streamsize n_bytes = size * static_cast<std::streamsize> (len); \
268 stream.read (reinterpret_cast<char *> (ptr), n_bytes); \
270 swap_bytes< size > (ptr, len); \
271 for (octave_idx_type i = 0; i < len; i++) \
323 #undef READ_INTEGER_DATA
372 #define OCTAVE_MAT5_INTEGER_READ(TYP) \
376 std::streampos tmp_pos; \
378 if (read_mat5_tag (is, swap, type, len, is_small_data_element)) \
380 error ("load: reading matrix data for '%s'", retval.c_str ()); \
381 goto data_read_error; \
384 octave_idx_type n = re.numel (); \
385 tmp_pos = is.tellg (); \
386 read_mat5_integer_data (is, re.fortran_vec (), n, swap, \
387 static_cast<enum mat5_data_type> (type)); \
389 if (! is || error_state) \
391 error ("load: reading matrix data for '%s'", retval.c_str ()); \
392 goto data_read_error; \
395 is.seekg (tmp_pos + static_cast<std::streamoff>\
396 (READ_PAD (is_small_data_element, len))); \
403 if (read_mat5_tag (is, swap, type, len, is_small_data_element)) \
405 error ("load: reading matrix data for '%s'", \
407 goto data_read_error; \
411 read_mat5_binary_data (is, im.fortran_vec (), n, swap, \
412 static_cast<enum mat5_data_type> (type), flt_fmt); \
414 if (! is || error_state) \
416 error ("load: reading imaginary matrix data for '%s'", \
418 goto data_read_error; \
421 ComplexNDArray ctmp (dims); \
423 for (octave_idx_type i = 0; i < n; i++) \
424 ctmp(i) = Complex (re(i).double_value (), im(i)); \
438 bool& is_small_data_element)
443 if (! is.read (reinterpret_cast<char *> (&temp), 4))
444 goto data_read_error;
449 upper = (temp >> 16) & 0xffff;
450 type = temp & 0xffff;
456 is_small_data_element =
true;
460 if (! is.read (reinterpret_cast<char *> (&temp), 4))
461 goto data_read_error;
465 is_small_data_element =
false;
475 read_int (std::istream& is,
bool swap, int32_t& val)
477 is.read (reinterpret_cast<char *> (&val), 4);
504 bool isclass =
false;
508 int16_t number = *(
reinterpret_cast<const int16_t *
>(
"\x00\x01"));
510 std::string classname;
514 if ((number == 1) ^ swap)
521 int32_t element_length;
522 bool is_small_data_element;
523 if (
read_mat5_tag (is, swap, type, element_length, is_small_data_element))
535 is.read (inbuf, element_length);
541 if (uncompress (reinterpret_cast<Bytef *> (tmp), &destLen,
542 reinterpret_cast<Bytef *> (inbuf), element_length)
549 destLen = tmp[1] + 8;
550 std::string outbuf (destLen,
' ');
554 int err = uncompress (reinterpret_cast<Bytef *>
555 (const_cast<char *> (outbuf.c_str ())),
556 &destLen,
reinterpret_cast<Bytef *
> (inbuf),
577 msg =
"stream error";
592 case Z_VERSION_ERROR:
593 msg =
"version error";
597 error (
"load: error uncompressing data element (%s from zlib)",
602 std::istringstream gz_is (outbuf);
608 error (
"load: error probing size of compressed data element");
612 error (
"load: zlib unavailable, cannot read compressed data element");
621 error (
"load: invalid element type = %d", type);
622 goto early_read_error;
625 if (element_length == 0)
635 if (
read_mat5_tag (is, swap, type, len, is_small_data_element)
636 || type !=
miUINT32 || len != 8 || is_small_data_element)
638 error (
"load: invalid array flags subelement");
639 goto early_read_error;
645 imag = (flags & 0x0800) != 0;
647 global = (flags & 0x0400) != 0;
649 logicalvar = (flags & 0x0200) != 0;
662 if (
read_mat5_tag (is, swap, type, dim_len, is_small_data_element)
665 error (
"load: invalid dimensions array subelement");
666 goto early_read_error;
669 int ndims = dim_len / 4;
679 for (
int i = 0; i < ndims; i++)
686 std::streampos tmp_pos = is.tellg ();
687 is.seekg (tmp_pos + static_cast<std::streamoff>
688 (
READ_PAD (is_small_data_element, dim_len) - dim_len));
698 if (
read_mat5_tag (is, swap, type, len, is_small_data_element)
701 error (
"load: invalid array name subelement");
702 goto early_read_error;
710 std::streampos tmp_pos = is.tellg ();
714 if (! is.read (name, len))
715 goto data_read_error;
717 is.seekg (tmp_pos + static_cast<std::streamoff>
718 (
READ_PAD (is_small_data_element, len)));
729 Cell cell_array (dims);
742 error (
"load: reading cell data for '%s'", nm.c_str ());
743 goto data_read_error;
780 std::streampos tmp_pos;
782 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
784 error (
"load: reading sparse row data for '%s'", retval.c_str ());
785 goto data_read_error;
788 tmp_pos = is.tellg ();
791 static_cast<enum mat5_data_type> (type));
795 error (
"load: reading sparse row data for '%s'", retval.c_str ());
796 goto data_read_error;
799 is.seekg (tmp_pos + static_cast<std::streamoff>
800 (
READ_PAD (is_small_data_element, len)));
803 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
805 error (
"load: reading sparse column data for '%s'",
807 goto data_read_error;
810 tmp_pos = is.tellg ();
813 static_cast<enum mat5_data_type> (type));
817 error (
"load: reading sparse column data for '%s'",
819 goto data_read_error;
822 is.seekg (tmp_pos + static_cast<std::streamoff>
823 (
READ_PAD (is_small_data_element, len)));
826 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
828 error (
"load: reading sparse matrix data for '%s'",
830 goto data_read_error;
841 tmp_pos = is.tellg ();
843 static_cast<enum mat5_data_type> (type),
848 error (
"load: reading sparse matrix data for '%s'",
850 goto data_read_error;
853 is.seekg (tmp_pos + static_cast<std::streamoff>
854 (
READ_PAD (is_small_data_element, len)));
861 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
863 error (
"load: reading sparse matrix data for '%s'",
865 goto data_read_error;
874 error (
"load: reading imaginary sparse matrix data for '%s'",
876 goto data_read_error;
896 goto data_read_error;
908 if (ftype ==
"simple" || ftype ==
"scopedfunction")
910 if (fpath.length () == 0)
918 if ((fpath.length () >= mroot.length ())
919 && fpath.substr (0, mroot.length ()) == mroot
931 fpath.substr (mroot.length ());
939 std::string dir_name = str.substr (0, xpos);
956 names(0) = fname +
".oct";
957 names(1) = fname +
".mex";
958 names(2) = fname +
".m";
968 std::string dir_name = str.substr (0, xpos);
982 warning (
"load: can't find the file %s",
993 std::string dir_name = fpath.substr (0, xpos);
1006 warning (
"load: can't find the file %s",
1013 else if (ftype ==
"nested")
1015 warning (
"load: can't load nested function");
1018 else if (ftype ==
"anonymous")
1048 p0 != m2.
end (); p0++)
1050 std::string key = m2.
key (p0);
1059 eval_string (fname.substr (4),
true, parse_status);
1061 if (parse_status == 0)
1070 error (
"load: failed to load anonymous function handle");
1076 error (
"load: failed to load anonymous function handle");
1084 error (
"load: invalid function handle type");
1096 for (
int i = 0; i < n_fields; i++)
1100 if (
read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element)
1103 error (
"load: invalid field name subelement");
1104 goto data_read_error;
1109 std::streampos tmp_pos = is.tellg ();
1113 if (! is.read (elname, fn_len))
1114 goto data_read_error;
1116 is.seekg (tmp_pos + static_cast<std::streamoff>
1117 (
READ_PAD (is_small_data_element, fn_len)));
1120 elname[fn_len] =
'\0';
1125 std::vector<Cell> elt (n_fields);
1128 elt[i] =
Cell (dims);
1137 if (field(i) ==
"MCOS")
1143 goto data_read_error;
1145 elt[i](j) = fieldtc;
1153 m.
assign (field (i), elt[i]);
1162 if (
read_mat5_tag (is, swap, type, len, is_small_data_element)
1165 error (
"load: invalid class name");
1172 std::streampos tmp_pos = is.tellg ();
1176 if (! is.read (name, len))
1177 goto data_read_error;
1179 is.seekg (tmp_pos + static_cast<std::streamoff>
1180 (
READ_PAD (is_small_data_element, len)));
1193 int32_t field_name_length;
1199 if (
read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element)
1202 error (
"load: invalid field name length subelement");
1203 goto data_read_error;
1206 if (! is.read (reinterpret_cast<char *> (&field_name_length), fn_len))
1207 goto data_read_error;
1214 if (
read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element)
1217 error (
"load: invalid field name subelement");
1218 goto data_read_error;
1225 fn_len =
READ_PAD (is_small_data_element, fn_len);
1229 if (! is.read (elname, fn_len))
1230 goto data_read_error;
1232 std::vector<Cell> elt (n_fields);
1235 elt[i] =
Cell (dims);
1247 elt[i](j) = fieldtc;
1253 const char *key = elname + i*field_name_length;
1261 if (classname ==
"inline")
1267 m.
contents (
"args")(0).string_value ());
1273 std::list<std::string> ());
1279 warning (
"load: unable to reconstruct object inheritance");
1290 goto data_read_error;
1296 warning (
"load: element has been converted to a structure");
1324 out(i) = in(i).bool_value ();
1362 std::streampos tmp_pos;
1364 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
1366 error (
"load: reading matrix data for '%s'", retval.c_str ());
1367 goto data_read_error;
1371 tmp_pos = is.tellg ();
1378 error (
"load: reading matrix data for '%s'", retval.c_str ());
1379 goto data_read_error;
1382 is.seekg (tmp_pos + static_cast<std::streamoff>
1383 (
READ_PAD (is_small_data_element, len)));
1391 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
1393 error (
"load: reading matrix data for '%s'", retval.c_str ());
1394 goto data_read_error;
1404 error (
"load: reading imaginary matrix data for '%s'",
1406 goto data_read_error;
1431 std::streampos tmp_pos;
1433 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
1435 error (
"load: reading matrix data for '%s'", retval.c_str ());
1436 goto data_read_error;
1440 tmp_pos = is.tellg ();
1447 error (
"load: reading matrix data for '%s'", retval.c_str ());
1448 goto data_read_error;
1451 is.seekg (tmp_pos + static_cast<std::streamoff>
1452 (
READ_PAD (is_small_data_element, len)));
1463 out (i) =
static_cast<bool> (re (i));
1473 if (
read_mat5_tag (is, swap, type, len, is_small_data_element))
1475 error (
"load: reading matrix data for '%s'", retval.c_str ());
1476 goto data_read_error;
1486 error (
"load: reading imaginary matrix data for '%s'",
1488 goto data_read_error;
1494 ctmp(i) =
Complex (re(i), im(i));
1504 bool found_big_char =
false;
1510 found_big_char =
true;
1515 warning (
"load: can not read non-ASCII portions of UTF characters; replacing unreadable characters with '?'");
1522 bool utf8_multi_byte =
false;
1525 unsigned char a =
static_cast<unsigned char> (re(i));
1527 utf8_multi_byte =
true;
1530 if (utf8_multi_byte)
1532 warning (
"load: can not read multi-byte encoded UTF8 characters; replacing unreadable characters with '?'");
1536 =
static_cast<unsigned char> (re(i));
1551 is.seekg (pos + static_cast<std::streamoff> (element_length));
1560 error (
"load: trouble reading binary file '%s'", filename.c_str ());
1561 return std::string ();
1564 warning (
"skipping over '%s'", retval.c_str ());
1565 is.seekg (pos + static_cast<std::streamoff> (element_length));
1571 const std::string& filename)
1573 int16_t version = 0;
1575 uint64_t subsys_offset;
1577 is.seekg (116, std::ios::beg);
1578 is.read (reinterpret_cast<char *> (&subsys_offset), 8);
1580 is.seekg (124, std::ios::beg);
1581 is.read (reinterpret_cast<char *> (&version), 2);
1582 is.read (reinterpret_cast<char *> (&magic), 2);
1584 if (magic == 0x4d49)
1586 else if (magic == 0x494d)
1591 error (
"load: can't read binary file");
1596 version = ((version >> 8) & 0xff) + ((version & 0xff) << 8);
1598 if (version != 1 && !quiet)
1599 warning (
"load: found version %d binary MAT file, "
1600 "but only prepared for version 1", version);
1605 if (subsys_offset != 0x2020202020202020ULL && subsys_offset != 0ULL)
1608 is.seekg (subsys_offset, std::ios::beg);
1623 std::string outbuf (ilen - 7,
' ');
1626 char *ctmp =
const_cast<char *
> (outbuf.c_str ());
1628 ctmp[j-8] = itmp(j).char_value ();
1630 std::istringstream fh_ws (outbuf);
1641 is.seekg (128, std::ios::beg);
1652 if (bytes > 0 && bytes <= 4)
1653 temp = (bytes << 16) + type;
1657 if (! is.write (reinterpret_cast<char *> (&temp), 4))
1658 goto data_write_error;
1662 if (! is.write (reinterpret_cast<char *> (&temp), 4))
1663 goto data_write_error;
1674 #define MAT5_DO_WRITE(TYPE, data, count, stream) \
1677 OCTAVE_LOCAL_BUFFER (TYPE, ptr, count); \
1678 for (octave_idx_type i = 0; i < count; i++) \
1679 ptr[i] = static_cast<TYPE> (data[i]); \
1680 std::streamsize n_bytes = sizeof (TYPE) * static_cast<std::streamsize> (count); \
1681 stream.write (reinterpret_cast<char *> (ptr), n_bytes); \
1691 const double *data = m.
data ();
1697 warning (
"save: some values too large to save as floats --");
1698 warning (
"save: saving as doubles instead");
1704 double max_val, min_val;
1768 os.write (reinterpret_cast<const char *> (data), len);
1772 (*current_liboctave_error_handler)
1773 (
"unrecognized data format requested");
1777 if (
PAD (len) > len)
1779 static char buf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
1780 os.write (buf,
PAD (len) - len);
1788 const float *data = m.
data ();
1790 float max_val, min_val;
1850 os.write (reinterpret_cast<const char *> (data), len);
1858 (*current_liboctave_error_handler)
1859 (
"unrecognized data format requested");
1863 if (
PAD (len) > len)
1865 static char buf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
1866 os.write (buf,
PAD (len) - len);
1914 os.write (reinterpret_cast<const char *> (m), len);
1916 if (
PAD (len) > len)
1918 static char buf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
1919 os.write (buf,
PAD (len) - len);
1964 bool mark_as_global,
bool save_as_floats)
1973 false, save_as_floats))
1982 bool save_as_floats)
1990 bool too_large_for_float =
false;
1993 double tmp = val[i];
1998 too_large_for_float =
true;
2003 if (!too_large_for_float)
2048 return 8 + nel *
size;
2105 return PAD ((nel > 0 && nel * size <= 4 ? 4 : 8) + nel * size);
2113 bool save_as_floats)
2134 bool save_as_floats)
2155 bool save_as_floats,
bool mat7_format)
2157 size_t max_namelen = 63;
2158 size_t len = name.length ();
2163 ret +=
PAD (len > max_namelen ? max_namelen : len);
2171 if (chm.
numel () > 2)
2184 ret +=
PAD (nnz *
sizeof (int32_t));
2186 ret +=
PAD ((nc + 1) *
sizeof (int32_t));
2196 ret +=
PAD (nnz *
sizeof (int32_t));
2198 ret +=
PAD ((nc + 1) *
sizeof (int32_t));
2202 #define INT_LEN(nel, size) \
2205 octave_idx_type sz = nel * size; \
2210 else if (cname ==
"int8")
2212 else if (cname ==
"int16")
2214 else if (cname ==
"int32")
2216 else if (cname ==
"int64")
2218 else if (cname ==
"uint8")
2220 else if (cname ==
"uint16")
2222 else if (cname ==
"uint32")
2224 else if (cname ==
"uint64")
2248 for (
int i = 0; i < nel; i++)
2275 ret += 8 +
PAD (6 > max_namelen ? max_namelen : 6);
2280 ret += 8 +
PAD (classlen > max_namelen ? max_namelen : classlen);
2286 ret += 16 + fieldcnt * (max_namelen + 1);
2297 save_as_floats, mat7_format);
2312 int tmp =
sizeof (int32_t);
2317 tmp_idx[i] = idx[i];
2325 warning (
"save: skipping %s: dimension too large for MAT format",
2335 bool mark_as_global,
bool mat7_format,
2336 bool save_as_floats,
bool compressing)
2341 size_t max_namelen = 63;
2344 int nd = tc.
ndims ();
2349 for (
int i = 0; i < nd; i++)
2351 if (dv(i) > max_dim_val)
2376 if (nnz > max_dim_val || nc + 1 > max_dim_val)
2384 else if (dv.
numel () > max_dim_val)
2391 if (mat7_format && !compressing)
2395 std::ostringstream buf;
2400 save_as_floats,
true);
2406 std::string buf_str = buf.str ();
2407 uLongf srcLen = buf_str.length ();
2408 uLongf destLen = srcLen * 101 / 100 + 12;
2411 if (compress (reinterpret_cast<Bytef *> (out_buf), &destLen,
2412 reinterpret_cast<const Bytef *> (buf_str.c_str ()),
2417 static_cast<octave_idx_type> (destLen));
2419 os.write (out_buf, destLen);
2423 error (
"save: error compressing data element");
2433 (tc, name, save_as_floats, mat7_format));
2449 else if (cname ==
"int8")
2451 else if (cname ==
"int16")
2453 else if (cname ==
"int32")
2455 else if (cname ==
"int64")
2459 else if (cname ==
"uint16")
2461 else if (cname ==
"uint32")
2463 else if (cname ==
"uint64")
2487 os.write (reinterpret_cast<char *> (&flags), 4);
2492 os.write (reinterpret_cast<char *> (&nnz_32), 4);
2496 for (
int i = 0; i < nd; i++)
2499 os.write (reinterpret_cast<char *> (&n), 4);
2502 if (
PAD (dim_len) > dim_len)
2504 static char buf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
2505 os.write (buf,
PAD (dim_len) - dim_len);
2510 size_t namelen = name.length ();
2512 if (namelen > max_namelen)
2513 namelen = max_namelen;
2515 int paddedlength =
PAD (namelen);
2519 memset (paddedname, 0, paddedlength);
2520 strncpy (paddedname, name.c_str (), namelen);
2521 os.write (paddedname, paddedlength);
2535 const char *s = chm.
data ();
2538 buf[i] = *s++ & 0x00FF;
2540 os.write (reinterpret_cast<char *> (buf), len);
2542 if (paddedlength > len)
2544 static char padbuf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
2545 os.write (padbuf, paddedlength - len);
2584 for (
int i = 0; i < nnz; i++)
2585 buf (i) = m.
data (i);
2590 else if (cname ==
"int8")
2596 else if (cname ==
"int16")
2602 else if (cname ==
"int32")
2608 else if (cname ==
"int64")
2614 else if (cname ==
"uint8")
2620 else if (cname ==
"uint16")
2626 else if (cname ==
"uint32")
2632 else if (cname ==
"uint64")
2688 size_t namelen = classname.length ();
2690 if (namelen > max_namelen)
2691 namelen = max_namelen;
2693 int paddedlength =
PAD (namelen);
2697 memset (paddedname, 0, paddedlength);
2698 strncpy (paddedname, classname.c_str (), namelen);
2699 os.write (paddedname, paddedlength);
2706 "saveobj") != std::string ())
2710 m = tmp(0).map_value ();
2721 int32_t maxfieldnamelength = max_namelen + 1;
2726 os.write (reinterpret_cast<char *> (&maxfieldnamelength), 4);
2735 std::string key = keys(i);
2738 memset (buf, 0, max_namelen + 1);
2740 strncpy (buf, key.c_str (), max_namelen);
2741 os.write (buf, max_namelen + 1);
2748 std::vector<const octave_value *> elts (nf);
2777 error (
"save: error while writing '%s' to MAT file", name.c_str ());
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
std::string find_first_of(const string_vector &names)
#define INT_LEN(nel, size)
octave_idx_type nfields(void) const
charNDArray char_array_value(bool frc_str_conv=false) const
void gripe_wrong_type_arg(const char *name, const char *s, bool is_error)
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)
int8NDArray int8_array_value(void) const
octave_idx_type numel(void) const
Number of elements in the array.
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)
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
octave_value_list feval(const std::string &name, const octave_value_list &args, int nargout)
static string_vector names(const map_type &lst)
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_idx_type * cidx(void)
octave_value_list eval_string(const std::string &eval_str, bool silent, int &parse_status, int nargout)
octave_idx_type numel(void) const
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)
#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
octave_idx_type nzmax(void) const
int64NDArray int64_array_value(void) const
Cell cell_value(void) const
bool all_integers(double &max_val, double &min_val) const
FloatNDArray float_array_value(bool frc_str_conv=false) const
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 write_mat5_integer_data(std::ostream &os, const T *m, int size, octave_idx_type nel)
static void read_mat5_binary_data(std::istream &is, double *data, octave_idx_type count, bool swap, mat5_data_type type, oct_mach_info::float_format flt_fmt)
static std::string make_absolute(const std::string &s, const std::string &dot_path=get_current_directory())
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 std::string find_method(const std::string &class_name, const std::string &meth, std::string &dir_name, const std::string &pack_name=std::string())
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)
size_t size(T const (&)[z])
static int write_mat5_tag(std::ostream &is, int type, octave_idx_type bytes)
static void gripe_dim_too_large(const std::string &name)
SparseComplexMatrix sparse_complex_matrix_value(bool frc_str_conv=false) const
void read_doubles(std::istream &is, double *data, save_type type, octave_idx_type len, bool swap, oct_mach_info::float_format fmt)
const_iterator begin(void) const
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,...)
static std::string dir_sep_chars(void)
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
#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)
std::string class_name(void) const
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
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
SparseMatrix sparse_matrix_value(bool frc_str_conv=false) const
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)
uint32NDArray uint32_array_value(void) const
uint16NDArray uint16_array_value(void) const
void read_floats(std::istream &is, float *data, save_type type, octave_idx_type len, bool swap, oct_mach_info::float_format fmt)
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)